INITIALIZE

Freshly initializes per user entity sets and relationships with data.

Syntax

INITIALIZE PERUSER objectname

Parameters

objectname

 

An entity set name or relationship name (with fields).

 

Comments

INITIALIZE PERUSER creates a new physical file corresponding to the objectname. It eliminates the need of deleting all data from the object or copying physical files. Also, it doesn’t affect the internal data dictionary nor requires recompilation of programs after executing it.

It can be executed anytime a fresh file is needed.

objectname must be a PerUser object defined in the data dictionary and no longer needs to be indicated in the file “areas.zim”.

Example

If MyCustomer is an entity set defined as per user in the Data Dictionary, then the following statements are valid:

>INITIALIZE PERUSER MyCustomer

>ADD 1000000 MyCustomer FROM …

>FIND MyCustomer

>1000000 selected.

>INITIALIZE PERUSER MyCustomer

>FIND MyCustomer

>0 selected.

RESET CONNECTOR DOCUMENT

Resets the connector document file name to its original file name.

Syntax

RESET CONNECTOR DOCUMENT «connector document»

Parameters

connector document

The name of a connector document.

Comments

The RESET CONNECTOR DOCUMENT resets the filename for the connector document back to the value found in the Zim directory. The reset value will be used on all subsequent opens.

Example

reset connector document SMS_SEND

ZimBackup

Performs real-time and on-line backups of Zim databases.

Unix Syntax

[nohup] zimbackup [-k] &

Windows NT Syntax

[start] zimbackup [-k]

Parameters

-koptional parameter to stop Zim Backup Server

Comments

Zim Backup Server, working together with Zim Server, performs a real-time, online backup of any databases being serviced by Zim Server.

All modifications performed by Zim Server in a given database are subsequently applied to a copy of the database so that, in fact, there are two “live” databases, one which is the real database that Zim Server is managing to serve all users and a second one, which is an exact copy of the first one.

If something happens to the real database, Zim Backup Server can be stopped in the copy database, Zim Server can immediately start running in this copy database and users can reestablish their Zim sessions.

Before starting servicing users, Zim Server applies committed transactions to the backup database and then opens access to users.

Zim Backup can be stopped at any moment and let the backup databases be copied to another place. Later, Zim Backup can be restarted and all modifications to the real databases are applied in succession to the backup databases.

For operational details, refer to Database Backup.

BYE

Exits an application session and returns control to the operating system.

Syntax

BYE

Comments

The BYE command ends the current application session, when encountered.

If an application document called ZIMBYE exists and contains an application program, that program is automatically executed before the session ends. Depending on how you exit Zim, the zimbye is not necessarily executed. To ensure that the ZIMBYE application document is executed, exit Zim using the BYE command.

See Also

RETURN

STOP

System Variables

The software maintains a series of system variables that represent either fixed values ($ZimOS) or values that fluctuate dynamically with the current status of the software ($InTransaction) or of application objects (ThisWindow.WindowTag).

System variables resemble global variables in nature. The software automatically sets or resets the values of system variables to reflect the status of the software and the current application. In some cases, an application program can also reset them.

A system variable name can be used as an atomic expression denoting the value currently held in the memory location associated with the variable. A system variable name can be used almost anywhere that a literal can be used.

Available System Variables

System variables are categorized into those that supply information about windows, those that supply information about menus, those that supply information about forms, and those that supply general information. Some system variables are “binary” in nature in that they evaluate only to ‘1’ ($True) or ‘0’ ($False), while others may be set to a variety of values.

General-use System Variables with “Permanent” Values

Given a particular version of the software, the following system variables have the same value at all times during an application session:

$ClipPath

Path to the disk directory to be used for Cut, Copy, and Paste operations that involve user interface objects in the Screen Painter.

$DBCharSet

Indicates the character set used by the application database.

$DBPath

Path to the disk directory in which the application database is stored.

$False

A “binary” false value for comparison.

$ImagePath

Path to the disk directory containing image files for use in forms.

$Null

A “null” value for comparison.

$TimeSecs

The elapsed number of seconds since 12:00am, 1 January 1970.

$True

A “binary” true value for comparison.

$WorkPath

Path to the disk directory where the application users’ work fields can be found (specified in a Zim configuration file).

$ZimOS

Identifies the operating system in use.

$ZimPath

Path to the disk directory in which the Zim software is installed.

