Set Specification

Set Specification

Identifies particular records in an Zim database.

Syntax

object [WHERE clause] [SORTED BY clause] [KEEP clause]

Parameters

objectThe name of an EntitySet, relationship, form, application document, or result set. Role names can be used for EntitySets or relationships. Any number of objects can be specified, provided that they are meaningful in context.

Comments

A set specification (sometimes called a setspec) is a statement that uses EntitySets, relationships, forms, application documents, and result sets as the source of the set being declared. Each object in the set specification is called a component. (Result sets can represent more than one component.)
A set specification can also include a condition that limits record selection (WHERE clause), a sorting statement (SORTED BY clause), and a component projection list that limits the number of components in the resulting set (KEEP clause).
Any number of objects can be declared. But, if you declare more than one object, then you must declare the relationships through which records in those objects are associated.
Each object can be further qualified using any valid combination of the following subcommands:
-> (Dynamic rename), COMPLETE, UNRELATED, USING
and in particular circumstances:
INTERSECT, MINUS, UNION
Set specifications are processed, in order, from left to right.

Example

list all Employees

The simplest type of set specification. The set consists of all of the records in the EntitySet Employees.

list all Employees where LastName = “Smith”

Includes a condition for record selection.

list all Employees sorted by EmpNum

Includes a sorting subcommand.

list all Employees where LastName = “Smith” sorted by EmpNum

Combines a condition and a sort.

list all Employees WorkIn Departments

The relationship that defines the association (WorkIn) must be included because two EntitySets are being declared. All associated records in Employees and Departments are included.

list all Employees WorkIn Departments keep Departments

Adds a component projection list. Of associated records in Employees WorkIn Departments, only the (unique) records from Departments are included in the set.

list all Employees (unrelated) WorkIn Departments

The subcommand UNRELATED modifies the relationship; all records in Employees that are unassociated with Departments are included.

See Also

Set Specification (ISQL)

-> (Dynamic Rename)

Dynamic Rename (->)

Overview

Dynamic renaming (->) is a feature used in command structures to rename components within a set specification. This allows for flexible manipulation of data sets, enabling components to be used in different roles across various commands.

Syntax

objname (oldcomponentname -> newcomponentname)
  • objname: The name of a set, an EntitySet, a relationship, or a role. There must be at least one component in objname.
  • oldcomponentname: The existing name of a component in objname.
  • newcomponentname: The new name to be given to the specified component of objname.

Detailed Explanation

When creating a result set, the structure of that set reflects the component names or role names found in the original set specification. If you want to use the result set in a subsequent command and have a component of the set used in a different role, dynamic renaming (->) enables you to rename the component.

Both oldcomponentname and newcomponentname must refer to the same underlying object.

Examples

Example 1: Renaming Employees to Managers

find Employees WorkFor Managers where LName = Smith 
keep Employees -> set1
find Employees WorkFor set1 (Employees -> Managers) 
keep Employees -> set1

In this example, the component Employees is dynamically renamed to Managers in the second command. This allows the Employees component to be used in the role of Managers.

Example 2: Loop Example

find Managers -> MSet
while
  find MSet (Managers -> Employees) WorkFor Managers keep Managers
  if $setcount > 0
    find -> MSet
  else
    break
  endif
endwhile
list all MSet

In this loop, each usage of the Managers component of MSet is dynamically renamed to Employees to select the top managers from an EntitySet of employees. This iterative process continues until no more managers are found.

Comments

  • Flexibility: Dynamic renaming provides flexibility in how components are used in different roles across commands. This is particularly useful in complex queries and data manipulations.
  • Consistency: Ensures that the underlying object remains consistent even when its role or name changes. This helps maintain the integrity of the data set while allowing for dynamic adjustments.

Practical Applications

Dynamic renaming can be used in various scenarios, such as:

  • Data Analysis: Renaming components to fit different analytical roles.
  • Database Management: Adjusting roles of components for efficient querying and data retrieval.
  • Software Development: Implementing dynamic role changes in algorithms and data structures.

