_ (Wildcard)

Used with the LIKE operator to construct patterns for matching.

Comments

Used with the LIKE operator in logic expressions, the _ wildcard matches any single character when the pattern on the right is compared to expression.

Example

"_ob%"

Matches any character string whose second and third letters are ob, followed by zero or more characters (i.e., “Robert”, “Bob”, “Cobbler”, etc.).

compute Employees where LastName like "_a%n"

Processes all records whose LastName values are three characters or more, the second character being an a and the last character being an n.

Grade like "100\%"

Shows the per cent sign being used literally in a string. (The first backslash “escapes” the second backslash, which, in turn, “escapes” the per cent sign, turning it into a literal character.)

find Parts where PartDesc like "%\\%"

Finds PARTS whose part description contains a backslash.

FirstName like $concat("S_e%p",SuffixVariable)

Assuming that SuffixVariable is “%”, then the above expression is logically true if FirstName matches the pattern “S_e%p%”.

DDEConnect

DDEConnect

Sets up the access to the remote application.

Syntax

DDEConnect ( out tErrCode,
             out tServ,
             in dde_app,
             in dde_topic)

Parameters

tErrCode

A returned error code. It must be a longint.

tServ

The returned connection handle. It also must be a longint.

dde_app

A string containing the application name.

dde_topic

A string containing the topic name.

Comments

The procedure is supplied with the application name and topic name (usually the document name). DDEConnect assigns a connect handle to the “tServ” variable to be used in subsequent commands. DDEConnect is compiled.

The filename is ddeconn.pgm.

Example

For example, given that DDE_Err and hServ are of type longint:

DDEConnect (DDE_Err, hServ, ‘excel’, ‘sheet1’)

starts a conversation with Microsoft EXCEL. The topic of the conversation is the spreadsheet ‘sheet1’. In this case, EXCEL must be started and ‘sheet1’ opened beforehand.

DDEDisconnect

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.

$screensave

Captures a bitmap image of the screen and writes it to a file.

Syntax

$screensave(filename)

Parameters

filenamea 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

$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:

  1. 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.
  2. 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 ("").
  3. 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.

$printersetup

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

$ObjGetProperty

Get the properties of an ActiveX object.

Syntax

$ObjGet[Property] (Object, PropertyName,<>)

Parameters

Objectan object variable or formfield of type OLE
PropertyNamea string or an expression that evaluates to a string
Parametersoptional 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.

$ObjEventParameter

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.

$round

Rounds a number to the nearest integer.

Syntax

$round(number)

Parameters

numbera 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

en_CAEnglish