ZIMTCAP Defining the Terminal Characteristics

To prepare a terminal set-up that defines exactly how to produce certain Zim keyboard actions from your terminal keyboard, you must define specific keyboard information.  This information includes specific terminal usage for your specific operating system(s).

Operating System-Specific Aspects of Terminal Definition

Windows

To run Zim under Windows no terminal keyboard definitions are required.

UNIX

Under UNIX, the zimtcap files are located in the directory identified by Zim’s environment variable.  Zim and zimtcap obtain the value for termname in termname.ztcap from the current value of the TERM environment variable. If no value has been specified for TERM, or the file termname.ztcap cannot be found, you cannot execute ZIM.

If you choose zimtcap option 2 (Create a new terminal description) zimtcap creates a new zimtcap file. If you current terminal is defined in terminfo or termcap, zimtcap extracts the available information and places it into the new zimtcap file.  

Executing zimtcap

Under UNIX, Zim determines the characteristics of a terminal by consulting terminal description files, called zimtcap files. Each zimtcap file is stored under the name

termname.ztcap

where the value for termname (terminal name) and the location of the file is operating system-specific.

Each zimtcap file defines the characteristics of its termname to ZIM by indicating the terminal keys that perform specific functions (for example, Home, F1) and by indicating how certain terminal attributes are set.

The zimtcap utility program is provided with the ZIM software and is used to create or edit zimtcap files.

Note: The zimtcap program must be executed at the same type terminal for which you are creating the zimtcap file.

