New Community Ranking System
Our Community ranking system has recently been updated. You may notice changes in user rankings and receive system messages or notifications. If you have questions about how the new ranking works, please refer to the announcement post for more details (click here).
Access vast amounts of technical know-how and pro tips from our community of Geo SCADA experts.
Search in
Link copied. Please paste this link to share this article on your social media post.
Originally published on Geo SCADA Knowledge Base by sbeadle | October 15, 2026 02:37 PM
This is an evolving article and new items will be added periodically
Geo SCADA 2025 R2 includes a new scripting engine which is backwards-compatible to previously-written VBScript. Many scripts will run unchanged, but there are some minor differences in execution. Many of these issues are caused by minor errors or assumptions in existing code. This page contains a description of various issues and how to make small changes to address them in this newer version.
Many items also relate to JScript execution, and some issues specific to JScript are also mentioned in the last section.
We have seen script written incorrectly, which assumes that the SetValue and Value methods take arguments in order to write the value to the database item. For example, this is incorrect:
set x = Server.FindObject("Example Projects.New Float")
x.Interface.Value(3.14)
This code will not set the value to 3.14. The correct syntax for this is:
set x = Server.FindObject("Example Projects.New Float")
x.Interface.Value = 3.14
This is because the item property Value takes precedence over the identically named item method Value. Code written with this error in previous versions of Geo SCADA Expert would ignore the method arguments and not set the variable’s value. Code written with this error in this new version of Geo SCADA Expert will raise a script error like this:
To overcome this issue, you should correct the syntax accordingly.
Menu methods such as Menu.Init, Menu.AddItem, and Menu.Separator do not return values. In previous versions of Geo SCADA Expert, these methods returned empty strings. In this new version of Geo SCADA Expert, Null is returned, which might make code behave differently if you have used the return value.
There is no need to use the return value in these functions.
The objects returned by Form functions that add controls, such as Form.AddEditBox, no longer support default properties, however this can be easily rectified. For example, the following will now raise an error on the final line.
Form.Init( "Test")
Set field = Form.AddEditBox(2,2,10,1)
field.Value = "test"
MsgBox field
You can resolve this by adding .Value:
Form.Init( "Test")
Set field = Form.AddEditBox(2,2,10,1)
field.Value = "test"
MsgBox field.Value
A database object variable does not now support default properties. These have to be specified. For example, the following will not work:
Set obj = Server.LookupObject(rowId)
MsgBox CStr(obj) 'This will not show the object Id
Instead use Id specifically:
Set obj = Server.LookupObject(rowId)
MsgBox CStr(obj.Id)
The appearance of forms is different in this version and form items are slightly larger. Consequently, the exact layout of text and entry items will have moved slightly.
It is unlikely that code changes will be needed for most forms but see the next item below.
If a list box on a form contains no items, the box will display the message “No Items”.
The maximum number of rows visible using Form.AddListBox is now the same as the number requested in the third argument. Previously, the number of rows was only approximate and commonly had to be set to a higher number to allow the desired number on the form. For example, this code would previously display fewer rows instead of the requested 20. Now it will display 20 rows.
Set QueryList = Form.AddListBox(2, 5, 20, 1)
If your existing script code uses Form.AddListBox then you might need to alter this argument. A symptom of this issue could be that buttons or other Form items are placed on top of the list.
To resolve this, reduce the number of rows on display by changing the 3rd argument, for example from 20 to 12.
Note that the ListBox always scrolls horizontally when there are more rows available than will fit into the requested number of rows.
This is similar to AddListBox above.
If the SQL query returns no results, the list box will display the message “No Query Results”.
The maximum number of rows visible using Form.AddQuery is now the same as the number requested in the fourth argument. Previously, the number of rows was only approximate and commonly had to be set to a higher number to allow the desired number on the form. For example, this code would previously display fewer rows instead of the requested 20:
Set QueryList = Form.AddQuery(2, 5, 50, 20, "SELECT Name,TypeDesc FROM CMimic")
If your existing script code uses Form.AddQuery then you might need to alter this argument. A symptom of this issue could be buttons placed on top of the list:
To resolve this, reduce the number of rows on display by changing the 3rd argument, for example from 20 to 12.
The new 64-bit ViewX will only permit the creation of 64-bit ActiveX objects so that existing use of the clipboard using CreateObject("InternetExplorer.Application") will not work. A new Clipboard object can be used directly. The following methods are available:
void Clipboard.Clear()
Boolean Clipboard.ContainsText()
string Clipboard.GetText()
void Clipboard.SetText(string)
For more information, see the ‘Clipboard Functions’ branch of topics in the Scripting Guide in the online help.
The correct way to check whether LookupObject has found a valid Object ID is to use Is Nothing. A check for Null is incorrect. This behavior is unchanged, but some clarification is helpful here.
This code is correct:
Public Sub Test
Set obj = Server.LookupObject(99999999)
If obj Is Nothing Then
MsgBox "Not found"
Else
MsgBox CStr(obj.Id)
End If
End Sub
Using these words as variable names causes an error, unless the variable is first defined using Dim.
The error message is: "the object has no suitable property or field named 'toString'."
This code produces the error:
Public Sub Test
ToString = "Hello"
MsgBox ToString
End Sub
This code does not:
Public Sub Test
Dim ToString
ToString = "Hello"
MsgBox ToString
End Sub
These names will cause an error even if the case is different (tostring, equals, Gettype...). Ensure that Dim is used if you wish to use these variable names.
For example, when using SetRegistry to write a date, it was not necessary to convert that date to a number first. Now the conversion is needed. Example:
SetRegistry "start.date", CLng(Int(CDbl(StartTime.Value)))
In this example, the date is a Form field, and it is converted to a number with CDbl first. Then the fractional time is removed with Int and it is converted to a Long for registry storage.
When reading registry values, you need to use CDate to convert numbers back to dates.
Example code on a mimic:
Option Explicit
Public Sub DoNothing(One, Two)
MsgBox "One"
End Sub
Create a script pick action pointing to DoNothing and only configure a parameter for the first parameter.
In Geo SCADA 2025 (87) the second function still executes ("One" is shown).
In Geo SCADA 2025 R2 (88) no script executes.
A future update will resolve this behavior and continue execution.
For security reasons the Log On and Off operations in ViewX will cause script to stop, because the context of the script has been lost and Geo SCADA cannot assure that continuing to run the same script will retain the same level of access to mimic, libraries or objects.
This refers to the COM interface methods:
Also to COM automation of ViewX, with code such as:
public sub OpenViewX
Set vx = CreateObject("Serck.ViewXApplication")
vx.Logon "MyServer", "MyUser", "MyPassword"
MsgBox "Logon OK"
end sub
The message box will not be shown because the Logon event will stop script execution.
This is a temporary limitation.
For example, if "myPoint" is an output with Control enabled:
y = Server.GetOPCValue(myPoint & ".Control")
z = Server.GetOPCValue(myPoint & ".Control.ControlMaximum")
These will both return errors.
A future update will resolve this behavior. Error codes will differ, but will continue to be raised.
An alternative to GetOPCValue for such cases is to get the object reference:
sPtFullName = "Test.Point"
set pControl = Server.FindObject(sPtFullName)
on error resume next
z = pControl.Interface.Control.ControlMaximum
If Err.Number <> 0 Then
MsgBox "Point does not have control features"
end if
In prior versions the following code could be used:
sPtFullName = "Test.Point"
set pControl = Server.FindObject(sPtFullName)
Set y = pControl.Interface.Control
If y is Nothing Then
MsgBox "Has No Control"
Else
MsgBox "Has Control"
End If
In 2025 R2, omit the 'Set' and check if the item is an object:
sPtFullName = "Test.Point"
set pControl = Server.FindObject(sPtFullName)
y = pControl.Interface.Control
If not IsObject(y) Then
MsgBox "Has No Control"
Else
MsgBox "Has Control"
End If
The GetRegistry function takes a name and the default value as parameters. If there is no default value and the registry does not contain the value then the function returns Null. In Geo SCADA 2025 R2, Null cannot be manipulated as a string.
In prior versions:
a = GetRegistry("newkey")
MsgBox a
This will display an empty Message Box.
In 2025 R2, the returned value needs to be tested for Null:
a = GetRegistry("newkey")
If IsNull(a) Then
MsgBox ""
Else
MsgBox a
End If
These issues are specific to JScript upgrades. Note that various items in the VBScript list will be relevant too, such as the Form behavior.
Some users have deployed JScript which calls for the ActiveXObject("ScriptControl") COM object. We do not recommend this because it relies on Windows features which can be turned off for security reasons.
In some cases, it has been used to emulate the MsgBox feature of VBScript.
An alternative is to use the Form object in JScript. See a similar example which was created for JavaScript V8 in this release, available in the new demonstration database .sde in the folder "Symbol Library.~Config.Script.MsgBox for V8".
We recommend minimising or removing CreateObject and ActiveXObject if possible.
The newer JScript implementation is New JScript is stricter on case checking. Some examples of common case check errors are:
Naturally there are other potential case errors, and these include keywords, methods and animation property names.
The newer JScript implementation requires specific types for Form controls and other items.
For example, a form button default setting requiring a Boolean argument for the Default property may have previously accepted the integer 1 but now requires true or false. Please change any incorrect items to Booleans, changing this incorrect line for a Form button:
ok.Default = 1;
to:
ok.Default = true;
Microsoft's current version of JScript, "JScript9Legacy" is used by default on Windows 11, version 24H2. This version does not allow parameters to be passed in a mimic pick action.
For example, this will fail:
function MyScript(test1) {
}
This code will not allow the parameter test1 to be used. Geo SCADA 2025 R2 ViewX will fail if this is attempted without the change below.
If parameters are required, then a registry setting can be used to force Windows 11 to use the previous JScript version.
Note that Microsoft have done this to Win 11 24H2 and other older versions to resolve a vulnerability:
https://msrc.microsoft.com/update-guide/en-us/vulnerability/CVE-2024-43584
As the only way to restore functionality is to restore the vulnerable JScript run time, reverting is at the customer's risk. To do this, add the following key to:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Main]
Value Name: JScriptReplacement
Value Type: REG_DWORD
Value Data: 0
We do not recommend using JScript with Geo SCADA Expert.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.