Methods

Defining a method

method mAdd(viSelf)
endMethod

The keywords METHOD and ENDMETHOD have replaced LOCALPROCEDURE and ENDPROCEDURE.

The above method declaration does not contain any behaviour. The class zCustomer below shows the class implementation, including behaviour for the add method.

%—————————————————————–
method mAdd(viSelf)
add Customer from aCustomer
endMethod

%—————————————————————–
method mDelete(viSelf)
delete sCustomer where ID = aCustomer.ID
endMethod

%—————————————————————–
method mpCustomer(viMethod, inout vtSelf)
change aCustomer let pMethod = viMethod
endMethod

%—————————————————————–
method mpFinalize(viSelf)
endMethod

%=================================================================
class zCustomer(viMethod, viSelf)
mpCustomer(viMethod,viSelf)
case
when aCustomer.pMethod = ‘add’
  mAdd(viSelf)
when aCustomer.pMethod = ‘ delete’
  mDelete(viSelf)
endCase
mpFinalize(viSelf)
endClass

Method Dispatcher

Method dispatcher calls the appropriate method defined in messages that are sent to the class.

The method dispatcher is placed in the class body as a CASE statement. No behaviour is coded in the method dispatcher, only in the methods of the class.

Public methods, methods that can be called by another class, have a fixed protocol of one parameter, viSelf.

Private methods, methods that can be only called by the containing class, have no fixed number of parameters. These methods are never called in the method dispatcher or in the class body, except for constructor and destructor methods.

Section 4.3 Layout and Style describes a template for the dispatcher.

Constructor and Destructor Methods

Each class has two standard private methods – constructor and destructor.

The constructor method, which derives its name from the base name (e.g. zCustomermpCustomer), is invoked when the class is instantiated or called. The destructor method, mpFinalize, executes any clean up operations.

Protocol

A class has two parameters:

viMethod is used to pass the method to be executed by the class. The method is passed to the class as a parameter and is directly assigned to the attribute structure to improve readability and ensure upward compatibility. This notation is similar to other object-oriented languages that reference methods using the dot notation; e.g. customer.add().

viSelf is used to pass the calling class base name. Passing this name allows a super-class that inherits a method to call or access the attributes of the subclass for run-time inheritance.

The base name is the name of the logical class. For example, the logical class CustomerTableUI is implemented as zCustomerTableUI (the class) and aCustomerTableUI (the attribute structure) in Zim.

Please review Section 3.6 for an example of run-time inheritance.

The message to an object consists of:

• data values assigned to the attribute structure

• any named sets

• the class call

• method

• self parameter

Inheritance

Inheritance provides a classification of objects that exploits their commonality. A hierarchy is formed where a child object inherits attributes and behaviour from a parent object. A parent may have many children, and that parent’s parent may have many children.

Figure 1: A class hierarchy

An example of a class hierarchy that is derived from an organization domain may look like this:

Figure 2: Class hierarchy derived from an organization domain

In this example, the Manager object inherits the attributes firstName and lastName from the object Person. It also inherits the methods (behaviour) new (specifies how to create a new person) and applyforLeave.

By creating a hierarchy, the Zim developer can programme by extension rather than by re-invention [LaLonde 90].

ZCS does not define any standard inheritance mechanism. Zim developers can choose between generated (early binding) or run-time (late-binding) inheritance.

Generated inheritance uses the class hierarchy to generate a single executable class from parent source files. For example, zManager maybe generated by three templates, tPerson, tEmpoyee, and tManager to produce one class file.

Runtime inheritance uses the class hierarchy to execute parent classes on the fly. For example, to execute the method applyForLeave, zManager calls zEmployee passing its parameters to the parent class.

The viSelf component of the protocol provides the mechanism for run-time inheritance. In generated inheritance this would be ignored, but not omitted. This allows a generated class library to call a class library based on run-time inheritance.

An Example of Run-time Inheritance

Please note the following is only an example and that the ZCS does not standardise a method for inheritance.

Continuing the example from the previous section, the class zManager inherits the method ’applyForLeave’ from zEmployee.

Figure 3: Manager inherits behaviour from Employee

In this example, the UI component zManagerUI calls zManager to ’applyForLeave’. The call (know as a delegation) within zManagerUI is implemented in Zim like this:

zManager(’applyForLeave’, ’’)

Note that viSelf is blank because the call is made across the hierarchy (a delegated call) not up the tree (an inherited call). The code for zManager appears below. Notice that the method ’applyForLeave’ does not exist in zManager and the method dispatcher calls zEmployee using the otherwise component of the case statement.

Note that zEmployee is an abstract class. This means that the class will only be executed using an inheritance call, not a delegated call. zEmployee is an abstraction of zManager.

The code for zManager is shown below followed by zEmployee.

%—————————————————————–
method mAssignEmployee(viSelf)
add ManagerEmployee from aManager
endMethod

