KB-27670: Checking the frame where an event has occurred
Question: How can I check the frame where an event has occurred? Solution: To do so, you can use Frame.Name property. On the example below, the script tests the frame the event has occurred, and opens a screen on another frame: If Frame.Name = "Left" then Application.GetFrame("Right").OpenSc ...
KB-27135: Setting the height of the window opened by DoModal() method
Question: When clicking an object in an application, the Application.DoModal() method is executed to open a modal screen. Is it possible to set the height of the modal screen to be opened according to the object that was clicked on? Solution: Yes, it is possible. On each object's Application.Do ...
KB-29411: Concatenating two variables on E3
Question: How can I concatenate two variables on E3? Solution: To do so, you must use the "&" character. For example: var1 = var2 & var3
KB-32178: Copying files from another network's machine via E3
Question: How can I copy a file that is on another machine of the network via E3? Solution: To do so, you can write the following script on E3 Viewer: Argument = "cmd /C Copy "&Source & " " & Destiny 'Copy and pastes the file: Set ObjShell = CreateObject("WScript.Shell") Call ObjShell.Run(Argume ...
KB-30425: Comparing values returned from a Query
Question: How can I compare two values returned from a Query via GetADORecordset() method? Solution: To do so, you can set the Field's value in an internal variable and then compare the values. For example: Dim aux, aux1 set query = Screen.Item("Query") set rs = query.GetADORecordset() aux = rs ...
KB-29397: Script returning Overflow error
Question: When executing a script, the following error message is displayed: Script error (TableScreen): Error on line 291: 'Overflow' On the line 291, the script has the following: variable = 2200 + ((numRegister) * 529.166666666667) How can I fix this problem? Solution: This is a Windows 2003 ...
KB-33026: Dragging screen objects with the mouse at run time
Question: How can I drag screen objects with the mouse at run time? Solution: To do so, there are two options: 1) Creating a Translation or Rotation Animation for the object. With this option, the object stays limited to the animation's path, but it really is "dragged" with the mouse. 2) Changi ...
KB-33057: Getting information about date and time on different variables
Question: How can I get information about the current date (day, month, year, hour, minute and second) on different variables? Solution: To do so, you can use the now command, which returns the current moment with date and time in a variable of subtype datetime. Since you want to get each value ...
KB-33039: Script of OnStartRunning event causing error on I/O Tags writing
Question: On an application, a query is performed on the Database by a script, which is inserted on Data Server's OnStartRunning event, and the results must be written on Internal Tags and on I/O Tags. However, when trying to write on the I/O Tags, an error occurs. How can I solve this problem? ...
KB-30882: Opening the Windows calculator via script
Question: How can I execute the Windows calculator via script? Solution: There are two ways to do so: 1) Using Viewer's ExecuteExternalApp method, which executes external software. For example: Application.ExecuteExternalApp "calc.exe", "", "", 1 On this script, the code '1' is activated and sho ...
KB-33027: Debugging scripts on E3
Question: How can I debug scripts on E3? Solution: If the script is executed on E3 Viewer, you can use the MsgBox "Message" command. If the script is executed on E3 Server, you can use the Application.Trace "Message" command. With this method, the message is automatically added to a TXT file, w ...
KB-29516: Accessing the properties of an object that is on another screen via scripts
Question: How can I access the properties of an object that is on another frame or screen via scripts? Solution: To do so, you must create Internal Tags on E3 Viewer and load the values of the tags' properties that you want to supervise.
KB-29923: CopyConfig method with E3Browser
Question: Does CopyConfig method work with E3Browser? Solution: No, it does not. This method was created to be used only with E3Chart.
KB-28158: Testing passwords via scripts
Question: Without using E3 user controls, how can I test a password to validate it, and then open a screen via scripts? Solution: To do so, you must use InputBox method. For example: Dim Input Input = InputBox("Type the password to access") If Input = "a" Then ' Testing if the typed password is ...
KB-29022: GetADORecordSet() method does not work with remote E3 Viewer
Question: Why does GetADORecordSet() method, which correctly works with a local E3 Viewer, shows a script error when executed with a remote E3 Viewer? Solution: This happens because Database's EnableLocalCreation option is enabled (TRUE). This option allows the queries configured on the Database ...
KB-27314: Size limit of the DocString property's content
Question: What is the size limit of the DocString property's content? Solution: This limit is of 1GB of characters or the free memory's size (if it is smaller than 1GB).
KB-30528: Displaying the name of the active Formula at the moment
Question: How can I display the name of the active Formula at the moment? Solution: To do so, after the script's line that passes the Formula's name to the method responsible for loading it, insert a line that attributes the name used on the previous method to an Internal Tag. On screen, create ...
KB-32839: OnTagRead event's purpose
Question: What is the OnTagRead event's purpose? Solution: This is an I/O Driver's event. It is fired on every reading performed by the Driver, and it does not depend on the tags being read, or on its total amount. To use this event, you must configure the tags' EnableDriverEvent property to ...
KB-31734: Using the Validate event
Question: What is the Validate event's purpose? How can I use it? Solution: You use this event to validate the input data, allowing you to cancel the operation if the received data is not as good as you expected. The Validate event is executed after typing data on the SetPoint and before data is ...
Displaying logged users on multiple Viewers
Question: Is it possible to display on the Viewer which users are logged in the Server? Solution: Yes. The attached application is an example that shows it is possible to display which users are logged in the server, considering multiple Viewers on the network. An internal tag that indicates wh ...