Why Use Dynamic Renaming?

1. Flexibility in Data Manipulation

Dynamic renaming allows users to adapt the roles of components within a data set on-the-fly. This flexibility is crucial when dealing with complex data structures or when the same data needs to be viewed or analyzed from different perspectives.

2. Simplifying Complex Queries

In scenarios where multiple roles or relationships exist within a data set, dynamic renaming can simplify queries. By renaming components, users can avoid writing redundant or overly complex commands, making the code more readable and maintainable.

3. Enhanced Data Analysis

Analysts often need to pivot data to gain different insights. Dynamic renaming enables them to reassign roles to components, facilitating various analytical approaches without altering the underlying data structure.

4. Efficient Resource Management

In database management, dynamic renaming can help optimize resource usage. By reusing components in different roles, it reduces the need to create multiple copies of the same data, thereby saving storage and processing power.

5. Improved Algorithm Implementation

For software developers, dynamic renaming can be particularly useful in implementing algorithms that require role changes. It allows for more dynamic and adaptable code, which can handle a wider range of scenarios without significant modifications.

Conclusion

Dynamic renaming is a versatile tool that enhances the flexibility, efficiency, and clarity of data manipulation and analysis. It allows users to adapt to changing requirements and complex data relationships seamlessly.

Set Specification (ISQL)

Identifies particular records in an SQL database.

Syntax

Object [WHERE clause] [GROUP BY expr1] [HAVING expr2]

[ORDER BY expr3 [ASC|DESC]] [KEEP component]

Parameters

objectThe name of an EntitySet, relationship, form, structured application document, or result set. Role names can be used for EntitySets and relationships.
expr1A value expression. Specifies how the selected records are to be grouped.
expr2A logic expression. Limits the groups to be kept in the result set.
expr3A value expression. Specifies the sort keys for the result set.
ASC or DESCASC indicates sorting in ascending order (i.e., 0-9, A-Z); DESC, in descending order (i.e., 9-0, Z-A). ASC is the default.
componentOut of all the specified objects, the components to be retained in the result set.
A KEEP clause cannot be used if a GROUPED BY or HAVING clause already appears in the set specification.

Comments

An SQL set specification (sometimes called an SQLsetspec) is a statement that uses EntitySets, relationships, forms, structured application documents and result sets to identify particular records in an SQL database. Each object in the set specification is called a component. (Result sets can represent more than one component.)
SQL set specifications are used only within the SQL commands DELETE FROM, INSERT, SELECT, and UPDATE.
Any number of objects can be declared. But, if you declare more than one object, then you must declare the relationships through which records in those objects are associated.
An SQL set specification can also include a condition that limits record selection (WHERE clause), a grouping statement (GROUP BY clause), a group condition that limits group selection (HAVING clause), a sorting statement (ORDERED BY clause), and a component projection list that limits the number of components in the resulting set (KEEP clause).
The WHERE clause can also contain another SELECT statement and OUTER JOIN references using “*=” for LEFT OUTER JOIN or “=*” for RIGHT OUTER JOIN (see examples).
Each object can be further qualified using any valid combination of the following subcommands:
-> (Dynamic rename) or USING
and in particular circumstances:
INTERSECT, MINUS, UNION

Example

select * from Employees where LastName=”Smith”

The set specification includes a WHERE condition for record selection.

SELECT * FROM Employees WHERE Salary > (SELECT Salary FROM Employees WHERE JobPosition = “THE BOSS”)

SELECT Ents.EntName,Fields.OwnerName FROM Ents,Fields WHERE Ents.EntName *= Fields.Ownername

This selects all EntitySets and having or not having corresponding Fields in the same way the

COMPLETE clause does in a FIND statement.

SELECT Ents.EntName,Fields.OwnerName FROM Ents,Fields WHERE Ents.EntName *= Fields.Ownername AND