%—————————————————————–
method mpManager(viMethod, inout vtSelf)
change aManager let pMethod = viMethod
let vtSelf = {vtSelf where vtSelf < ’’, ’zManager’}
endMethod

%—————————————————————–
method mpFinalize(viSelf)
endMethod

%=================================================================
class zManager(viMethod, viSelf)
mpManager(viMethod,viSelf)
%Methods
case
when aManager.pMethod = ‘assignEmployee’
  mAssignEmployee(viSelf)
otherwise
zEmployee(aManager.pMethod, viSelf)
endCase
mpFinalize(viSelf)
endClass

%—————————————————————–
method mApplyForLeave(viSelf)
change employee where ID = aEmployee.ID let ApplyForLeave=$true
endmethod

%—————————————————————–
method mpEmployee(viMethod,viSelf)
let = $replace(viSelf, 1, 1 a)
change aEmployee from a# let aEmployee.pMethod = viMethod
endMethod

%—————————————————————–
method mpFinalize(viSelf)
change a# from aEmployee
endMethod

%=================================================================
class zEmployee(viMethod, viSelf)
mpEmployee(viMethod,viSelf)
case
when aManager.pMethod = ‘applyForLeave’
  mApplyForLeave(viSelf)
endCase
mpFinalize(viSelf)
endClass

There are five points to note in the code of zEmployee.

1. mpEmployee moves the attributes across from aManager to aEmployee.

2. zEmployee manipulates the structure of aEmployee only.

3. mFinalize moves the modified attributes back to aManager.

An example of a class library using a complete run-time inheritance mechanism is the ZCL.

Please remember there are other variations of run-time inheritance that can be implemented. For example inheritance may be table driven. A child looks up a parent in a table and then the class is made to the parent. The parent still needs to know the child (for transferring of attribute values) and this is passed via viSelf.

Packages

Packages are a means to group classes into logical groups. The equivalent in Zim is the object directories. The directory allows you to manage a large group of classes and avoid naming conflicts. Classes are created in a directory exactly the same as other Zim objects.

 

 

Zim Constants

The following table contains a list of the Zim constants, types, locations, and values.

ConstNameConstTypeDirNameConstValue
Black
Blue
Green
Cyan
Red
Magenta
Brown
LightGrey
DarkGrey
LightBlue
LightGreen
LightCyan
LightRed
LightMagenta
Yellow
White
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Escape
Esc
char
char
ZIM
ZIM
ESCAPE
ESCAPE
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
F13
F14
F15
F16
F17
F18
F19
F20
F21
F22
F23
F24
F25
F26
F27
F28
F29
F30
F31
F32
F33
F34
F35
F36
F37
F38
F39
F40
F41
F42
F43
F44
F45
F46
F47
F48
F49
F50
F51
F52
F53
F54
F55
F56
F57
F58
F59
F60
F61
F62
F63
F64
F65
F66
F67
F68
F69
F70
F71
F72
F73
F74
F75
F76
F77
F78
F79
F80
F81
F82
F83
F84
F85
F86
F87
F88
F89
F90
F91
F92
F93
F94
F95
F96
F97
F98
F99
F100
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
F13
F14
F15
F16
F17
F18
F19
F20
F21
F22
F23
F24
F25
F26
F27
F28
F29
F30
F31
F32
F33
F34
F35
F36
F37
F38
F39
F40
F41
F42
F43
F44
F45
F46
F47
F48
F49
F50
F51
F52
F53
F54
F55
F56
F57
F58
F59
F60
F61
F62
F63
F64
F65
F66
F67
F68
F69
F70
F71
F72
F73
F74
F75
F76
F77
F78
F79
F80
F81
F82
F83
F84
F85
F86
F87
F88
F89
F90
F91
F92
F93
F94
F95
F96
F97
F98
F99
F100
Home
JumpDown
JumpLeft
JumpRight
JumpUp
PageDown
PageUp
TabBack
TabForward
char
char
char
char
char
char
char
char
char
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
HOME
JUMPDOWN
JUMPLEFT
JUMPRIGHT
JUMPUP
PAGEDOWN
PAGEUP
TABBACK
TABFORWARD
Button1
Button2
Button3
Button4
Button5
Button6
char
char
char
char
char
char
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
BUTTON1
BUTTON2
BUTTON3
BUTTON4
BUTTON5
BUTTON6
CActiveBorder
CActiveCaption
CAppWorkSpace
CWindowBackground
CButtonFace
CButtonShadow
CButtonText
CCaptionText
CGrayText
CHighlightColor
CHighlightText
CInactiveBorder
CInactiveCaption
CMenuColor
CMenuTextColor
CScrollBarColor
CWindowFrame
CWindowText
CInactivCaptionTxt
CButtonHighlight
CWindowColor
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
ZIM
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
$CurrentODRevision
$CurrentODVersion
cEOLNTRANSLATE
$CurrentCOVersion
$CurrentDCRevision
$CurrentDCVersion
char
char
char
char
char
char
ZIMServices
ZIMServices
$Utils
$DevCen
$DevCen
$DevCen
1.0
6.1

 

