BlueZone Basic Help
To convert Extra Macros to use BlueZone, choose the BlueZone Basic Scripting Language in the BlueZone Scripting Host application. BlueZone Basic is nearly 100% compatible with Attachmate Extra’s Extra Basic language, but there are some minor differences that must be addressed before the converted macro will run properly in BlueZone Basic.
We find that it's not unusual to be able to convert Extra Basic macros containing hundreds or thousands of lines, in a few minutes, using the 5 steps below. At times, differences in the syntax checking between the engines, or differences in implementation require some further changes. Though the differences are few, we have listed them below to aid in the conversion process.
NOTE Macros
created with the Extra Macro Recorder, are automatically converted when
opened in the BlueZone Scripting Host application. No
further steps are required.
SEE
Extra!
Recorded Macro Conversion in Macro Conversion Help.
The following steps are required for all Extra Macros that were "developed" (not recorded and unmodified) in the Extra Macro Editor.
Save the Extra Macro as a text file using the Attachmate Extra Macro Editor to the BlueZone Working Directory \Scripts folder.
Rename all of the .txt files to .bbs so the extension is recognized by the BlueZone Scripting Host.
In each macro, replace CreateObject (“Extra.System”) with CreateObject (“Bzwhll.Whllobj”)
Comment out all Function Declarations, e.g., Declare Function FuntionName (Arg1, Arg2, …) by putting a single quote (‘) in front of each line. These declarations are not required or supported. Do not comment out DLL Declarations.
Save the changes and attempt to run the macro. The BlueZone Script Host and Debugger will go through a syntax check and identify any syntax errors where Extra Basic differs from BlueZone Basic.
The BlueZone Basic compiler is consistent with Visual Basic and Word Basic with respect to variable typing, and may throw Type Mismatch errors when attempting to use a variant or an incorrectly typed variable as an argument. Type Mismatch errors appear during the initial syntax check when Run or Debug is selected. Refer to the BlueZone Basic Language Reference for more information
To trouble shoot Type Mismatch Errors:
For each Type Mismatch, use the Find Next feature in BlueZone Scripting Host to find each instance of the variable name and to see where the variable is declared using a DIM statement.
The type of variable it is (Object, String, Integer, Date, etc).
If it is not declared or declared without a type (DIM variablename), then it is typed as a Variant.
Once you have identified if the variable has been declared, the type it is, and if it is Global or Local, check the method or property using the variable to see which type it is expecting. The documentation for the object provides the details for each argument.
Make the appropriate changes, save the script, and run it again.
If the Type Mismatch error goes away, add a comment to the code for future reference.
Repeat as needed until all Type Mismatch errors have been resolved.
BlueZone Basic flags the incorrect use of parenthesis with a Syntax Error message. Parenthesis should only surround arguments when a method, property, or function returns a value.
Change Error <> "" to Err.Description <> "" when displaying error strings. Results in a compiler syntax error.
Example:
If Error > "" then
StopScript
Changes to:
If Err.Description > "" then
StopScript
CVDate is not supported.
Example:
TodaysDate=Format(CVDate(Date$), "mmmm d, yyyy")
Changes to:
TodaysDate=Format (Date$, "mmmm d, yyyy")
BlueZone Basic does not support variables for labels on dialog controls. Use a dialog callback.
The Button keyword must be replaced with PushButton.
The DropComboBox must be replaced with DropListBox.
String array is required when using ListBox, ComboBox, and DropListBox.
Begin Dialog does not accept empty parameters for the upper left corner position. Replace “Begin Dialog , , 200, 200” with “Begin Dialog 200, 200”.
Variables receiving dialog objects, such as .buttonpressed, must be declared as a string, integer, or variant. Even though undeclared variables are typed as variants, the BlueZone Basic engine throws an “Automation Object does not have default value” error, if the variable is not explicitly declared.
String concatenation is not allowed in the dialog templates. Use a dialog callback instead.
Redim cannot be used unless the variable was declared using Dim previously.
Example:
x = hello
MID(x , 2, 4) = “iyas”
Msgbox x
The desire is to assign “iyas” to the result of the MID() operation to x, changing “hello” to “hiyas”
It could be replaced with:
x = "hello"
z = "iyas"
y = Left(x, 1)
Msgbox y + z
BlueZone Basic does not support the Random keyword or the Put and Get functions available in Extra Basic. These are rarely used and are not normally an issue. See the BlueZone Basic Language Reference for more information.
Example:
Open "NewAnInfo.Dat" for Output as #2 Len = Len(getPerInfo)
Changes to:
Open "NewAnInfo.Dat" for Output as #2 ' Len = Len(getPerInfo)
Note the comment in red that removes Len = Len(getPerInfo) from the script.
Replace “Put” with “Print” and “Get” with “Line Input”.
The second parameter cannot be omitted if using the third (title) parameter.
The first parameter cannot be blank but must be set to “ “.
BlueZone Basic does not support multiple property assignments. Refer to the BlueZone Basic Language Reference for the alternative argument syntax.
Example:
wApp.wordbasic.FileOpen .Name = "U:\Bizac\Docs\specacc.DOC", .ReadOnly = 1
Changes to:
wApp.wordbasic.FileOpen "U:\Bizac\Docs\specacc.DOC", 1
Example:
wApp.wordbasic.FileSummaryInfo .Author = UserIdText, _
.Title = "Special Acceptence Letter", _
.Subject = NameText, _
.Keywords = "BIZAC", _
.Comments = "File originated by BIZAC program from Template: " + _
DocsPath + "\" + "specacc.doc"
Changed to:
wApp.wordbasic.FileSummaryInfo UserIdText, _
"Special Acceptence Letter", _
NameText, _
"BIZAC", _
"File originated by BIZAC program from Template: " + _
DocsPath + "\" + "specacc.doc"
Area Object does not handle empty arguments.
Example:
set MyTrim = MyScreen.Area(5,5,5,44, ,)
Changes to:
set MyTrim = MyScreen.Area(5,5,5,44)
When a method returns a BlueZone Object (like and Area Object), to a variable, and the variable is used as an argument in another method, the default value is not automatically called. Add the default value to the object when passed as an argument (.value).
Example:
set MyTrim = MyScreen.Area(5,5,5,44)
NameB = MyTrim
NameB = RTrim(NameB)
wApp.wordbasic.Insert(NameB)
Changes to:
wApp.wordbasic.Insert(NameB.value)
.Row and .Col
Some versions of Extra Basic (Extra Extreme 8 and 9 only) allow setting the values for .Row and .Col properties of the Screen Object using ( ) rather than on the left of an equal sign. The BlueZone Host Automation Object does not support the convention displays “Automation Object does not have a default value” error message and must be converted.
Example:
Screen.Row(x)
Screen.Col(y)
Changes to:
Screen.Row = x
Screen.Col = y