Fields.Ownername is $NULL

This selects all EntitySets not having corresponding Fields in the same way the UNRELATED

clause does in a FIND statement.

See Also

DELETE FROM

INSERT

SELECT

Set Specification

UPDATE

$InTransaction

Indicates if an explicit transaction is in progress.

Syntax

$intransaction

Return Value

“1” ($True), or “0” ($False). Can be reset by an application program.

Description

$InTransaction acts as a flag, indicating if the software is currently processing an explicit transaction.

$InTransaction is set to “1” ($True) if a TRANSACTION (or BEGIN WORK) command has started an explicit transaction. It is set to “0” ($False) when an ENDTRANSACTION or QUITTRANSACTION (or COMMIT WORK or ROLLBACK WORK) command has closed the explicit transaction in progress.

The variable is unaffected by deadlock or implicit transactions.

Example

on deadlock
   if $intransaction = $true
      goto RetryAdd
   else
      goto previous
   endif
endon
   ... other commands ...
RetryAdd:
   transaction
   ... commands in the transaction ...
   endtransaction

In the above example, when a deadlock occurs, $InTransaction determines the course of action that the exception handler takes: restart the explicit transaction (when true) or retry the command that caused the deadlock (when false).

procedure UpdateCode (NewCode) local (DoEndTrans)
   if $intransaction = $false
      transaction
      let DoEndTrans = $true
   endif
   ... other commands ...
   if DoEndTrans = $true
      endtransaction
   endif
endprocedure

In the above example, $InTransaction starts an explicit transaction if one is not already in progress.

See Also

BEGIN WORK

COMMIT WORK

GOTO

GOTO NEXT

GOTO PREVIOUS

ON

QUITTRANSACTION

ROLLBACK WORK

System Variables

ThisMenu

ThisMenu

A data structure that provides information about the state of the system and of the current menu at the time of the last event in that menu.

The ThisMenu data structure provides information about the state of the system and of the current menu at the time of the last event in the current window.

The ThisMenu structure contains a number of fields that are reset when the current window changes. An application program can use the information in the fields to determine what action, if any, to take.

The fields in the ThisMenu structure are:

MenuChanged, MenuItemNum, MenuItemTag, MenuNum, MenuTag

Syntax #1 – MenuChanged

Indicates if any menu item in the current menu had been modified by the application user at the time of the last

thismenu.menuchanged

Return Value

“1” ($True), or “0” ($False). Can be reset by an application program.

Description

Set to “1” ($True) if the value of any menu item in the current menu changed after the application user was placed in control of the interface. Otherwise, set to “0” ($False).

Syntax #2 – MenuItemNum

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

thsimenu.menuitemnum

Return Value

A number. Can be reset by an application program.

Description

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

The combination of ThisMenu.MenuItemNum and ThisMenu.MenuNum can uniquely identify a particular menu selection.

Syntax #3 – MenuItemTag

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

thismenu.menuitemtag

Return Value

A character string. Can be reset by an application program.

Description

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

Syntax #4 – MenuNum

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

thismenu.menunum

Return Value

A number. Can be reset by an application program.

Description

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

The combination of ThisMenu.MenuItemNum and ThisMenu.MenuNum uniquely identify a particular menu selection.

Syntax #5 – MenuTag

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

thismenu.menutag

Return Value

A character string. Can be reset by an application program.

Description

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

See Also

FORM INPUT

FORM SET

MENU INPUT

MENU SET

SCREEN CLEAR

SCREEN RESET

ThisForm

ThisWindow

WINDOW CLOSE

WINDOW OPEN

WINDOW SET

WINDOW SET CURRENT

ThisForm

A data structure that provides information about the state of the current form at the time of the last event in the current window.

The ThisForm data structure provides information about the state of the current form at the time of the last event in the current window.