1
1.0
6.1

Alt0
Alt1
Alt2
Alt3
Alt4
Alt5
Alt6
Alt7
Alt8
Alt9
AltA
AltB
AltC
AltD
AltE
AltEqual
AltF
AltF1
AltF10
AltF11
AltF12
AltF2
AltF3
AltF4
AltF5
AltF6
AltF7
AltF8
AltF9
AltG
AltH
AltI
AltJ
AltK
AltL
AltM
AltMinus
AltN
AltO
AltP
AltQ
AltR
AltS
AltT
AltU
AltV
AltW
AltX
AltY
AltZ
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployService
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
F50
F41
F42
F43
F44
F45
F46
F47
F48
F49
F63
F76
F74
F65
F55
F52
F66
F31
F40
F83
F84
F32
F33
F34
F35
F36
F37
F38
F39
F67
F68
F60
F69
F70
F71
F78
F51
F77
F61
F62
F53
F56
F64
F57
F59
F75
F54
F73
F58
F72
ATTROEFTYPE
ATTROFOEFTYPE
char
char
$CompDevCen
$CompDevCen
FIELD
FIELDOF
BTN_BITMAP
BTN_ICON
BTN_MFILE
BTN_TEXT
numeric
numeric
numeric
numeric
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
3
2
4
1
c10X14
c11X17
cA3
cA4
cA4SMALL
cA5
cApplicationClass
cAVAILABLE
cB4
cB5
cBIN_AUTO
cBIN_CASSETTE
cBIN_ENVELOPE
cBIN_ENVMANUAL
cBIN_LARGECAPACITY
cBIN_LARGEFMT
cBIN_LOWER
cBIN_MANUAL
cBIN_MIDDLE
cBIN_SMALLFMT
cBIN_TRACTOR
cBIN_UPPER
cBITMAP
cCHARTLEN
cChildClass
cCLICK
cCOLOR
cCSHEET
cDEFAULT
cDependentClass
cDOUBLECLICK
cDOWNLOAD
cDRAFT
cDSHEET
cENV_10
cENV_11
cENV_12
cENV_14
cENV_9
cENV_B4
cENV_B5
cENV_B6
cENV_C3
cENV_C4
cENV_C5
cENV_C6
cENV_C65
cENV_DL
cENV_ITALY
cENV_MONARCH
cENV_PERSONAL
cESHEET
cEVACCELERATOR
cEVCLICK
cEVCLOSED
cEVDOUBLECLICK
cEVLOSTFOCUS
cEVLOSTFOCUSMOD
cEVMODIFIED
cEVTFORMFIELD
cEVTWINDOW
cEXECUTIVE
cFFLDTSEP
cFFMINTLEN
cFFOLD_GERMAN_LGL
cFFOLD_GERMAN_STD
cFFOLD_US
cFOLIO
cGEN_DOC
cGEN_ENT
cGEN_REL
cGOTFOCUS
cHIGH
cHORIZONTAL
cIMP_FF
cIMP_FORM
cIMP_ITEM
cIMP_MENU
cLANDSCAPE
cLEDGER
cLEGAL
cLETTER
cLETTERSMALL
cLOGICAL_INCHS
cLOW
CMAHeaderTag_001
cMEDIUM
cMINCOL
cMINROW
cMODIFIED
cMONOCHROME
cNotConnected
cNOTE
CONSTOBJTYPE
CONSTSOEFTYPE
cPIXELS
cPOINTS
cPORTRAIT
cQUARTO
cQUESTIONMSG
csBLANK
csCOMBO
csENTRY
csFILLCOLOR
csFORM
csFRAME
csGRAPHIC
cSHADOWDEFAULT
csIMAGE
cSIMPLEX
csLABEL
csLIST
csLOADFORM
csMENU
csMENUITEM
csOBB
csOLE
csOPTION
csPENCOLOR
csPUSH
cSQLColumnInput
cSQLColumnOutput
cSQLColumnResult
csREADY
csSAVEFORM
csSCROLL
cSTATEMENT
csTOGGLE
cSUBDEV
csWINDOW
cTABLOID
cTEXT
cTOGGLE_OFF
cTOGGLE_ON
cTRANSFIELD
CtrlBackTab
char
char
char
char
char
char
numeric
numeric
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
numeric
numeric
char
char
char
char
numeric
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
numeric
numeric
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
numeric
numeric
char
char
numeric
char
char
char
char
char
char
char
numeric
char
char
char
char
char
char
char
numeric
char
char
char
char
char
char
char
char
char
char
char
char
Numeric
Numeric
Numeric
char
char
char
char
char
char
char
char
numeric
char
char
char
char
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompWinPtr
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompDevCen
$DeployServices
$CompWinPtr
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompWinPtr
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$DeployServices
$CompDevCen
$CompDevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$DeployServices
$DeployServices
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompDevCen
$DeployServices
$CompWinPtr
$CompWinPtr
$CompWinPtr
$DeployServices
$CompDevCen
$DeployServices
$DevCen
$CompDevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompDevCen
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$DeployServices
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompDevCen
$CompDevCen
$CompDevCen
$CompWinPtr
$CompWinPtr
$CompWinPtr
$DeployServices
$CompWinPtr
$DeployServices
$CompWinPtr
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompWinPtr
$DeployServices
16
17
8
9
10
11
37
12
13
7
14
5
6
11
10
2
4
3
9
8
1
1
100
1
widgetevent
2
24
2
widgetevent
2
-1
25
20
21
22
23
19
33
34
35
29
30
28
31
32
27
36
37
38
26
Accelerator
Click
Closed
Doubleclick
LostFocus
LostFocusModified
Modified
FormField
Window
7
100
300
41
40
39
14
D
E
R
enterfield
-4
3
B
A
D
C
2
4
5
1
2
3
-2
__!!_CMAHeaderTag_001_!!__
-3
2
2
WGMODIFIED
1
8275
18
Constant
CONSTANT
2
1
15
4
[blank]
Combo
Entry
Fill
Color
Form
Frame
Graphic
Image
1
Label
List
Loading
Form
Menu
Item
OBB
OLE
Option
Pen
Color
Push
1
4
3
Ready
Saving
Form
Scroll
6
Toggle
3
Window
3
2
1
transmitted
CTLTABBACK
CtrlF1
CtrlF10
CtrlF11
CtrlF12
CtrlF2
CtrlF3
CtrlF4
CtrlF5
CtrlF6
CtrlF7
CtrlF8
CtrlF9
CtrlTab
char
char
char
char
char
char
char
char
char
char
char
char
char
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
F21
F30
F81
F82
F22
F23
F24
F25
F26
F27
F28
F29
CTLTAB
cTWIPS
cUNAVAILABLE
cUNNAMED
cUSER
cUSERGBCOLOR
cVERTICAL
cWDGCLICK
cWDGEVENT
cWINDOWEVENT
cWNCLOSE
char
numeric
char
char
numeric
char
char
char
char
char
$DeployServices
$CompWinPtr
$CompWinPtr
$DeployServices
$CompWinPtr
$DeployServices
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
1
48
[unnamed]
256
99
2
WGCLICK
widgetevent
windowevent
WNCLOSE
DFOBJTYPE
DFSOEFTYPE
DIROBJTYPE
DIRSOEFTYPE
DISPOBJTYPE
DISPSOEFTYPE
DOCOBJTYPE
DOMOEFTYPE
DPSBREAK
DPSERROR
DPSNOTENTERED
DPSOK
DFSOEFTYPE
DIROBJTYPE
DIRSOEFTYPE
DISPOBJTYPE
DISPSOEFTYPE
DOCOBJTYPE
DOMOEFTYPE
DPSBREAK
DPSERROR
DPSNOTENTERED
DPSOK
char

 

