Return the greatest common factor of a list of values.
The greatest common factor is the largest number that will divide evenly into all the specified values. If the values have no common factor, 1 is returned.
Value: numeric The list of values. Multiple values are separated by a semicolon.
string := GetCurrentDirectory
Example
Syntax
()
Description
Get the name of the current directory.
Return Value
Name of the directory in which the macro is stored.
enumeration := GetFileAttributes
Example
Syntax
(Filename: string)
Description
Return DOS file attributes.
Return Value
One of the following values, or a negative number if an error occurs. GetFileAttributes can return more than one value at a time. Use bitwise operators to determine the values.
Return Value Attribute
Negative Error!
1 ReadOnly!
2 Hidden!
4 System!
8 Label!
16 Directory!
32 Archive! (the file has changed since the last save)
128 Normal!
Parameters
Filename: string Include the full path.
numeric := GetFileDateAndTime
Example
Syntax
(Filename: string)
Description
Return a number representing the date and time a file was last written to. Use DateString and TimeString functions to convert the number to a string.
Example
vNumber = GetFileDateAndTime("c:\...\<filename>")
vDate = DateString(vNumber)
vTime = TimeString(vNumber)
MessageBox(;; vDate + " -- " + vTime)
Explanation: Displays date and time <filename> was created.
Return Value
A number representing a date and time, or -1 if an error occurs.
Parameters
Filename: string Include the full path and filename.
DateType The type of date and time to return. If missing, ModificationDatTime! Is used.
CreationDateTime! Returns date and time file was created.
LastAccessDateTime! Returns date and time file was last accessed.
ModificationDateTime! Returns date and time file was last modified.
Display a dialog box that contains an edit control to enter an integer or real number. The parent of this dialog is maintained by the macro and is initially set to the application that started the macro. The dialog may be attached to a different application or window by setting a new default parent with the SetDefaultParent command.
Parameters
VariableName: variable The number entered in the edit box is returned in this variable.
Prompt: string (optional) The text displayed above the edit control. Use NToC(0F90Ah) to insert a hard return code in the prompt string. For example,
Title: string (optional) The text displayed in the title bar. If missing, Corel PerfectScript is used.
OLEObjectVariable := GetObject
Syntax
([FileName: string]; [ClassName: string]
Description
Obtains the instance of an OLE object.
Return Value
Instance that identifies an OLE object. After an OLE object variable is assigned an object instance, commands can be called, and values obtained and set for the object variable. When the object and variable are no longer needed, use the Discard command to destroy the object instance.
Parameters
FileName: string (optional) Name of the file associated with an OLE object. Find the object type using the Windows filename extension associations. If missing, ClassName is used.
ClassName: string (optional) Class name of the OLE object to obtain, also called the ProgID. This must be the name of a registered OLE automation object. If missing, FileName is used.
Note
This command is not available for use on a Linux operating system.
Display a dialog box that contains an edit control to enter a character string. The parent of this dialog is maintained by the macro and is initially set to the application that started the macro. The dialog may be attached to a different application or window by setting a new default parent with the SetDefaultParent command.
Parameters
VariableName: variable The character string entered in the edit box is returned in this variable.
Prompt: string (optional) The text displayed above the edit control. Use NToC(0F90Ah) to insert a hard return code in the prompt string. For example,
Display a dialog box that contains an edit control to enter a number and unit of measure. The parent of this dialog is maintained by the macro and is initially set to the application that started the macro. The dialog may be attached to a different application or window by setting a new default parent with the SetDefaultParent command.
The units of measure are " (inches); i (inches); c (centimeters); m (millimeters); p (points-72 per inch); and w (WordPerfect units-1200 per inch). If a unit of measure is not specified, the default is WordPerfect units. To change the default, use DefaultUnits.
Parameters
VariableName: variable The number and unit of measure entered in the edit box is returned in this variable. If no unit of measure is specified, the default is returned.
Prompt: string (optional) The text displayed above the edit control. Use NToC(0F90Ah) to insert a hard return code in the prompt string. For example,
Title: string (optional) The text displayed in the title bar. If missing, Corel PerfectScript is used.
Global
Example
Syntax
({<VariableName> variable := <Value> any})
Description
Declare global variables and arrays, and assign them to the global variable table.
Global variables can be used in Run or Chain macros.
Parameters
<VariableName> variable One or more user-defined variables separated by a semicolon. Variables must begin with a letter and can include any other combination of letters or numbers. Parentheses are optional. For example,
Global Variable; Variable
Global(Variable; Variable)
are both valid statements. The following example declares global arrays with 10 elements and 20 elements:
Global FirstArray[10]; NextArray[20]
The last example simultaneously declares a variable and assigns a value:
Global x := 2
or...
Global x
x := 2
If you create two variables with the same name (for example, Global x and Persist x), the following statement
Global x := 5
specifies which variable x is assigned the value 5.
<Value> any (optional) The value assigned to <Variable> at time of declaration. For example, Global vTest = 20. vTest equals 20 at run time. If missing, the value of <Variable> is undefined.
Go
Example
Syntax
(<Label> label)
Description
Jump to a Label statement and do not return.
Go is generally used to exit multiple layers of nested statements, or to create a loop.
Parameters
<Label> label The name of a label. It begins with a letter and consists of one or more letters or numbers.
GoOnLine
Syntax
([Service: enumeration]; [Location: string])
Description
Start an online service at a specified location.
Parameters
Service: enumeration (optional) If missing, Internet! is used.
Internet!
CompuServe!
Other!
Location: string (optional) Service location at which to start. For example, GoOnLine(Internet!; "http://home.netscape.com") starts the default Internet browser at the Netscape Navigator* home page. For CompuServe, this is the "GO" location. If Service is Other!, Location is the command line to execute and is required.