BlueZone Basic Help


Extra Macro (.EBM) to BlueZone Basic Scripting (.BBS) Conversion

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.

  1. Save the Extra Macro as a text file using the Attachmate Extra Macro Editor to the BlueZone Working Directory \Scripts folder.

  2. Rename all of the .txt files to .bbs so the extension is recognized by the BlueZone Scripting Host.

  3. In each macro, replace CreateObject (“Extra.System”) with CreateObject (“Bzwhll.Whllobj”)

  4. 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.

  5. 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.

Type Mismatch Errors

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:

Syntax Differences

Use of ( )

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.

Error Handler

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

CVDate is not supported.

Example:

TodaysDate=Format(CVDate(Date$), "mmmm d, yyyy")

Changes to:

TodaysDate=Format (Date$, "mmmm d, yyyy")

Dialog Templates

Redim

Redim cannot be used unless the variable was declared using Dim previously.

Mid() as a left variable assignment operator

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

File I/O

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”.

MsgBox

The second parameter cannot be omitted if using the third (title) parameter.

GetObject

The first parameter cannot be blank but must be set to “ “.

Multiple Property Assignments

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"

Automation Object Methods and Properties

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)

Object Default Value

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