char

char

char
char
numeric
numeric
numeric
numeric

char

char

char
char
numeric
numeric
numeric
numeric

$DevCen
$CompDevCen
$DevCen
$CompDevCen
$DevCen
$CompDevCen
$DevCen
$CompDevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompDevCen
$DevCen
$CompDevCen
$DevCen
$CompDevCen
$DevCen
$CompDevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
DisplayForm
DISPLAYFORM
Directory
DIRECTORY
Display
DISPLAY
Document
DOMAIN
1
2
100007
DISPLAYFORM
Directory
DIRECTORY
Display
DISPLAY
Document
DOMAIN
1
2
100007
0
ENTOBJTYPE
ENTOEFTYPE
ERMSGGTONEOBJ
ERMSGINVALIDTARG
ERMSGNOOBJ
ERMSGNOTARGDIR
ERMSGNOTDOCOBJ
ERMSGOBJLOCKED
ERMSGOVRWRTDOC
errADDDELETED
errDEADLOCK
errDEFMESSAGE
errDEFPROGRESS
errDELETEDATA
errDUPLICATEKEY
errDUPLKEY
errINVALIDDATA
errLOADING
errMEMBERDELETED
errNOMATCHRECORD
errNOMSG
errNORECORDSFOUND
errNOTIMPLEMENTED
errREQUIREDATA
errRequireDetail
errSAVEDATA
errUNKNOWNACTION
errUNKNOWNSTATE
errUNKNOWNVIEW
errUSERBREAK
char
char
char
numeric
char
char
char
char
char
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric

 

numeric
numeric