The ThisForm structure contains a number of fields that are reset when a window containing a form or display becomes the current window. An application program can use the information in the fields to determine what action, if any, to take.

The fields in the ThisForm structure are

  • DisplayTag
  • FFFieldNum
  • FieldChanged
  • FieldTag
  • FormChanged
  • FormNum
  • FormTag
  • ReqError
  • ReqFieldNum
  • ReqFormNum
  • ReqSubscript
  • ReqTag
  • Subscript
  • ValError
  • ValFieldNum
  • ValFormNum
  • ValSubscript
  • ValTag

Syntax # 1 – DisplayTag

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

thisform.displaytag

Return Value

Character string identification tag of the current display. Can be reset by an application program.

Description

Identifies, by identification tag, the display that had focus at the time of the last event in the current window.

Syntax # 2 – FieldChanged

A code indicating 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.fieldchanged

Return Value

“1” ($True), or “0” ($False). Can be reset by an application program.

Description

Set to “1” ($True) if the value of the field that had focus changed after the application user was placed in control of the interface. Otherwise, set to “0” ($False).

Syntax # 3 – FFFieldNum

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

thisform.fffieldnum

Return Value

A number. Can be reset by an application program.

Description

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

The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular form field in a particular form.

Example

form set (cursor) (ThisForm.formnum,ThisForm.fffieldnum,ThisForm.subscript)

Syntax # 4 – FieldTag

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

thisform.fieldtag

Return Value

A character string. Can be reset by an application program.

Description

The identification tag of the focus form field at the time of the last event in the current window.

The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular form field in a particular form.

Syntax # 5 – 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.formchanged

Return Value

“1” ($True), or “0” ($False). Can be reset by an application program.

Description

Set to “1” ($True) if the value of any field in the current form or display changed after the application user was placed in control of the interface. Otherwise, set to “0” ($False).

Syntax # 6 – FormNum

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

thisform.formnum

Return Value

A number. Can be reset by an application program.

Description

The identification number of the current form at the time of the last event in the current window.

The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular field in a particular form.

Example

form set (cursor) (ThisForm.formnum,ThisForm.fffieldnum,ThisForm.subscript)

Syntax # 7 – FormTag

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

thisform.formtag

Return Value

A character string. Can be reset by an application program.

Description

The identification tag of the current form at the time of the last event in the current window.

The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular field in a particular form.

Syntax # 8 – ReqError, ReqFieldNum, ReqFormNum, ReqSubscript, ReqTag

thisform.reqerror

thisform.reqfieldnum

thisform.reqformnum

thisform.reqsubscript

thisform.reqtag

Return Value

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

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

Number (INT). Can be reset by an application program. (ReqFieldNum, ReqFormNum, ReqSubscript)

Description

The variables indicate if all required form fields had values at the time of the last event in the current window.

ThisForm.ReqError is set to ‘1’ ($True) if any required form field in the current form or display has not been completed when an event occurs. Otherwise, it is set to ‘0’ ($False).

If ThisForm.ReqError is ‘1’, then the other variables are set to the form number (ThisForm.ReqFormNum), form field number (ThisForm.ReqFieldNum), subscript (ThisForm.ReqSubScript), and tag (ThisForm.ReqTag) of a required form field that has no value.

Example

while

 form input

  ...commands...

  if ThisForm.reqerror = $true

   form set (focus) (ThisForm.reqformnum,ThisForm.reqfieldnum,ThisForm.reqsubscript)

  continue

 endif

endwhile

If “required” fields in the current form have not been completed, focus is set to one of those fields on the next input request.

Syntax # 9 – Subscript

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

thisform.subscript

Value

A number. Can be reset by an application program.

Description

Identifies, by number, the instance of the form where focus was located at the time of the last event in the current window (when several instances of the form appear in a display). If the form appears only once, ThisForm.Subscript is always 1.