$ZimProduct

Identifies the Zim product currently being used.

$ZimVersion

Identifies the Zim version currently being used.

General-use System Variables with Values Derived from the Operating System

The software sets the values of the following system variables based on current values obtained from the operating system:

$Date

The current date.

$GroupID

The current user’s operating system group identifier.

$ScreenHeight, $ScreenWidth

The size of the terminal screen in character rows/columns.

$Time

The current time.

$UserID

The current user’s operating system user identifier.

System Variables Periodically Set/Reset by the Software or the Application System

The values of these variables are set and reset depending on conditions encountered during execution of the application. An application program can assign a value to any of these variables at any time; however, the assigned value can be overwritten as conditions subsequently change during the application session.

Last Callback Event

Event is a data structure that provides information about the application environment the time of the most recent callback even. Each variable in the structure provides one item of information. The values of these variables are reset each time a callback event returns control to the application program. An application program can assign a value to any of these variables at any time; however, the assigned value is overwritten the next time that a callback event occurs.

Event.AltKey,
Event.CtrlKey,
Event.ShiftKey

The state of the Alt, Ctrl, and Shift keys during the last event.

Event.EventName

The last event to occur.

Event.EventTag

The object in which the last event occurred.

Event.EventType

The type of event that last occurred.

Event.FieldTag

The current field at the time of the last event.

Event.FormTag

The current form at the time of the last event.

Event.KeyPressed

The key that, when pressed, caused the last event to occur.

Event.MenuItemTag

The selected item on the menu in the current window at the time of the last event.

Event.MenuTag

The current menu at the time of the last event.

Event.MouseClick

If a mouse button accelerator caused an event to occur.

Event.ScrollingKey

If an event corresponds to a defined SCROLL key.

Event.WindowTag

The current window at the time of the last event.

Text Cursor Positioning

$CursorCol, $CursorRow

The location of focus in a window when an event occurs.

$CursorScreenCol, $CursorScreenRow

The location of focus on the screen when an event occurs.

$Direction

The direction in which focus was moving when an event occurs.

Error Status

$ErrCode

The error code generated by the last command executed.

$ErrLevel

The error severity level generated by the last command executed.

$LastErrCode

The error code generated by the last command that returned an error code.

$LastErrLevel

The error severity level generated by the last command that returned an error severity level.

$LastErrMessage

The error message generated by the last command that returned an error code.

$MaxErrLevel

The highest error severity level generated during the application session.

$SQLErrCode

The error code returned from the SQL database.

$SQLErrMsg

The error message returned from the SQL database.

Other Status Conditions

$BreakFlag

If the application user has pressed the “break” key.

$DeadlockReason

The reason that a deadlock condition occurred.

$InTransaction

If an explicit transaction is in progress.

$Located

The number of records located by a LOCATE command.

$MemberCount

The number of records processed by a set-processing command.

$Page

The current page number in a report.

$SetCount

The number of records found by the last FIND command.

External Programs

$Editor

The name of a text editor software package.

$Graphics

The name of a graphics software package.

$HelpFile

The name of a disk file containing online help.

Security

$ZGroupID

The application user’s Zim group identifier.

$ZUserID

The application user’s Zim user identifier.

System Variables Concerned with Windows

Last Event in the Current Window

ThisWindow is a data structure that provides information about the state of the application environment and of the current window at the time of the last event in that window. Each variable in the structure provides one item of information. The values of these variables are reset each time a window becomes the current window. An application program can assign a value to any of these variables at any time; however, the assigned value is overwritten the next time that another window becomes the current window.

ThisWindow.AltKey,
ThisWindow.CtrlKey,
ThisWindow.ShiftKey

The state of the Alt, Ctrl, and Shift keys at the time of the last event in the current window.

ThisWindow.EventName

The last event that occurred in the current window.

ThisWindow.EventTag

The identification tag of the object in which the last event in the current window occurred.

ThisWindow.EventType

The type of event that last occurred in the current window.

ThisWindow.KeyPressed

The key that, when pressed, caused the event that last occurred in the current window.

ThisWindow.MouseClick

If a mouse button accelerator caused the event that last occurred in the current window.

ThisWindow.ScrollingKey

If the accelerator that caused the event that last occurred was also a defined SCROLL key.

ThisWindow.WindowCol,
ThisWindow.WindowRow

The character column and character row position of the current window.