When running zimtcap, your are presented with a menu that includes seven options:

  • Display Current Description
  • Create a New Terminal Description
  • Edit Terminal Attributes
  • Edit Cursor Positioning
  • Edit Output Definitions
  • Edit Input Definitions
  • Exit
  • These options are described below.

    Display Current Description

    This zimtcap option enables you to open the current zimtcap file and display the file contents on your terminal screen.

    Note: A zimtcap file for your terminal must exist before you can select this option. To create a default zimtcap file for your terminal refer to option 2 (Create a New Terminal Description) below.

    Create a New Terminal Description

    This zimtcap option enables you to create a new zimtcap file for your terminal. This file contains the default values for your terminal.

    Edit Terminal Attributes

    This zimtcap option enables you to edit the terminal attributes, such as number of screen rows or columns, contained in the current file.

    Note: A zimtcap file for your terminal must exist before you can select this option. To create a default zimtcap file for your termina,l refer to option 2 (Create a New Terminal Description).

    Edit Cursor Positioning

    This zimtcap option enables you to change the definition of how cursor positioning is handled by your terminal.

    Note: A zimtcap file for your terminal must exist for before you can use this option. To create a default zimtcap file for your termina,l refer to option 2 (Create a New Terminal Description).

    To set the cursor position, the zimtcap program sends a string with the following format,

    L1 p1 SEP p2 LO

    where L1 is the Lead In sequence of characters;

    LO is the Lead Out sequence;

    and SEP either is not present or is a sequence of characters separating the cursor coordinates p1 and p2..

    On some terminals, the row is sent first (i.e. p1 is the row) and on others, the column is sent first (i.e. p1 is the first column). On some terminals, positions are sent as single characters and on others, they are sent as one or two digit numbers in character form. In either case, the actual row and column value can be offset by some value.

    ZIMTCAP prompts you for these attributes.

    Note: When entering offsets for rows and columns, remember that the top left-hand corner of the screen is considered to be row 1, column 1.

    Edit Output Definitions

    This zimtcap option enables you to define the character sequences that must be sent to the terminal in order to turn certain attributes, such as inverse video, on and off.

    Note: A zimtcap file for your terminal must exist before you can select this option. To create a default zimtcap file for your terminal, refer to option 2 (Create a New Terminal Description).

    Edit Output Definitions

    This zimtcap option enables you to change the assignment of terminal keys to various Zim actions (for example PageUp and F1 action).

    Note: A zimtcap file for your terminal must exist before you can select this option. To create a default zimtcap file for your terminal, refer to option 2 (Create a New Terminal Description).

    When zimtcap prompts you for the name of each action, type the key (or sequence of keys) that require to represent that action within Zim. Terminate each definition by pressing Return. To keep the current definition for any action, press Return without typing any key (or sequence of keys).

    Exit

    This option enables you to exit from zimtcap. All changes made are saved.

    Terminal Key Definitions for Zim Actions

    The following table defines the terminal key mappings to Zim actions.

    Terminal Key

    Zim Action

    Terminal Key

    Zim Action

    F17

    Home

    F7

    F2

    F18

    PageUp

    F8

    F3

    F19

    PageDown

    F9

    F4

    F20

    End

    F10

    F5

    Remove

    RubOut

    F11

    F6

    Insert

    Insert

    F12

    F7

    Tab

    TabForward

    F13

    F8

    Esc Esc*

    Escape

    F15

    F10

    F6

    F1

    F15

    F10

    * It is common for special terminal keys to generate character sequences that begin with the escape character.  In these cases, it is common to implement the Zim action Escape as a sequence of two escape keystrokes in order to distinguish it from the others.

     

    REMOTEEXEC

    Executes a command against a target server or executes a remote procedure on a Zim Server.

    Syntax 1

    REMOTEEXEC server expression

    Parameters

    serverAny character string expression that evaluates to “ZIMSERV”, “JDBCSAM” or an alias name representing a valid server name to which the application is already connected.
    expressionAny value expression.

    Syntax 2

    REMOTEEXEC server PROCEDURE ProcedureName (arg1, arg2, ...) USING obj1 obj2 ...

    Parameters

    ServerAny character string expression that evaluates to “ZIMSERV”, “JDBCSAM” or an alias name representing a valid server name to which the application is already connected.
    ProcedureNameThe name of the remote procedure. This must be a simple or qualified name. It is not necessary that it exist on the client side.
    , . . .Expressions whose values become arguments to the remote procedure. For OUT or INOUT parameters, these must be variables, form fields, or procedure variables.
    . . .Objects in the USING clause can be set names, global variables, procedure variables, form, or form entities whose values are sent to Zim Server before executing the remote procedure and are returned to Zim after the procedure has finished.

    Comments – Syntax 1

    Expression is evaluated and then executed against the specified server.

    If the expression evaluates to a SELECT command, data is retrieved (if records meet the selection criteria), but the records cannot be accessed.

    If the command contained in the expression fails, the server’s error message is available in the system variable $SQLErrMsg.

    This command was originally SERVEREXEC although only supported for backward compatibility.

    Special REMOTEEXEC Cases

    The following cases of REMOTEEXEC apply only when Zim is connected to Zim Server.

    To copy a file from the client to the server:

    REMOTEEXEC "ZIMSERV" "!copytoserver  "

    To copy a file from the server to the client:

    REMOTEEXEC "zimserv" "!copyfromserver" " "
    source

     

     

    A file name on the server relative to the server’s database directory. The source name can begin with one of the Zim special prefix characters and it is converted (on the server) to the actual file name.

     

     

    target

     

     

    A file name on the client (relative to the client).

     

     

    optional_dirid

     

     

    An optional numeric parameter that specifies a directory id. If not specified, it defaults to zero.

     

     

    /b (or /B)

    Optional parameter to indicate whether the file to transmitted must be in binary or text format.  

     

     

    Note: To erase a file on the server, you could copy a zero-length file over the server side file, or send “SET OUTPUT . . .”  using REMOTEEXEC.
    The limit on record size is about 4000 bytes.

    Note: You must insert spaces around the in the command.

    Note: Currently, these commands do not copy files inside directories nor the directories themselves.

    Note: By default, all files transferred follow the text format, meaning that line terminators are correctly converted from Windows to Unix and vice-versa. By using the “/b” or “/B” parameter, the files are transferred “as is”, in binary mode. This is useful for images, etc.

    Comments – Syntax #2

    A remote procedure is a normal Zim procedure that is executed on Zim Server, but is invoked from a Zim client. Remote procedures are very similar to procedures that are executed locally, but they are invoked by executing a REMOTEEXEC command instead.

    Field names passed as arguments to the remote procedure are not evaluated from the Zim client’s current set. They are assumed to be fields on the server whose values are inherited from the current set on the server. Client side field values must be passed in as variables.

    The USING clause specifies those sets that are accessible to the Zim client after the remote procedure creates them on the server. They must be known in Zim before the remote procedure is called. They can be temporary or permanent set names. For temporary set names, a command such as ‘parse “find customers issue orders ->coset”‘ should be executed to define the set in Zim.

    Global variables, forms, and form entities must be known on both client and server. Their values (or the values of their form fields or variables for forms and form entities) are sent to the server prior to the remote procedure call and then returned to the client when the procedure call is complete.

    Zim evaluates the expression, checks that it is valid and connected to that Server, and then sends the set information, variable values, and procedure call syntax to the server. The actual procedure call that is executed on Zim Server is

    (arg1, arg2, …)

    After the procedure finishes, updated set information and variable values are returned to the Zim client.

    Examples

    remoteexec "oracle" "alter rollback segment big_seg"
    transaction
      remoteexec "oracle"
      "set transaction use rollback segment big_seg"v
     ... large update transaction ...
    endtransaction
    remoteexec "oracle" "alter rollback segment big_seg offline"

    See Also

    $SQLErrCode

    CONNECT

    SET IMPLICITTRANS

    Event

    A data structure that provides information about the state of the system and the most recent event.

    The Event data structure provides information about the most recent event and about the state of the system when that event occurred.

    The components of the Event data structure are set when an event occurs in the user interface. An application program can use the information in the fields to determine what action, if any, to take.

    The fields in the Event structure are

    – AltKey

    – CtrlKey

    – EventName

    – EventTag

    – EventType

    – FieldTag

    – FormTag

    – KeyPressed

    – MenuItemTag

    – MenuTag

    – MouseClick

    – ScrollingKey

    – ShiftKey

    – WindowTag

    Syntax #1 – AltKey, CtrlKey, ShiftKey

    Provides information about the state of the Alt, Ctrl, or Shift key during the last event

    event.altkey

    event.ctrlkey

    event.shiftkey

    Return Value

    Character string (binary). Can be reset by the application program.

    Description

    The variables provide information about the state of the Alt, Ctrl, and Shift keys during the last event.

    The string is set to ‘1’ ($True) if the indicated key was down when the last event occurred. Otherwise, it is set to ‘0’ ($False).

    Syntax #2 – EventName

    event.eventname

    Where eventname is one of

    • Break, Canceled, Click, Closed, DoubleClick, GotFocus, HangUp, LostFocus, LostFocusModified, Modified, PanicExit, RightClick, Timeout, WindowFocusSwitch, or
    • the name of an accelerator key, such as F1, if the event type was accelerator

    Return Value

    Character string (alpha). Can be reset by the application program.

    Description

    The Event data structure provides information about the most recent event and about the state of the system when that event occurred.

    The components of the Event data structure are set when an event occurs in the user interface. An application program can use the information in the fields to determine what action, if any, to take.

    Syntax #3 – EventTag

    event.eventtag

    Return Value

    Character string (ALPHA). Can be reset by the application program.

    Description

    The variable identifies, by its tag, the object in which the last user interface event occurred. The variable can be

    EventType SettingEventTag Value Taken From
    WindowEvent.WindowTag
    MenuEvent.MenuTag
    MenuitemEvent.MenuItemTag
    FormEvent.FormTag
    FormfieldEvent.FieldTag
    AcceleratorEvent.FieldTag
    SystemEvent.FieldTag

    Syntax #4 – EventType

    event.eventtype

    Return Value

    Character string (ALPHA). Can be reset by the application program.

    Description

    The variable identifies the type of user interface event that last occurred.

    – window

    – menu

    – menuitem

    – form

    – formfield

    – accelerator

    – system

    Syntax #5 – FieldTag

    event.fieldtag

    Return Value

    Character string (ALPHA). Can be reset by the application program.

    Description

    The variable identifies, by its tag, the current field at the time of the last event.

    Syntax #6 – FormTag

    event.formtag

    Return Value

    Character string (ALPHA). Can be reset by the application program.

    Description

    The variable, identifies, by its tag, the current form at the time of the last event.

    Syntax #7 – KeyPressed

    event.keypressed

    Return Value

    Character string (CHAR). Can be reset by the application program.

    Description

    The variable indicates, by name, the pressed key that caused the last event to occur.

    Note: The keynames associated with accelerator events, such as F1, are recorded in EventName.

    Example

    If the user presses the a key in a form field and a Modified event is intercepted by the application program, then Event.KeyPressed is set to a.

    Syntax #8 – MenuItemTag

    event.menuitemtag

    Return Value

    Character string (ALPHA). Can be reset by the application program.

    Description

    The variable identifies, by its tag, the selected item on the menu in the current window at the time of the last event.

    Syntax #9 – MenuTag

    event.menutag

    Return Value

    Character string (ALPHA). Can be reset by the application program.

    Description

    The variable identifies, by its tag, the current menu at the time of the last event.

    Syntax #10 – MouseClick

    event.mouseclick

    Return Value

    Character string (binary). Can be reset by the application program.

    Description

    The variable indicates if a mouse button acceleration caused an event to occur.

    It is set to ‘1’ ($True) if the event was caused by pressing a mouse button that is defined as an accelerator for the window. Otherwise, it is set to ‘0’ ($False).

    Syntax #11 – ScrollingKey

    event.scrollingkey

    Return Value

    Character string (ALPHA). Can be reset by the application program.

    Description

    The variable indicates if an event corresponds to a defined SCROLL key.

    It is set to ‘1’ ($True) if an event corresponds to an accelerator key that is also a defined SCROLL key for the window. Otherwise, it is set to ‘0’ ($False).

    Accelerators and SCROLL keys are defined using WINDOW SET commands.

    Example

    The application fragment that follows enables employee records to be scrolled through a form and the data to be updated. The combined actions are accomplished by defining certain keys both as accelerators and SCROLL keys. When one of these keys is pressed, the corresponding accelerator event occurs. The application program uses ScrollingKey to detect that a SCROLL key was pressed and performs the scrolling action after saving the updated data.

    window set scroll Up F7 Down F8

    window set accelerator F7 F8 escape

    form open fEmployee

    form set scroll fEmployee from EmpSet

    form display

    while

    form input

    if event.scrollingkey = $true

    if thisform.formchanged = $true

      change EmpSet from fEmployee

       endif

      form scroll

      continue

    endif

    … other commands …

    endwhile

    Syntax #12 – WindowTag

    event.windowtag

    Return Value

    Character string (ALPHA). Can be reset by the application program.

    Description

    The variable identifies, by its tag, the current window at the time of the last event.

    See Also

    FORM INPUT

    FORM SET

    MENU INPUT

    MENU SET

    RightClick

    ThisForm

    ThisMenu

    WINDOW SET

    ADD

    Adds data to EntitySets or relationships.

    Syntax #1

    Adds a single record to an EntitySet or relationship. Use the LET subcommand to explicitly assign values to the target fields in the record.

    ADD objname [LET clause] [EVALUATE clause] [-> clause]

    Syntax #2

    Adds one or more records from a set specification to an EntitySet or relationship. Data for target fields in the records is take from the specified set. The LET subcommand can be used to direct the source data to particular target fields, and, if desired, to process the source data in some manner before assignment.

    ADD [num] objname [FROM source] [LET clause] [EVALUATE clause] [-> clause]

    Syntax #3

    Adds one or more records from an unstructured application document to an EntitySet or relationship. Data for the target fields in the records is taken from an unstructured application document or a set whose only component is an unstructured application document. The LET subcommand can be used to process the source data in some manner before assignment. You can use the FORMAT clause to direct the source data to particular target fields. The PROMPT clause performs the same function but also sends the field names to the current output destination for display.

    ADD [num] objname FROM doc [LET clause] [FORMAT | PROMPT [«field »]] [EVALUATE clause] [-> clause]

    Parameters

    objnameThe name of an EntitySet or relationship with fields. A role name can be used.
    numThe number of records to be added to object. Num can be
    a constant
    a variable, a form field, or a parameter that evaluates to an integer
    the word ALL, which is the default value
    If num is less than zero, num is set to ALL. Members are added to object until num members have been added or until source has been exhausted.
    sourceA set specification from which you are taking data to add to object. If source is not specified, the current set is used.
    docThe name of an unstructured application document, or a result set whose only component is an unstructured document, from which you are taking data to add to object.
    fieldThe target field in object.
    FORMATSpecifies the order in which data for the specified field(s) of object appears in doc.
    PROMPTSpecifies the order in which data from the specified fields(s) of object appear in doc (usually TERMINAL in this context), and displays the fieldname(s) on the terminals.

    Comments

    If a field is not explicitly assigned a value during an ADD, the field is checked for a defined default value. If available, the default value is assigned; otherwise, $Null is assigned.

    Before adding each record, the software ensure that every required field has been assigned a value. If any required field is $Null, an error results, and the corresponding record is not added. To switch this check off, use the SET CHECKNULLS OFF command.

    Even before execution of the ADD, while the parser is processing the command, a check is performed to determine if required fields that have no defined default value are being assigned a value. If no value is being assigned, an error is immediately generated. This check is always performed.

    Messages marking the progress of an ADD command can be displayed on the terminal. See SET MEMBERCOUNT and SET MEMBERINTERVAL for details.

    Refrain from using the ADD command to add records to the Object Dictionary EntitySets for user interface objects (windows, menus, forms/displays, and form field/menu items).
    The records contain many fields, often with important inter-field dependencies. Records added using ADD are not validated in the usual way, and incorrect values in the record could cause the software to behave unexpectedly or even crash.
    Use the Screen Painter to define all user interface objects.

    Rules for Value Assignments to Fields During ADD

    The software assigns a value to each target field based on the first of the following situations that holds true for that field:

    1. The target field is explicitly assigned a value in a LET subcommand.
    2. The structured source object contains an identically-named field whose value is implicitly assigned to the target field.

    OR

    The unstructured source object contains a value in the sequential position that matches the sequential position of the target field’s name in the FORMAT or PROMPT clause.

    OR

    The unstructured source object contains a value in the same sequential position of the target field in the records. This occurs when no FORMAT or PROMPT clause is supplied, or when the clause does not specify field names.

    1. The target field takes the default value defined for it in the Object Dictionary.
    2. The target field is $Null (unassigned).

    Once values have been determined for all target fields in the record, the software checks to ensure that a Required field is not $Null. If a Required field is $Null, the software raises an error, and the record is not added. This check can be switched off with a SET CHECKNULLS OFF command.

    When an ADD command is parsed, the software checks if Required fields that have no defined default value are being assigned a value. If no value is being assigned,the software raises an error immediately, before any attempt to execute the ADD. This check is always performed.

    Special rules apply when the data being added to an EntitySet or relationship comes from an unstructured application document (Syntax #3):

    1. The $Null property can be explicitly assigned to a field using one of the following techniques:
      • If the current delimiter is not a space (see SET DELIMITER), then two delimiters side-by-side explicitly indicate an unassigned value ($Null). For example, if a slash (/) is the delimiter, then abc/def// generates three values: abc, def and $Null.
      • An asterisk (*) also explicitly indicates an unassigned value ($Null). For example, abc * def generates three values: abc, $Null and def. To specific an asterisk as a literal character, place a backslash ( – Escape) preceding it. For example, if you want a particular field to have the value 5*6, type 5*6 into the source document.
      • Alternatively, use SET SPECIALSCAN to control how the metacharacters backslash () and asterisk (*) are to be handled when they appear in an unstructured application document that is being used as a data source. When SET SPECIALSCAN is ON, the backslash and asterisk characters have their special meanings. When SET SPECIALSCAN is OFF, the backslash and asterisk characters are treated as ordinary data.
    2. If a line in the document fails to provide a value for every field in the record being added, each field not assigned a value becomes $Null.
    3. A line of zero length in the source document (i.e., the line consists solely of a carriage return or a newline character) is taken as an end-of-file indicator by default. The ADD command stops unless a SET EOFVALUE command has been issued.

     

    Example

    add Employees let  LastName = “Smith” FirstName = “Jeff”

    EmpNum = 99 DeptNum = “D04”

    Adds a single record, explicitly specifying the data.

    add Employees from NewEmps let EmpNum = Enum + 100

    Adds records from a structured application document, assigning values from NewEmps to fields in Employees that carry identical names. Adds 100 to Enum field and assigns resulting value to EmpNum.

    add Employees from NewEmps format DeptNum LastName FirstName

    Adds records from an unstructured (but consistently formatted) application document, noting the order in which the data appears.

    add Employees from terminal prompt

    Adds records based on responses to a prompt containing the field names from Employees.

    add Employees from terminal prompt FirstName LastName

    Adds records based on responses to a prompt containing only specified field names. If other fields in Employees have been defined as “required”, this command produces an error.

    See Also

    $MemberCount

    CHANGE

    INSERT

    CHANGE

    Changes data in EntitySets, relationships, forms, or result sets.

    Syntax #1

    Changes specific fields in one or more records in an EntitySet, relationship, form, or set. The existing values in target fields are changed to specified values. The LET subcommand explicitly assigns values to the target fields. Only fields explicitly named in the LET subcommand are changed.

    CHANGE [num] [setspec] [LET clause] [EVALUATE clause] [-> clause]

    Syntax #2

    Changes one or more records in an EntitySet, relationship, form, or set from data found in a set specification. Data for the target fields in the records is taken from a specified set. The LET subcommand can be used to direct the source data to particular target fields, and, if desired, to process the source data in some manner before assignment.

    CHANGE [num] [setspec] [FROM source] [LET clause] [EVALUATE clause] [-> clause]

    Syntax #3

    Changes one or more records in an EntitySet, relationship, form, or set from data found in an application document. Date for the target fields in the records is taken from an unstructured application document or a set whose only component is an unstructured application document. You can use the FORMAT clause to direct the source data to particular target fields. The PROMPT clause performs the same function, but, in addition, sends the field names and their current values to the current output destination for display. You can use the LET subcommand to process the source data in some manner before assignment.

    CHANGE [num] [setspec] FROM doc [LET clause]

    [FORMAT | PROMPT [field]] [EVALUATE clause] [-> clause]

    Parameters

    numCan be
    an integer constant (15, 200);
    a variable, form field, or parameter that evaluates to an integer;
    the word ALL.
    If num is omitted, or less than 0, it defaults to 1.
    setspecThe set specification (made up of application documents, EntitySets, relationships, forms, or result sets), designating the records to be changed. If omitted, the current set (if available) is used.
    Application documents named in the set specification cannot be updated.
    sourceThe set specification where the data to replace the existing values in setspec can be found. If omitted, the data is taken from the current set (if available).
    docThe name of an unstructured application document, or a result set whose only component is an unstructured application document, from which you are taking data to replace existing values in setspec.
    FORMATSpecifies the order in which data for the specified fields of setspec appears in doc. If omitted, the data is assumed to appear in full, field-sequential order (as setspec’s fields were defined). Used to direct the source data to particular target fields.
    PROMPTSpecifies the order in which data for the specified fields of setspec appears in doc (which is normally TERMINAL in this context), and displays the field name(s) on the terminal. If omitted, prompts for the data appear in full, field-sequential order (as the fields were defined for setspec). Used to direct the source data to particular target fields.
    fieldSpecifies one or more fields that are to be prompted for or formatted. If omitted from the PROMPT or FORMAT clause, all fields in the object being changed are prompted for or formatted.

    Comments

    Any number of fields can be assigned a value through the LET clause. Any target field that has not explicitly been assigned a data value by LET is supplied with a data value from the field in source that has the same name (if any). If no field in source has the same name as a target field and if no value has been explicitly assigned, then the target field is left unchanged.

    The FORMAT clause specifies the order in which data for each field appears. The PROMPT clause performs the same function, but, in addition, it displays the field names and the old values on the terminal. Target fields not assigned data values by LET, FORMAT, or PROMPT are left unchanged.

    Special rules apply when data is taken from an unstructured application document to change the values in target fields:

    • If the current delimiter is not a space (see the SET DELIMITER command), then two delimiters side-by-side indicate that a field is $Null. For example, if a slash (/) were the delimiter, then abc/def// would generate three assignments: abc, def, and $Null.
    • If the current line in the application document does not contain enough values for the fields in the records, the remaining fields are left unchanged.
    • An input line of zero length is taken as an end-of-file indicator and stops the CHANGE command, unless a SET EOFVALUE command has been issued.
    • An asterisk (*) used with CHANGE indicates that an existing value is to be left untouched. To specify an asterisk as a literal character, place a backslash () preceding it.

    Before all fields are assigned their new values, they are checked to ensure that a required field is not $Null. If a required field is $Null, an error is generated and the record is not changed. This check can be turned off with the SET CHECKNULLS command.

    Messages marking the progress of a CHANGE command can be displayed on the terminal. See SET MEMBERCOUNT and SET MEMBERINTERVAL for details.

    Refrain from using the CHANGE command to modify records to the Object Dictionary EntitySets for user interface objects (windows, menus, forms/displays, and form field/menu items).
    The records contain many fields, often with important inter-field dependencies. Records modified using CHANGE are not validated in the usual way, and incorrect values in the record could cause the software to behave unexpectedly or even crash.
    Use the Screen Painter to modify all user interface objects.

    Rules for Value Assignments to Fields During CHANGE

    The software assigns a value to each target field based on the first of the following situations that holds true for that field:

    1. The target field is explicitly assigned a new value in a LET subcommand.
    2. The structured source object contains an identically-named field whose value is implicitly assigned to the target field.

    OR

    The unstructured source object contains a value in the sequential position that matches the sequential position of the target field’s name in the FORMAT or PROMPT clause.

    OR

    The unstructured source object contains a value in the same sequential position of the target field in the records. This occurs when no FORMAT or PROMPT clause is supplied, or when the clause does not specify field names.

    1. In all other cases, the value of the target field does not change.

    Once new values have been determined for all target fields in the record, the software checks to ensure that a Required field is not $Null. If a Required field is $Null, the software raises an error, and the record is not changed. This check can be switched off with a SET CHECKNULLS OFF command.

    Special rules apply when the data in an EntitySet or relationship is being changed using data from an unstructured application document (Syntax #3):

    1. The $Null property can be explicitly assigned to a field using the following technique:
      • If the current delimiter is not a space (see SET DELIMITER), then two delimiters side-by-side explicitly indicate an unassigned value ($Null). For example, if a slash (/) is the delimiter, then abc/def// generates three values: abc, def and $Null.
    2. If a line in the document fails to provide a value for every field in the record being changed, each field not assigned a value remains unchanged.
    3. An asterisk (*) explicitly indicates a field that is to be left unchanged. For example, abc * def generates three values: abc, “no change”, and def. To specify an asterisk as a literal character, place a backslash ( – Escape) before it. For example, if you want a particular field to have the value 5*6, type 5*6 into the source document. Alternatively, use SET SPECIALSCAN to control how the metacharacters backslash () and asterisk (*) are to be handled when they appear in an unstructured application document that is being used as a data source. When SET SPECIALSCAN is ON, the backslash and asterisk characters have their special meanings. When SET SPECIALSCAN is OFF, the backslash and asterisk characters are treated as ordinary data.
    4. A line of zero length in the source document (i.e., the line consists solely of a carriage return or a newline character) is taken as an end-of-file indicator by default. The CHANGE command stops unless a SET EOFVALUE command has been issued.

    Example

    change all Emps from terminal prompt LastName FirstName

    LastName  FirstName

    Smith   John

    :

    Prompts with the existing values for each record and waits for input.

    LastName  FirstName

    Smith   John

    :* Jim

    LastName  FirstName

    Jones   Fred

    :

    Typing * Jim and pressing Return changes the first name from John to Jim. A prompt for the next record appears.

    LastName  FirstName

    Jones   Fred

    :Johnston

    LastName  FirstName

    Samuels  Jim

    :

    Typing Johnston and pressing Return changes the last name from Jones to Johnston. A prompt for the next record appears.

    Pressing Return without typing anything terminates the CHANGE command.

    change WaterSamples from fWaterSamples

    Updates an EntitySet based on the data in a form.

    change Employees (unrelated) WorkOn Projects

    sorted by LastName from NewProjects

    where ProjAssigned = “N”

    sorted by ProjDate descending

    let Employees.ProjNum = NewProjects.ProjId

    Assigns a new project to Employees that are not currently working on a project. The employee records that are unrelated to any project are sorted in LastName order. The sorted records are updated from the set of NewProjects that are not assigned (ProjAssigned=”N”).

    change let LastName = “Smith”

    Changes the last name in the current member of the current set.

    change all Employees where DeptNum = D01 let DeptNum = D02

    Changes department number D01 to D02 for the entire set.

    form open dInvoice

    change all fInvItem from LineItems

    form display input

    Fills the occurrences of a particular form with data from a particular set.

    See Also

    ADD

    UPDATE

    Reserved Characters and Words

    Certain characters and words are reserved for special purposes in the Zim software.

    Reserved Characters

    These characters are sometimes called meta-characters. Reserved characters include

    • quotation marks (” and ‘) that define and enclose character strings
    • spaces that are the default field separator (delimiter)
    • backslashes () that escape other characters
    • percent signs (%) that mark the start of a comment
    • question marks (?) that, when not in quotation marks, are a wildcard indicator
    • braces ({ and }) that mark and enclose case expressions

    Reserved Words

    You cannot use any reserved word as a database, application, or filename in Zim. Reserved words include

    • any automatically generated filename in the form “prefix_99999″ where the prefix is a name automatically generated by Zim
    • the strings, words, commands, and function names are found in the following table:
    $absolute$toupperinout
    $acos$tovirtualinput
    $adddays$translateinsert
    $addhours$trimintersect
    $addminutes$truncateinto
    $addmonths$ttrimis
    $addseconds$userfunctionkeep
    $addticks$usrfn1label
    $addweeks$usrfn2leftmargin
    $addyears$usrfn3let
    $and$valuelevel
    $ansitodos$weekdayli
    $asin$wraplike
    $atan$yearline
    $atan2accesslist
    $averageacrosslocal
    $browsefileactivatelocalprocedure
    $centeraddlocate
    $centrealllogin
    $chopalwaysmask
    $compilestatusandmax
    $concatanymaximize
    $cosappendmenu
    $coshasmessages
    $countascendingmethod
    $currentmemberatmin
    $dayavgminimize
    $daynamebackgroundminus
    $ddefunctionbeginmousepointer
    $deletebetweenmove
    $dirpathbordernewline
    $distinctbottomnewpage
    $dostoansibottommarginnext
    $errmsgbreakablenoprint
    $eventparameterbyenot
    $exist$callnull
    $expcaseobjectevent
    $filebrowsecenteroff
    $filenumcentreoldline
    $filepathchangeon
    $fileprintclassopen
    $fillclearscreenor
    $fncloseorder
    $getpropertycolumnotherwise
    $hourscolumnbreakoutput
    $insertcolumnspacingowner
    $isalphabeticcommitpage
    $isalphanumericcompilepagelines
    $isdatecompletepagesize
    $isdigitscomputepagewidth
    $islowerconnectparse
    $isnumberconstpassword
    $isnumericconstantpause
    $isoddcontinuepencolor
    $isuppercountpermission
    $iswinopencreate$$pointsize
    $iszimnamecurrentsetprevious
    $javacursorprint
    $lastmemberdeactivateprocedure
    $leftdeadlockprompt
    $leftjustifydecryptquittransaction
    $lengthdefaulttyperead
    $logdefinerelationship
    $log10deleterelease
    $ltrimdependencyremoteexec
    $maskdescendingrename
    $maxdetailreport
    $maxofdirectoryrequired
    $messageboxdisconnectreset
    $mindisplayrestore
    $minofdisposereturn
    $minutesdistinctright
    $modulusdocumentrole
    $moneydownrollback
    $monthdynamiclistsave
    $monthnameeditscreen
    $notelsescroll
    $nullelseifselectivity
    $objcreateencryptserverexec
    $objdestroyendset
    $objgetpropertyendcasesize
    $objrunmethodendclasssleep
    $objsetpropertyendifsome
    $objstatusendmethodsorted
    $objsubroutineendonspaces
    $oleinsertdialogendprocedurespan
    $oleobjectattrsendreportstartcase
    $orendtransactionstatusbartext
    $pagesetupendwhilestop
    $paintfunctionentsum
    $positionentersuppress
    $printersetupentitysetsystem
    $randomeraseto
    $replaceerrorstoolbar
    $replicateevaluatetop
    $rightexceptiontopmargin
    $rightclickmenuexectransaction
    $rightjustifyexiststransform
    $roundexposetransmit
    $screenprintfieldtrim
    $screensavefillcoloruncompile
    $secondsfindunderline
    $sendtoserverfld
    $serverfunctionflowunrelated
    $setpropertyfocusup
    $sinfontupdate
    $sinhfontsizeusing
    $snfootingvalues
    $soundexforvariable
    $sqrtforegroundverb
    $squeezeformwarnings
    $substringformatwh
    $sysdiridfromwidth
    $sysseqnofunctionkeyswhen
    $tangeneratewhere
    $tanhgotowhile
    $ticksgraphwidth
    $toalphagroupwindow
    $tocharacterhavingwork
    $tochrheadingswrap
    $todatehelpxor
    $tolowerhidexref
    $tonumberif
    $toordimmediately
    $totalin

    UPDATE

    Changes data in EntitySets, relationships, forms, or sets.

    Syntax

    UPDATE [ALL] [SQLsetspec] SET «field = value »
    [WHERE clause [EVALUATE clause] [-> clause]

    Parameters

    ALLOptional. Regardless of whether ALL is entered, all records in the set specification that meet the specified condition (if any) are updated.
    SQLsetspecAn SQL set specification. Can contain application documents, EntitySets, relationships, forms, and sets. Role names are permitted.
    If SQLsetspec is omitted, the current set is used (if it exists). Application documents named in the SQLsetspec may not be updated.
    fieldA target field in SQLsetspec.
    valueCan be:
    Any value expression.
    The keyword NULL.
    Field is assigned either the value of the expression, or the $Null property, as specified.
    Any number of field = value assignments may be entered. If a field is not explicitly specified for update, its value remains unchanged.

    Comments

    The function of the UPDATE command is similar to that of the CHANGE command. UPDATE is able to update more than one database file in one command.

    Example

    update Employees set Salary = Salary * 1.1

    change all Employees let Salary = Salary * 1.1

    The preceding two commands are equivalent. Notice that, although the ALL has been omitted from the UPDATE command, it nevertheless updates all records that conform to the set specification.

    update Employees, Departments
    set Employees.Salary = Departments.StdSalary
    where Employees.DNo = Departments.DNo

    In the preceding command, the join condition appears in the WHERE clause. Notice that no relationship is needed.

    See Also

    ADD

    CHANGE

    Conventions

    INSERT

    Adds a single record to EntitySets or relationships ( ISQL option only).

    Syntax

    INSERT INTO object [( field)] VALUES(expr1 | NULL)

    [EVALUATE clause] [clause]

    Parameters

    objectThe name of an EntitySet or relationship with fields to which you want to add a record. A role name can be used.
    fieldA target field in object. If more than one field is used, the names must be separated from one another by commas. If the field list is omitted, values are assigned to the fields in the order defined in the Object Dictionary.
    The number of values must not exceed the number of fields. If field is omitted, it is an error to specify more values than there are fields in object.
    expr1An expression whose value is to be assigned to the corresponding field in the field list; or, if the field list is omitted, to the corresponding field in the Object Dictionary sequence.
    Expressions or simple constants can be used. Any number of values can be given, separated from one another by commas. If field is omitted, it is an error to specify more values than there are fields in object.
    Fields not explicitly assigned a value become $Null or take their default values. A required field that has no default value must explicitly be assigned a value (unless a SET CHECKNULLS OFF command has been issued).
    NULLThis value explicitly sets the corresponding field to $Null.

    Comments

    INSERT adds a single record to the specified object.

    Example

    insert into Employees ( LastName, Salary) values (“Smith”, 25000)

    add Employees let LastName = “Smith” Salary = 25000

    The above examples are equivalent.
    The following example adds a new employee record for Fred Jones, age 36, whose salary is $30,000.

    insert into Employees values (“Jones”, “Fred”, 36, 30000)

     

    See Also

    ADD

    Conventions

    SET CHECKNULLS

    SELECT

    Lists selected data from the database.

    Syntax

    SELECT [ALL] [DISTINCT] values FROM SQLsetspec [-> setname]

    Parameters

    ALLAn optional keyword indicating that all records of the specified type are to be listed. But, even if ALL is omitted, all records are processed by default.
    DISTINCTSpecifies that only the records that contain unique values in the fields being displayed are to be listed.
    valuesCan be:
    *
    An asterisk indicates that all fields in the listed records are to be displayed.
    «expr »
    One or more expressions whose values are to be displayed for each listed record. Each expression must be separated from the next by a comma.
    SQLsetspecAn SQL set specification.

    Comments

    The SELECT command is the SQL equivalent of the LIST command.

    You can include sub-queries using the SELECT command in SQLsetspec.

    Example

    select LastName,FirstName from Employees,Departments
    where Employees.DNo = Departments.DNo

    list Employees WorkIn Departments format LastName FirstName

    The preceding two commands produce equivalent results.

    select $max(Salary) from Employees group by DNo
    having $average(Salary) > 30000

    In the preceding command, the keywords GROUP BY and HAVING produce a list of the highest-salaried employees within each department number where the average salary is greater than $30,000.

    select * from Emps order by LastName

    The preceding command lists all the fields in each employee record. The records are listed in alphabetical order by last name.

    select distinct LastName,FirstName from Emps

    The preceding command lists the first and last names of all employees, eliminating duplicates where two or more employees have exactly the same first and last name.

    See Also

    Conventions

    DELETE FROM

    FIND

    INSERT

    LIST

    UPDATE

    USING

    USING

    In a set specification, qualifies a relationship.

    Syntax

    relationship («USING obj1 AS obj2»)

    Parameters

    relationshipThe name of the relationship being qualified.
    obj1The name of an object used elsewhere in the set specification in which relationship appears. Must be the name or role name of an EntitySet, relationship, form, or application document. Must refer to same underlying object as obj2 (e.g., one is a role name for the other).
    obj2The name of one of the objects associated by relationship. Must be the name or role name of an EntitySet, relationship, form, or application document. Must refer to same underlying object as obj1 (e.g., one is a role name for the other).

    Comments

    When a set specification includes a relationship, two principles are used to determine the validity of EntitySets associated by the relationship:

    1. If the relationship condition contains an EntitySet name, then that EntitySet name, or any role for it, may be used in set specification involving the relationship.
    2. If the relationship condition contains a role name, only that role name may be used in a set specification involving the relationship.

    The USING subcommand helps to eliminate any ambiguity as to which objects are to be associated in a set specification. Ambiguity may develop when an object, or role for that object, appears more than once in a complex set specification.

    Example

    list all Employees WorkFor
    Managers WorkFor (using Managers as Employees
    using Bosses as Managers)
    Bosses
    Lists all bosses (managers of managers).
    list all Employees WorkFor Managers
    WorkIn (using Managers as Employees) Departments

    The USING subcommand associates the departments with the managers, not with the employees.

    See Also

    – (Dynamic Rename)

    COMPLETE

    UNRELATED

    en_CAEnglish