For example, if a form is repeated eight times in a display, ThisForm.Subscript might be set to any number from 1 to 8. The particular number indicates in which repetition of the form the focus was located.

The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular field in a particular form.

Example

form set (cursor) (ThisForm.formnum,ThisForm.fffieldnum,ThisForm.subscript)
find Products where ProdCode = fProducts.ProdCode[ThisForm.subscript]

Syntax # 10 – ValError, ValFieldNum, ValFormNum, ValSubscript, ValTag

thisform.valerror

thisform.valfieldnum

thisform.valformnum

thisform.valsubscript

thisform.valtag

Value

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

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

Number (INT). Can be reset by an application program. (ValFieldNum, ValFormNum, ValSubscript)

Description

The variables indicate if all form fields had valid values at the time of the last event in the current window.

ThisForm.ValEror is set to ‘1’ ($True) if any form field in the current form or display contains an invalid value when an event occurs. Otherwise, it is set to ‘0’ ($False).

If ThisForm.ValError is ‘1’, then the other variables are set to the form number (ThisForm.ValFormNum), form field number (ThisForm.ValFieldNum), subscript (ThisForm.ValSubscript), and tag (ThisForm.ValTag) of a form field that has an invalid value.

Example

while

 form input

 ...commands...

 if ThisForm.valerror = $true

  form set (cursor) (ThisForm.valformnum,ThisForm.valfieldnum,ThisForm.valsubscript)

  continue

 endif

endwhile

If fields in the current form failed the validation check, focus is set to one of those fields on the next input request.

See Also

DISPLAY DEFINE

Event

FORM INPUT

MENU INPUT

MENU SET

SCREEN CLEAR

SCREEN RESET

ThisMenu

WINDOW CLOSE

WINDOW OPEN

WINDOW SET

WINDOW SET CURRENT

ThisWindow

ThisWindow

A data structure that provides information about the state of the system and of the current window at the time of the last event in that window.

The ThisWindow data structure provides information about the state of the system and of the current window at the time of the last event in that window.

The ThisWindow structure contains a number of fields that are reset when the current window changes. By trapping these values, the application enables the user to change the current window and later return to pick up where things were left.

If the current window is non-modal, note that the last event in the window is not necessarily the last event in the interface overall.

The fields in the ThisWindow structure are

AltKey, CtrlKey, ShiftKey, EventName, EventTag, EventType, KeyPressed, MouseClick, ScrollingKey, WindowCol, WindowHeight, WindowName, WindowNum, WindowRow, WindowState, WindowTag, WindowWidth

Syntax #1 – AltKey, CtrlKey, ShiftKey

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

thiswindow.altkey

thiswindow.ctrlkey

thiswindow.shiftkey

Return Value

“1” ($True), or “0” ($False), character string (binary). Can be reset by an application program.

Description

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

Each variable is set to ‘1’ ($True) if the corresponding key was down when the last event in the current window occurred. Otherwise, each is set to ‘0’ ($False).

Syntax #2 – EventName

Identifies the last event that occurred in the current window.

thiswindow.eventname

One of

Break, Canceled, Click, Closed, DoubleClick, GotFocus, HangUp, LostFocus, LostFocusModified, Modified, PanicExit, Timeout, WindowFocusSwitch, or keyname

Cannot be reset by an application program.

Return Value

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

Description

Identifies, by name, the last event to occur in the current window.

This variable is not set in all operating environments.

ThisWindow.EventType gives additional information about the type of event, and ThisWindow.EventTag gives additional information about the type of object involved in the event.

Syntax #3 – EventTag

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

thiswindow.eventtag

Return Value

The identification tag of the object in which the last event in the current window occurred. Can be reset by an application program.

Description

Identifies the object in which the last event in the current window occurred.

The identification tag selected varies with the type of object involved in the event.

ThisWindow.EventName names the event, and ThisWindow.EventType gives additional information about the type of event.

Can be, depending on the type of object involved

