Get the properties of an ActiveX object.
Syntax
$ObjGet[Property] (Object, PropertyName,<>)
Parameters
| Object | an object variable or formfield of type OLE |
| PropertyName | a string or an expression that evaluates to a string |
| Parameters | optional parameters as per the object’s specifications |
Return Value
Returns a result that can be a string or an ActiveX object.
Comments
If a parameter’s name is “Picture” then the parameter should be named. For more information, see $ObjRunMethod function. Zim has extended object properties with left, top, width and height options (integers) and AutoDrag (boolean).
Warning
COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.
Obtain information about a particular parameter created by the current event raised by a COM component.
Syntax
$ObjEventParameter (ParameterNumber)
Return Value
Returns a result that can be a component object or a string for the passed parameter number.
Comments
The Event structure displays information about the last event that caused form input to terminate. The proprietary events of an object can trigger Zim to terminate form input. To trigger this, use the command
FORM SET (OBJECTEVENT . . .)
When the proprietary events of an object cause forms input to terminate, the eventname field is set to the name of the event and the event type is set to formfield.
Often the proprietary events of an object pass along extra information in the form of parameters. These parameters can be queried using the $ObjEventParameter function.
Warning
COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.
Rounds a number to the nearest integer.
Syntax
$round(number)
Parameters
| number | a number, or an expression that evaluates to a number |
Return Value
Number, with no decimal places.
Example
$round(2.501)
Evaluates to 3.
$round(2.4999)
Evaluates to 2.
$round($substring("123.456",3,3))Evaluates to 3.
See Also
$money
$tonumber
$truncate
Translates data from one character set to another.
Syntax
$ansitodos(string)
Parameters
| string | a character string or an expression that evaluates to a character string |
Comments
Converts the data in string from the ANSII character set to the OEM character set.
See Also
$DBCharSet
$dostoansi
About Character Literals
SET DOCUMENT FORMAT
Translates data from one character set to another.
Syntax
$dostoansi(string)
Parameters
| string | a character string or an expression that evaluates to a character string |
Comments
Converts the data in string from the OEM character set to the ANSII character set.
See Also
$ansitodos
$DBCharSet
SET DOCUMENT FORMAT
Calculates an exponential value of the natural base (e).
Syntax
$exp(number)
Parameters
| number | a number or an expression that evaluates to a number |
Return Value
Number, with the same number of decimal places as number.
Example
$exp(2.000)
The above expression means “the natural base e, squared” and evaluates to 7.389.
See Also
$log
$log10
$sqrt
About Functional Expressions
Returns the last Automatic Sequence Number applied.
Syntax
$ ZimSeqNum
Return Value
Number, representing an Automatic Sequence Number or $Null in case of an error.
Comments
The value returned by $ ZimSeqNum is taken from the most recent ASN used. Notice that when the ADD command adds more than one record, $ ZimSeqNum will contain the value of the last record added.
$ ZimSeqNum also returns the number set using SET SEQUENCENUMBER MyEnt . Upon execution of SET SEQUENCENUMBER MyEnt ON, $ZimSeqNum returns the next number available. The $ZimSeqNum result after executing SET SEQUENCENUMBER ALL ON is undefined.
Example
If all ADD statements refer to objects that contain ASN, the $ZimSeqNum will return the value taken by the last ADD:
ADD 1 Customers ...
ADD 100 MyEnt from MyDoc ...
output $ZimSeqNum
$addhours
Calculates a time value by adding hours to (or subtracting hours from) a specified time value.
Syntax
$addhours(time,number)
where
| time | an 8-digit number, or an expression that evaluates to an 8-digit number, that expresses a valid time value in the format HHMMSSTT |
| number | a number, or an expression that evaluates to a number |
Return Value
Number, representing a time value.
Comments
Use $addhours to perform arithmetic with time values. The $addhours function calculates a time value by adding a number representing hours to a time value. If number is negative, the effect is to subtract the hours from the time.
Example
If $Time has the value 22503075, then
$addhours($time,1)
Evaluates to 23503075.
$addhours($time,2)
Evaluates to 00503075.
$addhours($time,-3)
Evaluates to 19503075.
The function $RightClickMenu displays a right-click menu at the location of the last right click or at (0,0) if none has occurred. It has the following syntax:
$RightClickMenu ("ListOfMenuItems")where ListOfMenuItems is a string composed of menu item strings separated by semicolons. The menu separator is a valid menu item and is identified by one dash or minus sign “-“.
$RightClickMenu returns a string that identifies the chosen menu item or a null string if no item was chosen. The $RightClickMenu is limited to entries 31 bytes in length.
Example
$RightClickMenu ("Line 1;Line number 2;-;Another Line;Yet Another Line;")Calculates the square root of a number.
Syntax
$sqrt(number)
Parameters
| number | a positive number or an expression that evaluates to a positive number |
Return Value
Number, with the same number of decimal places as number.
Example
$sqrt (100)
The above expression means “the square root (in base 10) of 100” and evaluates to 10.
See Also
$absolute
$exp
$log
$log10
About Functional Expressions