$DevCen
$CompDevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
EntitySet
ENTITYSET
100001
100006
100000
100005
100002
100004
100003
10
2010
1
2
15
8007
8007
13
22
8006
21
-1
20
19
14
31
11
12
18
17
16
FFNAMEOEFTYPE
FFOBJTYPE
FFSOEFTYPE
FLDOBJTYPE
FNAMEOEFTYPE
FORMOBJTYPE
FORMSOEFTYPE
FT_COMBO_BOX
FT_ENTRY
FT_FRAME
FT_GRAPHIC
FT_IMAGE
FT_LABEL
FT_LIST_BOX
FT_MENU
FT_MENU_ITEM
FT_OLE
FT_OPT_BTN_BOX
FT_PUSH_BTN
FT_SCROLL_BAR
FT_SEP_ITEM
FT_TOGGLE_BTN
char
char

 

char
char
char

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

$CompDevCen
$DevCen
$CompDevCen
$DevCen
$CompDevCen
$DevCen
$CompDevCen
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
FORMFIELDNAME
FormField
FORMFIELD
Field
FIELDNAME
Form
FORM
C
V
F
F
I
P
L
X
M
E
O
B
S
U
T
GEROEFTYPE
GRF_LINE
GRF_RECT
char
numeric
numeric
$CompDevCen
$CompWinPtr
$CompWinPtr
GERUND
1
2
IMG_BITMAP
IMG_ICON
IMG_MFILE
infADDEDMSG
infAddingMsg
infCHANGEDMSG
infChangingMsg
infDELETEDMSG
infDeletingMsg
infDTLADDEDMSG
infDTLDELETEDMSG
infFOUNDMSG
INSTOFOEFTYPE
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
char
$CompWinPtr
$CompWinPtr
$CompWinPtr
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompDevCen
1
2
3
27
34
25
32
26
33
29
30
28
INSTANCEOF
MENU_BITMAP
MENU_TEXT
MENUOBJTYPE
MENUSOEFTYPE
MQerrEMPTY
MQerrNOOP
MQerrNOTFOUND
MQerrOVERFLOW
numeric
numeric
char

 

char
char
char
char

$CompWinPtr
$CompWinPtr
$DevCen
$CompDevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
2
1
Menu
MENU
-9103
-9102
-9100
-9101
NULL_WDG_IDnumeric$CompWinPtr0
opAdd
opAddAll
opAddDetail
opClearDetail
opComputeDetail
opDelete
opDeleteAllDetail
opDeleteDetail
opDuplicate
opFind
opInit
opPaint
opPeekKey
opPrintData
opQuery
opRename
opRestoreDetail
opSelect
opSort
opUpdate
osDOS
osOS2
osQNX
osUnix
osUnixSCO
osUnixSun
osVMS
osWin3
numeric
Numeric
numeric
numeric
numeric
numeric
numeric
numeric
numeric
char
numeric
numeric
char
numeric
numeric
numeric
Numeric
char
numeric
numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$CompDevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
_ZIMServices
_ZIMServices
_ZIMServices
_ZIMServices
_ZIMServices
_ZIMServices
_ZIMServices
_ZIMServices
2
26
23
20
21
3
24
22
7
8
7000
10
12
4
6
25
9
5
1
7
8
6
3
2
4
5
11
PMerrEMPTY
PMerrNOOP
PMerrNOTFOUND
PMerrOVERFLOW
char
char
char
char
$DeployServices
$DeployServices
$DeployServices
$DeployServices
-9003
-9002
-9000
-9001
questPRINTSET
questPRINTWIN
numeric
numeric
$DeployServices
$DeployServices
24
23
RELOBJTYPE
RELOEFTYPE
ROLEFOROEFTYPE
ROLEOBJTYPE
ROLEOEFTYPE
char
char
char
char
char
$DevCen
$CompDevCen
$CompDevCen
$DevCen
$CompDevCen
Relationship
RELATIONSHIP
ROLEFOR
Role
ROLE
SBR_HORIZ
SBR_VERT
SETOBJTYPE
SETSOEFTYPE
numeric
numeric
char
$CompWinPtr
$CompWinPtr
$DevCen
$CompDevCen
1
2
Set
NAMEDSET
ShiftF1
ShiftF10
ShiftF11
ShiftF12
ShiftF2
ShiftF3
ShiftF4
ShiftF5
ShiftF6
ShiftF7
ShiftF8
ShiftF9
char
char
char
char
char
char
char
char
char
char
char
char
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
F11
F20
F79
F80
F12
F13
F14
F15
F16
F17
F18
F19
stBROWSE
STDOCOEFTYPE
stEDIT
stEDITMODIFIED
stNEW
stNEWMODIFIED
stNULL
$DeployServices
Null
char$DeployServices
$CompDevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
$DeployServices
Browse
DOCUMENT
Edit
EditModified
New
NewModified
Null
TOG_3STATE
TOG_BITMAP
TOG_CHECK
TOG_RADIO
numeric
numric
numeric
numeric
$CompWinPtr
$CompWinPtr
$CompWinPtr
$CompWinPtr
3
3
1
2
VAROBJTYPE
VARSOEFTYPE
vwFORM
vwNULL
vwSHEET
vwTABLE
char$DevCen
$CompDevCen
$DeployServices
$DeployServices
$DeployServices
$DeployServices
Variable
VARIABLE
Form
Null
Sheet
Table
WINOBJTYPE
WINSOEFTYPE
WO_HORIZ
WO_VERT
char

 