EventType TypeSource for EventTag Value
WindowEvent.WindowTag
MenuEvent.MenuTag
MenuitemEvent.MenuItemTag
FormEvent.FormTag
FormfieldEvent.FieldTag
AcceleratorEvent.FieldTag
SystemEvent.FieldTag

Syntax #4 – EventType

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

thiswindow.eventtype

One of

Window, Menu, MenuItem, Form, FormField, Accelerator, System

Return Value

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

Description

Identifies the type of event that last occurred in the current window. ThisWindow.EventName names the event, and ThisWindow.EventTag identifies the object in which the event occurred.

Syntax #5 – KeyPressed

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

thiswindow.keypressed

Return Value

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

Description

The name of the key that, pressed by the application user, caused the last event to occur in the current window. Can be reset by an application program.

For example, if the application user presses the a key in a form field and the Modified event is intercepted by the application program, then ThisWindow.KeyPressed is set to “a”.

Note: The name of the key that caused an accelerator event is recorded in the ThisWindow.EventName variable.

Syntax #6 – MouseClick

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

thiswindow.mouseclick

Return Value

“1” ($True), or “0” ($False). Can be reset by an application program.

Description

Set to “1” ($True) if the last event to occur in the current window was caused by the press of a mouse button that is defined as an accelerator for the window. Otherwise, set to “0” ($False).

If SET MOUSE is OFF, ThisWindow.MouseClick is 0.

Syntax #7 – ScrollingKey

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

thiswindow.scrollingkey

Return Value

“1” ($True), or “0” ($False). Can be reset by an application program.

Description

Set to “1” ($True) if the accelerator key that caused the last event in the current window was also a defined SCROLL key. Otherwise, set to “0” ($False).

Example

window set scroll Up up Down down
window set accelerator up down escape
form open fEmployee
form set scroll fEmployee from EmpSet
form display
while
if thiswindow.scrollingkey = $true
change EmpSet from fEmployee
form scroll
continue
endif
… other commands …
endwhile

In the preceding code fragment, employee records are scrolled through a form and the application user can update the data. ThisWindow.ScrollingKey detects if a scrolling key was pressed, enabling the scrolling action to be performed under program control after any changes to the data are saved.

Syntax #8 – ScrollingKey

thiswindow.scrollingkey

Return Value

Character string (binary). Can be reset by an applicatio
n program.

Description

The variable indicates if the accelerator that cased the event that last occurred was also a defined SCROLL key.

ThisWindow.ScrollingKey is set to ‘1’ ($True) if the accelerator that caused the last event in the current window was also a defined SCROLL key. Otherwise, it is set to ‘0’ ($False).

Syntax #9 – WindowCol, WindowRow

The character column or row position of the current window.

thiswindow.windowcol

thiswindow.windowrow

Return Value

A number. Cannot be reset by an application program.

Description

The variables indicate the physical size of the current window in character rows (WindowHeight) and character columns (WindowWidth).

The physical dimensions of a window determine the visible space inside the window (i.e., the client area). This area changes in size when the dimensions of the window change. An application user can change the size of a window by using the resize feature. A program can change the size of a window using the WINDOW SIZE command.

An application program can position a window using the WINDOW MOVE command.

Syntax #10 – WindowHeight, WindowWidth

The physical height or width of the current window in character rows.

thiswindow.windowheight

thiswindow.windowwidth

Return Value

Number (INT). Cannot be reset by an application program.

Description

The variables indicate the physical size of the current window in character rows (WindowHeight) and character columns (WindowWidth).

The physical dimensions of a window determine the visible space inside the window (i.e., the client area). This area changes in size when the dimensions of the window change. An application user can change the size of a window by using the resize feature. A program can change the size of a window using the WINDOW SIZE command.

Syntax #11 – WindowName

The name of the current window.

thiswindow.windowname

Return Value

A character string. Can be reset by an application program.

Description

The variable identifies, by name, the current window.

Example

