DDEDisconnect
Terminate access to the remote application.
Syntax
procedure DDEDisconnect (out tErrCode, inout tServ)
Parameters
| tErrCode | longint, an error code |
| tServ | longint, connection handle |
Comments
DDEDisconnect terminates the access to the remote application.
The filename is ddedisc.pgm.
Example
For example, given that DDE_Err and hServ are of type longint and that hServ has been set by a previous call to DDEConnect, enter the following to terminate a DDE conversation:
DDEDisconnect (DDE_Err, hServ)
This example ends a conversation previously established using the CONNECT service.
Captures a bitmap image of the screen and writes it to a file.
Syntax
$screensave(filename)
Parameters
| filename | a character string, or an expression that evaluates to a character string |
Return Value
Returns “1” ($True) if no errors were detected when the image was written to filename. Otherwise, returns “0” ($False).
Comments
Filename must be the name of a disk file, including the path location. A document name cannot be used.
$transmitkey Object
Syntax: $transmitkey
Return Value: Character string
Description:
The $transmitkey object captures the name of the last EXIT or TRANSMIT key pressed during form input operations. This object is essential for managing form navigation and submission, especially when custom key bindings are involved.
Key Concepts:
- EXIT and TRANSMIT Keys:
- These keys are defined using the
FORM SET or WINDOW SET ACCELERATOR commands. - EXIT Key: Typically used to exit or cancel the form input process.
- TRANSMIT Key: Used to submit the form data.
- Form Input Termination:
- Normally, a TRANSMIT key cannot terminate
FORM INPUT if any “required” fields are empty. - Exception: If the TRANSMIT key is pressed while the cursor is in a modified transmit field or an “always transmit” field, the field will transmit, causing
FORM INPUT to terminate. - If required fields are still empty after this action,
$transmitkey will be set to an empty string ("").
- Resetting
$transmitkey:- The
$transmitkey object can be reset at any time to clear its value. This is useful for ensuring that the object accurately reflects the most recent key press.
Practical Usage:
Defining Keys:
To define EXIT and TRANSMIT keys, you use the FORM SET or WINDOW SET ACCELERATOR commands. For example:
FORM SET ACCELERATOR EXIT F2
FORM SET ACCELERATOR TRANSMIT F1
In this example, the F2 key is set as the EXIT key, and the F1 key is set as the TRANSMIT key.
Handling Key Presses:
You can check the value of $transmitkey to determine which key was pressed and take appropriate actions. For example:
IF $transmitkey = "F1" THEN
// Handle the F1 key press (TRANSMIT)
CALL ProcessFormSubmission()
ELSE IF $transmitkey = "F2" THEN
// Handle the F2 key press (EXIT)
CALL CancelFormInput()
ENDIF
In this example, different actions are taken based on whether the F1 or F2 key was pressed.
Special Considerations:
- Modified Transmit Fields: These are fields that can trigger form submission even if other required fields are empty. This is useful for scenarios where partial data submission is allowed.
- Always Transmit Fields: These fields always trigger form submission when the TRANSMIT key is pressed, regardless of the state of other fields.
Example Scenario:
Imagine a form with several required fields. If the user presses the TRANSMIT key (F1) while in a modified transmit field, the form will attempt to submit. If any required fields are still empty, $transmitkey will be set to an empty string, indicating that the submission was not successful.
FORM SET ACCELERATOR TRANSMIT F1
FORM SET ACCELERATOR EXIT F2
// User presses F1 while in a modified transmit field
IF $transmitkey = "F1" THEN
IF AllRequiredFieldsFilled() THEN
CALL SubmitForm()
ELSE
$transmitkey = "" // Reset because required fields are empty
ENDIF
ENDIF
This ensures that the form submission logic is robust and handles incomplete data appropriately.
Displays the Printer Setup common dialog box.
Syntax
$printersetup()
Return Value
Evaluates to “1” ($True) if no errors were detected in the dialog. Otherwise, evaluates to “0” ($False).
Comments
This function is available only on Windows systems. The Printer Setup common dialog box contains a list of printers mounted to your Windows network. To access printers not listed in the dialog box, see your system administrator.
See Also
$setproperty
PRINT
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