numeric
numeric

$DevCen
$CompDevCen
$CompWinPtr
$CompWinPtr
Window
WINDOW
1
2
ZOM0OPTION
ZOM1OPTION
ZOM2OPTION
ZOM3OPTION
ZOM4OPTION
ZOM5OPTION
ZOM6OPTION
ZOM7OPTION
ZOM8OPTION
ZOM9OPTION
ZOMAOPTION
ZOMBOPTION
ZOMBREAK
ZOMCLCURRENT
ZOMCLINTER
ZOMCLLIST
ZOMCLMINUS
ZOMCLOPTION
ZOMCLTARGET
ZOMCLUNION
ZOMCOPTION
ZOMDEPDIROWNER
ZOMDOPTION
ZOMEOPTION
ZOMERRIGNORE
ZOMERROR
ZOMERRORLEVEL
ZOMFLAGEXPLODE
ZOMFLAGTRUE
ZOMFOPTION
ZOMGOPTION
ZOMHOPTION
ZOMINFOLEVEL
ZOMIOPTION
ZOMJOPTION
ZOMKOPTION
ZOMLOPTION
ZOMMACRO
ZOMMOPTION
ZOMNOEXPLODE
ZOMNOPTION
ZOMNOTENTERED
ZOMOBJCORRUPT
ZOMOK
ZOMOOPTION
ZOMOPTIONORDA
ZOMPOPTION
ZOMQOPTION
ZOMRCRTEXPLODE
ZOMROPTION
ZOMSOPTION
ZOMSTATOBJLOCKED
ZOMSYSTEMLEVEL
ZOMTOPTION
ZOMTPBASE
ZOMTPDEP
ZOMUOPTION
ZOMVOPTION
ZOMWARNINGLEVEL
ZOMWOPTION
ZOMXOPTION
ZOMYOPTION
ZOMZOPTION
char
char
char
char
char
char
char
char
char
char
char
char
numeric
char
char
char
char
char
char
char
char
char
char
char
char
numeric
numeric
char
char
char
char
char
numeric
char
char
char
char
char
char
char
char
numeric
char
numeric
char
numeric
char
char
char
char
char
numeric
numeric
char
char
char
char
char
numeric
char
char
char
char
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$CompDevCen
$CompDevCen
$DevCen
$CompDevCen
$CompDevCen
$CompDevCen
$CompDevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
$DevCen
1
2
3
4
5
6
7
8
9
10
11
12
1
.
^
,

;
>
+
13
D
14
15
I
2
3
1
Y
16
17
18
1
19
20
21
22
M
23
24
100007
C
25
65
26
27
2
28
29
1
4
30
Y
D
31
31
2
33
34
35
36

{ } (Case) – Inline Case Expressions

Unlock the Power of Conditional Logic with Zim Case Expressions

Elevate your Zim application development with our powerful case expressions feature. Designed to streamline your coding process and enhance functionality, case expressions provide a robust solution for handling conditional values effortlessly.

Key Benefits:

  • Efficient Coding: Simplify your code with concise case expressions, reducing complexity and improving readability.
  • Reliable Value Assignment: Ensure non-null values in critical operations, preventing errors and enhancing application stability.
  • Dynamic Adjustments: Implement dynamic logic that adapts to changing conditions, delivering flexible and responsive applications.
  • Graceful Handling of Missing Data: Provide fallback options for missing values, ensuring comprehensive and informative outputs.

Case Expressions in Zim

Syntax:

{ expression1 , expression2 }

Parameters:

  • expression1: Any value expression.
  • expression2: Any value expression.

Return Value:

  • The value of the first expression that is not $Null.

Technical Expansion:

Evaluation Process:

  • Sequential Evaluation: The expressions within the braces are evaluated from left to right. This ensures that the first non-null value is selected, providing a reliable mechanism for conditional value assignment.
  • Nested Expressions: Case expressions can be nested, allowing for complex conditional logic to be handled efficiently. This is particularly useful in scenarios where multiple conditions need to be evaluated in sequence.

Usage Scenarios:

  • Conditional Value Assignment: Case expressions are ideal for assigning values based on conditions. For example, determining a status based on height:
  let Status = {'tall' where Height > 6, 'short'}

