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

SET MOUSE

Controls the use of a pointing device in Zim for Windows.

Syntax

SET MOUSE ON|OFF

Comments

The MOUSE option is set ON by default.

When MOUSE is ON, the use of a pointing device is enabled for the client area of Zim windows. The application can then respond to mouse-button accelerators that occur while the focus is in a window.

The SET MOUSE command has no effect on standard windows. In such windows, it is assumed that a pointing device is active at all times, when available.

 

See Also

Event

FORM INPUT

MENU INPUT

$BreakFlag

Indicates if the application user has pressed the “break” key.

Syntax

$breakflag

Return Value

Binary. Can be reset by an application program.

Description

At the start of an application session, $BreakFlag is set to “0” ($False). Set to “1” ($True) if the application user presses the “break” key. The application program must reset the variable to “0” ($False) to be able to detect subsequent user interrupts.

See Also

About Conditional Expressions

SET BREAKABLE

System Variables

SET ESCAPECHAR

Controls the use of the escape character in quoted character strings.

Syntax

SET ESCAPECHAR ON|OFF

Comments

The ESCAPECHAR option is ON by default.

When ESCAPECHAR is ON, the backslash is treated as the escape character inside quoted character strings. Setting ESCAPECHAR to OFF causes the backslash to be treated as data. The OFF setting is particularly useful in operating environments where the backslash character is used as the path separator character.

 

See Also

\ (Escape)

TOP

Moves the current member pointer to the first member in a result set.

Syntax

TOP [setname]

Parameters

setname

The name of a result set. If setname is omitted, the current set is used.

Comments

The TOP command moves the current member pointer to the first record in the current set.

 

See Also

$currentmember

BOTTOM

DOWN

LOCATE

NEXT

PREVIOUS

UP

$ (Template line join)

In a template program, indicates that the next line is to be joined to the current line at the output destination.

Syntax

linestart «$
linecontinue »

where

linestartany portion, from the beginning, of an output line
linecontinuethe remaining portion(s) of the same output line

Comments

In a template program, the dollar sign ($) indicates that the next line is to be joined to the current line at the output destination.

Normally, each physical line in a template is sent as a separate line to the current output destination. To cause successive physical lines in a template to be joined into one line in the output, end the appropriate lines in the template with the dollar sign ($).

If a line must end with a dollar sign for some other reason, ask the software to interpret the dollar sign by placing a backslash ( – Escape) preceding the dollar sign.

pt_BRPortuguese