ThisWindow.WindowHeight,
ThisWindow.WindowWidth

The physical size of the current window in character rows and columns.

ThisWindow.WindowName,
ThisWindow.WindowNum,
ThisWindow.WindowTag

The current window

ThisWindow.WindowState

If the current window is maximized, minimized, or otherwise.

Miscellaneous

$WindowPSHeight, WindowPSWidth

The logical size of the current window in character rows and columns.

System Variables Concerned with Menus

Last Event in the Current Menu

ThisMenu is a data structure that provides information about the state of the software environment and of the current menu at the time of the last event in that menu. Each variable in the structure provides one item of information. The values of these variables are reset each time that FORM or MENU INPUT terminates. An application program can assign a value to any of these variables at any time; however, the assigned value is overwritten the next time that FORM or MENU INPUT terminates.

ThisMenu.Menuchanged

If any menu item in the current menu has been modified by the application use at the time of the last event in the current window.

ThisMenu.MenuItemNum,
ThisMenu.MenuItemTag

The selected item on the menu at the time of the last event in the current window.

ThisMenu.MenuNum
ThisMenu.MenuTag

The current menu at the time of the last event in the current window.

System Variables Concerned with Forms

Last Event in the Current Form/Display

ThisForm is a data structure that provides information about the state of the current form/display at the time of the last event in the current window. Each variable in the structure provides one item of information. The values of these variables are reset each time that FROM or MENU INPUT terminates, An application program can assign a value to any of these variables at any time; however, the assigned value is overwritten the next time that FORM or MENU INPUT terminates.

ThisForm.DisplayTag

The display that had focus at the time of the last event in the current window.

ThisForm.FieldChanged

A code indicated if the form field that had focus at the time of the last event in the current window was modified by the application user.

ThisForm.FFFieldNum,
ThisForm.FieldTag

The form field that had focus at the time of the last event in the current window.

ThisForm.FormChanged

A code indicating if any form field in the form or display had been modified by the application user at the time of the last event in the current window.

ThisForm.FormNum,
ThisForm.FormTag

The form that had focus at the time of the last event in the current window.

ThisForm.ReqError,
ThisForm.ReqFieldNum,
ThisForm.ReqFormNum,
ThisForm.ReqSubscript,
ThisForm.ReqTag

If all required form fields had values at the time of the last event in the current window.

ThisForm.Subscript

The instance of the form where focus was located at the time of the last event in the current window.

ThisForm.ValError,
ThisForm.ValFieldNum,
ThisForm.ValFormNum.
ThisForm.ValSubscript,
ThisForm.ValTag

If all form fields contained valid values at the time of the last event in the current window.

 

Editing a Compiled Program

If you attempt to edit a compiled program (using the EDIT command), a message is issued, warning you that the program has been compiled. Knowing that a program you are modifying has been compiled enables you to choose whether to re-compile it or to run the uncompiled version. You must choose one of these alternatives for the changes that you have made to take effect.

Checking If a Program is Compiled

You can use one of the following methods to determine if a program has been compiled:

  • Use the $compilestatus function to check the compilation status of the program.
  • Run the Object Browser ( ZXLISTER) administrative utility. Any application document containing a compiled program shows a “-c” suffix following the file name.
  • Attempt to use the EDIT command to edit the program from within Zim. If the program has been compiled, a warning message is issued.
  • Issue a SET FLOW ON command. With FLOW set to ON, any call to a procedure produces a message indicating if the calling procedure is a compiled program.
  • Uncompile the program using the UNCOMPILE command. If the program was not compiled, an error message is issued.

The Lifetime of a Compiled Program

You can recompile an application program at any time. Recompiling replaces the existing compiled version of the program with a new compiled version. Recompiling is necessary if a compiled program becomes invalid for one of the following reasons:

  • The source version of the program has been updated.

Changes to the source program are not automatically reflected in the compiled version. Re-compile the program after making the changes. (The software issues a warning about this situation when you execute an EDIT command involving an application document that contains a source program.)

  • Objects have been changed.

Changes to objects (through the CREATE and ERASE commands) invalidate all compiled programs that use the affected objects. Ensure that all such “out-of-date” programs are re-compiled.

Zim provides mechanisms for automatically storing dependency information (e.g., a program’s references to objects). (For more information, see the DEPENDENCY command).

pt_BRPortuguese