This simplifies the code and ensures that the correct status is assigned based on the height condition.

  • Ensuring Non-Null Values: In situations where a field or widget might be $Null, case expressions can provide a default value, ensuring that operations proceed smoothly:
  let Salary = {fAddEmps.Salary, 0}
  • Dynamic Action Determination: Case expressions can be used to determine actions based on conditions, such as adjusting a year based on the month:
  break 1
    {$year(InvDate) + 1 where $month(InvDate) >= 5, $year(InvDate)}
    heading ...
  • Handling Missing Values: In reports or outputs, case expressions can handle missing values gracefully, providing a fallback option:
  detail line "Employee Number: " {EmpNum, "N/A"}

Advanced Features:

  • Platform Independence: Case expressions are versatile and can be used across different platforms, ensuring consistent behavior in various environments.
  • Performance Optimization: By minimizing the code required for conditional logic, case expressions can improve the performance of applications, reducing processing time and resource usage.

Experience the Difference: Transform your Zim applications with the efficiency and reliability of case expressions. Whether you’re streamlining conditional logic, ensuring non-null values, or handling dynamic adjustments, our case expressions feature is your key to superior development.

PARSE

Tests a single Zim command, or an application program, for syntactic and semantic accuracy.

Syntax

PARSE commandstring | docname

Parameters

commandstringAny character string, enclosed in quotation marks, that represents a Zim command to be parsed.
docnameThe name of an application document that contains an application program to be parsed.

Comments

The PARSE command enables you to check an individual command or an entire program without executing either the command or the program. Executing a PARSE command does not affect any data values held either in memory or in the database. The PARSE command reports any syntactic or semantic irregularities that the PARSE command uncovers.

The sets created by FIND commands in parsed programs are defined. Only the directories accessed at the time that the PARSE command is executed are used. The ACCESS and RELEASE commands are parsed but not executed.

A program is parsed on a line-by-line basis. A program called from the program being parsed is not parsed, but the software does check to see if the program exists. All parts of commands with conditions are parsed, regardless of the validity of the conditions or the presence of any BREAK, CONTINUE, or TRANSFORM command.

Example

To check a command before running it, use

parse “list all Employees where LastName = Smith”

If you have an application program MyProg that calls the program SubUserCom, enter

parse MyProg

Only the command statements in MyProg are parsed. The software checks that SubUserCom exists, but does not parse it.

See Also

COMPILE

DEPENDENCY

GENERATE

LET

Assigns a value to a variable object.

Syntax

LET expression

Parameters

targetA global or local variable, a form field or menu item, a parameter, or a macro can be used. Subscripted (array) variables are valid.
expressionAny value expression.
The value of expression is assigned to target. Expression can include literals, constants, global or local variables, form fields, menu items, parameters, or fields in the current set. These objects can be combined using any of the arithmetic operators and functions.

Comments

The LET command is used to assign values to variable objects. To assign values to a field in an EntitySet or relationship, you must use ADD, CHANGE, INSERT, or UPDATE (which can contain a LET subcommand). The LET command is not used to assign values to database fields.

An assignment expression is formed by enclosing the LET command in parentheses.

If expression evaluates to $Null and target is a macro, the macro is assigned the null string. (A null string is a string of zero length, which is not the same as the $Null property.)

Example

let var1[1]=1 var1[2]=2 var1[3]=3

let var1 = $Date var2 = $tolower(LastName) var3[2] = 123

An example of using LET to assign values to variables.

let = “where LastName = Smith”

let= “from terminal prompt”

let <5> = $null

An example of using LET to assign values to macros.

See Also

Macros

ADD

CHANGE

How To Use Variables

INSERT

SET QUOTING

UPDATE

WHERE

COMPUTE

Computes the results of one or more expressions for a set of records.

Syntax

COMPUTE [num] [setspec] EVALUATE clause [-> clause]

Parameters

num

Can 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 ALL.

setspec

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

Comments

COMPUTE evaluates one or more expressions for a set of records without having to first LIST the data or create a result set of the desired records.

Example

Compute all Employees where LName=Smith \

evaluate \

(let TotSal = $total(Salary)) \

(let MaxSal = $max(Salary)) \

(let MinSal = $min(Salary)) \

(let NoOfEmps = $count(LName)) \

(let AvgSal = $average (Salary))

output TotSal MaxSal MinSal NoOfEmps AvgSal

Processes the EVALUATE clause for every employee whose last name is “Smith”. The OUTPUT command displays the results.

form open dInvoice

form display input

compute fInvItems evaluate (let fInvBott.InvTot = $total(fInvItems.Amt))

form display fInvBott.InvTot

Calls up a display and calculates a total after all items have been added.

 

See Also

$MEMBERCOUNT

FIND

INPUT

Gets serial input from the application user.

Syntax

INPUT «target»

Parameters

targetA list of one or more global or local variables, form fields, menu items, parameters, or macros, in any combination. Subscripted (array) variables are valid. Each item must be separated from the next by a space.