You can use ThisWindow.WindowName to restore the focus to a window, making it the current window:

let SaveWin = ThisWindow.WindowName
window open Window2
… other commands …
window set current SaveWin

Syntax #12 – WindowNum

The identification number of the current window.

thiswindow.windownum

Return Value

A number. Can be reset by an application program.

Description

The variable identifies, by identification number, the current window.

Syntax #13 – WindowTag

thiswindow.windownum

Return Value

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

Description

The variable identifies, by identification tag, the current window.

Syntax #13 – WindowState

Indicates whether the current window is maximized, minimized, or otherwise.

thiswindow.windownum

Return Value

A number. Cannot be reset by an application program.

Description

Indicates the state of the current window at the time of the last event in that window.

ValueMeaning
-1The current window is minimized.
0The current window is neither minimized nor maximized.
1The current window is maximized.

See Also

FORM INPUT

FORM SET

MENU INPUT

MENU SET

SCREEN CLEAR

SCREEN RESET

ThisForm

WINDOW SET

[NOT] BETWEEN

Compares one value to a specified range of values.

Syntax

expression [NOT] BETWEEN expr1 AND expr2

Parameters

expressionAn expression that evaluates to either a number or a character string.
expr1An expression that evaluates to either a number or a character string.
expr2An expression that evaluates to either a number or a character string.

Return Value

Logical

Comments

If any one of expression, expr1, and expr2 is a number, then a numeric comparison is made; otherwise, the comparison is character-based. Note that the AND in a BETWEEN comparison is not the Boolean AND.

A BETWEEN comparison is logically true if expression is greater than or equal to expr1, and less than or equal to expr2.

A NOT BETWEEN comparison is logically true if expression is either less than expr1, or greater than expr2.

Note: The AND in a BETWEEN comparison is not the Boolean AND.

Example

BioDiversity between 500 and 2000

Logically true if the value of BioDiversity lies between 500 and 2000 (inclusive).

See Also

About Conditional Expressions

( ) Parentheses

Alters the order of evaluation of expressions, or groups expressions, or both.

Syntax #1

Alters the order of evaluation in expressions.

(expression)

Within a larger expression, a single expression placed in parentheses changes the order of execution (which normally depends on the precedence of operators).

Parameters

expressionan arithmetic or logic expression

Syntax #2

Groups expressions.

(expression1, expression2)

Parentheses can be used to group several expressions, each of which is evaluated; the grouped expression takes on the value of the last individual expression in the group.

Parameters

expression1any expression
expression2any expression

Comments

Use parentheses to group one or more expressions, each of which is evaluated. The grouped expression takes on the value of the last expression in the group.

Examples

7 * 8 - 5^2
31
7 * (8 - 5)^2
63
not Salary > 30000 or Age < 25

Result: Logically true when Salary is 29,000 and Age is 21.

not (Salary > 30000 or Age < 25)

Result: Logically false when Salary is 29,000 and Age is 21.

w = ( (let x = 5+3), (let y = 5-3), (let z = 5^3), 5.0/3.0 )

Values: x=8, y=2, z=75, w=1.7

See Also

Conventions

How To Construct Logic Expressions

How To Use Logic Expressions

OR

Performs a Boolean OR of two logic expressions.

Syntax

expression1 OR expression2

Parameters

expression1A logic expression using conditional and Boolean operators. If the expression is complex, it must be enclosed in parentheses.
expression2A logic expression using conditional and Boolean operators. If the expression is complex, it must be enclosed in parentheses.

Return Value

Logical, as follows:

Truth Table for Boolean ORExpression1
TrueFalse
Expression2TrueTrueTrue
FalseFalseFalse

Example

The following expression is logically false only if Salary is 30,000 and Bonus is 0. In all other cases, the expression is logically true.

Salary <> 30000 or Bonus <> 0

See Also

About Boolean Expressions

About Conditional Expressions

en_CAEnglish