Comments

INPUT provides a simple means of reading a line of input from the application user. The line of input is divided into literal strings based on the delimiter character currently in effect. The literals are assigned to the variables and macros specified in target, in order from left to right.

Example

input TestVar fEmpform.LastName Param1 < CommandName> <3>

When the above command pauses for input, the following constants can be input by the application user:

32 Smith abc LIST abc_def

If current delimiter is the space character, the constants are assigned as follows:

TestVar32
fEmpform.LastNameSmith
Param1abc
#< CommandName>LIST
#<3>abc_def

The following sequence of entries accomplishes the same effect, but uses the comma as the delimiter:

set delimiter “,”

input TestVar fEmpform.LastName Param1 < CommandName> <3>

32,Smith, abc,LIST, abc_def

Attention

When using the following construction, a “:” must be placed at the end of the OUTPUT string:

OUTPUT “Please, respond with Yes or No (Y/N): “;

input vResponse

See Also

SET DELIMITER

OUTPUT

NEXT

Moves the current member pointer one or more members down in a result set.

Syntax

DOWN [num] [setname]

Parameters

numThe number of members farther “down” into setname that the current member pointer is to be moved. Num can be
an integer constant (15, 200);
a variable, form field, or parameter that evaluates to an integer;
the word ALL.
The default value for num is 1. If num is negative, DOWN num actually moves the current member pointer “up” in the set.
setnameThe name of the result set whose current member pointer you wish to move. If setname is omitted, the current set is used.

Comments

NEXT is a synonym for DOWN.

Example

down 10

Moves the current member pointer 10 members “down” towards the end of the set.

down 5

delete 5

Moves the current member pointer five members “down” and then deletes five members (starting with the new current member).

find Customers -> CustSet

form open fCustomer

form set accelerator F1 F2 Escape

while

 change fCustomer from CustSet

 form display input

 if Event.EventName = “escape”

  break

 else    % use $direction as a handy variable

  let $direction = {-1 where Event.EventName = “F1”, 1}

 endif

 down $direction CustSet

endwhile

Finds a set of customers and then displays the records in the set one at a time.

See Also

$currentmember

BOTTOM

DOWN

LOCATE

PREVIOUS

TOP

UP

ACCESS

Opens an application directory to use the objects contained in it.

Syntax

ACCESS dirname [READ|UPDATE]

Parameters

dirname

Specifies the name of an application directory.

READ

Specifies that you can only read object definitions in dirname, not update object definitions. If neither READ nor UPDATE is specified, READ is the default value.

UPDATE

Specifies that you can read and update object definitions in dirname.

Comments

Initializing an application database (New Database) creates a base application directory called zim. Additional application directories are defined as objects in the application database. To access any directory other than the base application directory, you must issue an ACCESS command for that directory.

Once a directory has been accessed, objects in that directory are available for use. To close a directory (and its objects) to further access, use the RELEASE command.

Use the CREATE, ERASE, RENAME, PERMISSION, ENCRYPT, DECRYPT, COMPILE, UNCOMPILE, SET SIZE, and SET SELECTIVITY commands to change object definitions only in an application directory accessed using the UPDATE option.

By accessing a directory using the READ option, you prevent unwanted modification of the directory contents. Foreign directories can be accessed using READ only.

Example

To access directory ProjectControl in read-only mode, use

access ProjectControl read

or

access ProjectControl

To access the directory Personnel in update mode, use

access Personnel Update

 

See Also

$dirpath

COMPILE

CREATE

DECRYPT

ENCRYPT

ERASE

PERMISSION

RENAME

SET SELECTIVITY

SET SIZE

UNCOMPILE

UPDATE

DOWN

Moves the current member pointer one or more members “down” in a result set.

Syntax

DOWN [num] [setname]

Parameters

numThe number of members farther “down” into setname that the current member pointer is to be moved. Num can be
an integer constant (15, 200);
a variable, form field, or parameter that evaluates to an integer;
the word ALL.
The default value for num is 1. If num is negative, DOWN num actually moves the current member pointer “up” in the set.
setnameThe name of the result set whose current member pointer you wish to move. If setname is omitted, the current set is used.

Comments

NEXT is a synonym for DOWN.

Example

down 10

Moves the current member pointer 10 members “down” towards the end of the set.

down 5

delete 5

Moves the current member pointer five members “down” and then deletes five members (starting with the new current member).

find Customers -> CustSet

form open fCustomer

form set accelerator F1 F2 Escape

while

change fCustomer from CustSet

form display input

if Event.EventName = “escape”

break

else    % use $direction as a handy variable

let $direction = {-1 where Event.EventName = “F1”, 1}

endif

down $direction CustSet

endwhile

Finds a set of customers and then displays the records in the set one at a time.

See Also

$currentmember

BOTTOM

LOCATE

NEXT

PREVIOUS

TOP

UP

en_CAEnglish