FORM OPEN

Opens a form or display in the current window.

Syntax

FORM OPEN [object][ NOCLEAR][ NOGUIUSE]

Parameters

objectname: The name of the form or display to be opened.

(expr): A character string, or an expression that evaluates to a character string, to be used at run time as the name of the form or display.
Using (expr) enables one FORM OPEN command to specify different forms or displays, at the risk of encountering an ambiguous name.

FORM OPEN (expr) cannot be used to open forms defined in a foreign directory.

NOCLEARThe values currently assigned to the constituent form fields are to be retained.
If omitted, each form field value is reset to its default.
NOGUIUSEThe current form or display is opened for internal use only and is never displayed.
It is intended for the performance improvement whenever forms are used as arrays in memory.
Any attempt to display these objects will be ignored.
Other operations are accepted as usual.

Comments

The FORM OPEN command initializes a form or display for use.
The form or display is displayed using the FORM DISPLAY command, and input is requested using the FORM INPUT command.

The form or display specified in a FORM OPEN command remains the current form in its window until a FORM OPEN, FORM CLOSE, or WINDOW CLOSE command is executed.
Each window has its own current form.

When a FORM OPEN command is executed, all ,em>form field attributes are reset to their defined values.
An exception is the field’s value, which is not reset if the NOCLEAR option is used.

The FORM OPEN command also establishes a form for use as an in-memory EntitySet.
When treated as an EntitySet, a standalone form has only one record.
The forms in a display have as many records as there are instances of a particular form in the display.

Examples

form open dAddEmps

Opens a display and resets all constituent form fields to their default values.

form open fAddEmps
form display input
form close
:
form open fAddDepts
form display
close
:
form open fAddEmps noclear
form display

Opens a form and resets its field values, then displays the form and requests user input. Next, a second form is opened and displayed.
Finally, the first form is opened again, and the field values input earlier are re-displayed (because the NOCLEAR option was specified).

form open ($ concat(" fContracts", ContractType))

Opens a certain form dynamically by type.

See Also

FORM CLEAR

FORM CLOSE

FORM SET

WINDOW SET

Syntax

WINDOW SET (<option>) [window]

Modifies the individual attributes of opened windows.

Example

WINDOW OPEN <name>
WINDOW SET (label "Whatever Title you want to use")

Parameters

optionOptions that affect certain window attributes. Can be
[UN]AVAILABLE
BORDER color
[NOT] CLOSED
FILLCOLOR color
FONT expr
[NOT] FUNCTIONKEYS
[NOT] GOTFOCUS
LABEL expr
MOUSEPOINTER fileName
[NOT] LOSTFOCUS
[NOT] MESSAGES
[NOT] MODAL
PENCOLOR color
POINTSIZE expr
STATUSBARTEXT statusBarText
TABORDER BY setting

window

Window can be
name
The name of the window that you want to open. The software looks up name in the currently accessed directories in the usual way. A compiled WINDOW OPEN command using name contains the unambiguous name of the window (including a reference to an application directory) that was found at compile time.
(expr )
A character string, or an expression that evaluates to a character string, that is to be used at run time as the name of the window. The parentheses must be entered.
If neither name nor expr is specified, the current window is assumed.
OptionDescription
[UN]AVAILABLEIndicates if the application user can initiate a focus shift to the window.
BORDER colorSets the border color.
[NOT] CLOSEDIndicates if the specified event causes a callback.
FILLCOLOR colorSets the background color.
FONT exprSets the font.
FUNCTIONKEYS ON | OFFControls pre-defined accelerator keys.
[NOT] GOTFOCUSIndicates if the specified event causes a callback.
LABEL exprEstablishes the window’s label.
[NOT] LOSTFOCUSIndicates if the specified event causes a callback.
MESSAGES ON | OFFControls the display of help and error messages.
[NOT] MODALControls if the window is a modal window.
PENCOLOR colorSets the foreground color.
POINTSIZE exprSets the point size of the font.
TABORDER BY settingSpecifies how focus moves in the window. Can be TABINDEX (based on the form field’s sequence number), FIELDNUM (based on field identification number), ROWCOL (left to right), or COLROW (top to bottom).

Comments

The attributes changed are only applicable to an opened window. After the window is closed, all attributes set are lost. Opening subsequent windows will not inherit attributes set to previous windows.

If there is no opened window, the attribute settings are ignored.

The WINDOW SET command changes certain window attributes whose default states are defined in the Object Dictionary.

See Also

The Status Bar

FORM SET

Dynamically Modifying Form Attributes

Syntax #1: Changing Attributes of Open Forms or Fields

Command: FORM SET («option») «object»

Parameters:

  • option:
    • [NOT] ABBREVIATE, [NOT] AUTOCLEAR, [NOT] AUTOSKIP, [UN] AVAILABLE, [NOT] BOLD, [NOT] CLICK, [NOT] DOUBLECLICK, EVENT eventName, FILLCOLOR color, FONT fontname, [NOT] GOTFOCUS, GUARDED, [NOT] IMMEDIATELY REQUIRED, [IN]VISIBLE, [NOT] ITALIC, LABEL label, [NOT] LOSTFOCUS, [NOT] LOSTFOCUSMODIFIED, [NOT] MODIFIED, MOUSEPOINTER fileName, NORMAL, PENCOLOR color, POINTSIZE n, PROTECTED, [NOT] REQUIRED, RESET, [NOT] REVERSE, [NOT] RIGHTCLICK, [NOT] SCROLL, SCROLL LINE n, SCROLL MAX n, SCROLL MIN n, SCROLL PAGE n, [NOT] STRIKEOUT, [NOT] SUPPRESS, [NOT] VALIDATE, VERB verbName, VISIBLE, [NOT] UNDERLINE
    • Except for NORMAL and RESET, each option affects only one attribute.
  • object:
    • form: Name of an open form or display in the current window. Specify a particular instance by appending the instance number in brackets.
    • formfield: Name of a form field. Specify a particular instance by appending the instance number in brackets.
    • ([exp1], [exp2], [exp3]): Positive integers or expressions evaluating to positive integers, identifying a particular form or form field. exp1 identifies the form number; exp2, the field number; exp3, the instance of the form or form field.

Syntax #2: Applying Attributes to Form Fields with Focus

Command: FORM SET («option») CURSOR

Parameters:

  • option:
    • [NOT] BOLD, FILLCOLOR color, [IN]VISIBLE, [NOT] ITALIC, NORMAL, PENCOLOR color, [NOT] REVERSE, [NOT] STRIKEOUT, [NOT] SUPPRESS, [NOT] UNDERLINE
    • Except for NORMAL, each option affects only one attribute.
  • CURSOR: Options are dynamically added to a form field when it gains focus and restored to the previous appearance when it loses focus.

Comments

  • NORMAL: Sets objects to an unsuppressed, visible, and non-reversed condition.
  • RESET: Resets objects to their initial state when the forms were opened.
  • Scrollbars:
    • MIN and MAX values define the range of acceptable values.
    • LINE represents the amount of space the thumb “jumps” when arrows are clicked.
    • PAGE represents the size of the thumb, usually a percentage of one “line”.

Example Commands

  • Setting attributes of fields:
  form set (reset) fAddEmp.EmpNum
  form set (italic lostfocus) fAddEmp.EmpNum
  form set (not lostfocus) fAddEmp.EmpNum
  form set (lostfocus) fAddEmp.EmpNum
  form set (bold) cursor  % displays the focus field in bold font
  • Setting attributes of forms:
  form set (reset) fAddEmp[3]
  form set (italic) (2,,3)
  form set (not scroll not required lostfocus) fEmps
  • Setting scrollbar attributes:
  form set (scroll page 8) fFileDir.UpDnBar
  form set (scroll max 50) fFileDir.LfRtBar

See Also

  • FORM SET SCROLL

WINDOW SCROLL

Scrolls an open window horizontally or vertically under application program control.

Syntax

WINDOW SCROLL [window] action

Parameters

windowWindow can be
name
The name of the window that you want to open. The software looks up name in the currently accessed directories in the usual way. A compiled WINDOW OPEN command using name contains the unambiguous name of the window (including a reference to an application directory) that was found at compile time.
(expr )
A character string, or an expression that evaluates to a character string, that is to be used at run time as the name of the window. The parentheses must be entered.
A compiled WINDOW OPEN command using (expr) can refer to many windows, at the risk of encountering an ambiguous window name (i.e., no directory specified when versions of the window are available in two or more directories).
WINDOW OPEN cannot be used to open a window defined in a foreign directory.
actionCan be
TO row col
UP n | DOWN n
LEFT n | RIGHT n
PAGEUP | PAGEDOWN
JUMPUP | JUMPDOWN
JUMPLEFT | JUMPRIGHT
HOME | END
In TO row col, row and col are integers or expressions that evaluate to integers. Complex expressions must be enclosed in parentheses. Row identifies the character row at which the top of the client area is to be positioned; col identifies the character column at which the left side of the client area is to be positioned. Valid values are 1 through the maximum number of rows or columns in the current window’s presentation space. A value of -1 for row or col indicates that no scrolling is to occur.
SCROLLING ACTIONSCROLL DIRECTION AND MAGNITUDE
UP nIn UP n, n is a number or an expression that evaluates to an number. Scrolls the window n rows up over its presentation space.
DOWN nIn DOWN n, n is a number or an expression that evaluates to an number. Scrolls the window n rows down over its presentation space.
LEFT nIn LEFT n, n is a number or an expression that evaluates to an number. Scrolls the window n columns left over its presentation space.
RIGHT nIn RIGHT n, n is a number or an expression that evaluates to an number. Scrolls the window n columns right over its presentation space.
PAGEUPPAGEUP scrolls the window one client-area-height up over its presentation space.
PAGEDOWNPAGEDOWN scrolls the window one client-area-height down over its presentation space.
PAGELEFTPAGELEFT scrolls left the current width of the client area.
PAGERIGHTPAGERIGHT scrolls right the current width of the client area.
JUMPUPJUMPUP scrolls the window one half a client-area-height up over its presentation space.
JUMPDOWNJUMPDOWN scrolls the window one half a client-area-height down over its presentation space.
JUMPLEFTJUMPLEFT scrolls the window one half a client-area-width left over its presentation space.
JUMPRIGHTJUMPRIGHT scrolls the window one half a client-area-width right over its presentation space.
HOMEHOME matches the top, left-hand corner of the client area to the top, left-hand corner of the presentation space.
ENDEND matches the bottom, right-hand corner of the client area to the bottom, right-hand corner of the presentation space.

Note: In all cases, n is a number, or an expression that evaluates to a number, indicating the number of character rows or character columns to scroll in the specified direction.

Comments

Under program control, the WINDOW SCROLL command scrolls the client area of the current window over its presentation space to enable the application user to see a part of the window contents that was not visible. The scrolling action occurs just as if the application user had initiated the same action.

See Also

ThisWindow

WINDOW ACTIVATE

WINDOW DISPLAY

WINDOW MOVE

WINDOW OPEN

WINDOW SET

WINDOW SIZE

FORM SET DYNAMICLIST

Dynamic Multi-Column List Box: Elevate Your Data Presentation

What is it?

Our Dynamic Multi-Column List Box is a versatile tool designed to display large datasets in a clean, organized, and interactive manner. Perfect for web applications that require efficient data handling and presentation.

Key Features

  1. Dynamic Data Loading: Fetches data on demand from your database, ensuring that the information displayed is always current and accurate.
  2. Multi-Column Support: Display multiple columns of data, each with customizable headings and content.
  3. User-Friendly Formatting:
    • Text Fields: Left-justified for easy reading.
    • Numeric Fields: Centered for a balanced look.
    • Column Headings: Always left-justified for consistency.
  4. Adjustable Column Widths: Easily modify column widths to fit your data perfectly using the $tocharacter(<fieldname>, length) function.
  5. Interactive Scrolling: Supports both horizontal and vertical scrolling, allowing users to navigate through large datasets effortlessly.

Technical Implementation

Syntax:

FORM SET DYNAMICLIST <formfield> FROM <setname>
FORMAT <expression1> [HEADING <expression2>]
[<expression1_n> [HEADING <expression2_n>]]

Parameters:

  • formfield: The form field in your web application, set up as a dynamic multi-column list box.
  • expression1: The content for the first column.
  • expression2: The heading for the first column.
  • expression1_n: The content for the nth column.
  • expression2_n: The heading for the nth column.

Example Use Case

Imagine you want to display a list of customers with their first and last names in a form called myform that includes a dynamic list box named dynalist. Here’s how you can set it up:

find all customers -> custset

form set dynamiclist myform.dynalist from custset format firstname lastname heading "SurName"

This setup will dynamically load and display the first and last names of all customers, with “SurName” as the heading for the last name column.

Why Choose Our Dynamic Multi-Column List Box?

  • Efficiency: Handles large datasets without compromising performance.
  • Flexibility: Customizable to fit your specific data presentation needs.
  • User Experience: Enhances user interaction with smooth scrolling and adjustable columns.

Upgrade your data presentation with our Dynamic Multi-Column List Box and provide your users with a seamless and interactive experience.

CHANGE

FORM DISPLAY

FORM INPUT

LET

WINDOW OPEN

Opens a window for use in subsequent window-handling commands.

Syntax

WINDOW OPEN [window] [AT position] [SIZE winsize] [FOR form] [IN parent]

Parameters

windowWindow can be:
name

The name of the window that you want to open. Zim looks up the name in the currently accessed directories in the usual way. A compiled WINDOW OPEN command using name contains the unambiguous name of the window (including a reference to an application directory) that was found at compile time.
(expr)

A character string or an expression that evaluates to a character string that is to be used at run time as the name of the window. The parentheses must be entered. A compiled WINDOW OPEN command using (expr) can refer to many windows, at the risk of encountering an ambiguous window name (i.e., no directory specified when versions of the window are available in two or more directories).
WINDOW OPEN cannot be used to open a window defined in a foreign directory.
positionPosition can be:
row col

Numbers or expressions that evaluate to numbers. Complex expressions must be enclosed in parentheses.
Specify the location of the window by explicitly setting the row and column in pixels for the upper left-hand corner of the window.
position

Specifies the position of the window by giving a general placement instruction. Can be TOP, TOP LEFT, TOP RIGHT, CENTER, LEFT, RIGHT, BOTTOM, BOTTOM LEFT, or BOTTOM RIGHT.
For pop-up windows, the specified location is relative to the screen. For clipped windows, the location is relative to the client area of the parent window.
winsizeSize can be:
height width

Numbers, or expressions that evaluate to numbers. Height identifies the height, in pixels, of the window’s client area; width identifies the width, in pixels, of the window’s client area.
MAXIMIZE

Opens a clipped window so that it fills the client area of parentwin, or a pop-up window so that it fills the screen.
MINIMIZE

Opens a clipped window so that it appears as an icon near the bottom, left-hand corner of parentwin, or a pop-up window so that it appears as an icon near the bottom left-hand corner of the screen.
formForm is the name of a form or display on which the logical dimensions of the window are based. Can be:
formname

Where formname is a form (or display) object name. The software looks up formname in the currently accessed directories in the usual way. A compiled WINDOW OPEN command using formname contains the unambiguous name of the form (including a reference to an application directory) that was found at compile time.
(expr)

A character string, or an expression that evaluates to a character string, that is to be used at run time as a form object name. The parentheses must be entered.
The name of the form is determined at run time. A compiled WINDOW OPEN command using (expr) can refer to many forms, at the risk of encountering an ambiguous form name (i.e., no directory specified when versions of the form are available in two or more directories).
The FOR clause overrides the default logical dimensions of the window object.
parentParent is the name of an open window that is to be the parent of the window being opened. The child window must have the attribute Clipped To Parent set. Can be:
name

The name of the parent window. The software looks up name in the currently accessed directories in the usual way. A compiled WINDOW OPEN command using name contains the unambiguous name of the window (including a reference to an application directory) that was found at compile time.
(expr)

A character string, or an expression that evaluates to a character string, that is to be used at run time as the name of the parent window. The parentheses must be entered.
A compiled WINDOW OPEN command using (expr) can refer to many windows, at the risk of encountering an ambiguous window name (i.e., no directory specified when versions of the window are available in two or more directories).

Comments

WINDOW OPEN opens the specified window and establishes its initial position and its physical and logical dimensions.

The window being OPENed becomes the current window, but it does not automatically appear on the screen. To appear on the screen, the window must be activated either explicitly by a WINDOW ACTIVATE command, or implicitly by an input request (e.g., FORM INPUT, INPUT, MENU INPUT).

WINDOW OPEN makes the window available for output. Forms can be open and displayed in the window, and output from commands such as REPORT FROM, LIST, OUTPUT, and so on, can be sent to the window. The output appears only when the window is activated.

If the AT clause is omitted, the window appears at the position defined for it in the Object Dictionary.

A window’s position is always relative to its physical parent. The physical parent of a clipped window is another window (parentwin). The physical parent of a pop-up window is the terminal.

If the arguments to the AT clause are such that the window opens out of bounds, the position is adjusted automatically so that the window remains entirely within the parent’s boundaries.

If the SIZE clause is omitted, the dimensions of the window’s client area are determined from the window’s definition in the Object Dictionary.

If either dimension in a SIZE clause is negative, the window is sized to maximize the associated dimension within parentwin with respect to the specified row and col position.

If the FOR clause is omitted, the logical dimensions of the window are determined from the window’s definition in the Object Dictionary.

If the IN clause is omitted, the newly opened window automatically becomes a “child” of the application window (BACKSCREEN).

The IN clause tells Zim to clip the window being opened to the parent, provided that the child window has the Clipped to Parent attribute set. Otherwise, the child window will be opened as usual.

WINDOW OPEN [re]sets the fields of the ThisWindow system variable.

See Also

$iswinopen

ThisWindow

WINDOW ACTIVATE

WINDOW CLEAR

WINDOW CLOSE

WINDOW DEACTIVATE

WINDOW DISPLAY

WINDOW SCROLL

WINDOW SET

WINDOW SIZE

DETAIL LINE

Specifies the fields that are selected for a report

Syntax

DETAIL LINE [colheadings] [GRAPHIC [TEMPLATE name]] reportitem [:format:] [WHERE clause]

Parameters

colheadingsCan be
COLUMN HEADING OFF
Specifies that column break headings are not to be re-displayed at the top of each report page.
LEVEL n [WIDTH n ]
LEVEL 0 causes level 0 column break headings to be printed at the top of each report page. This is the default break level.
LEVEL n causes column break headings to be printed for each break level n or higher in the hierarchy (n must be an integer greater than or equal to 0).
WIDTH n sets the width (in characters) of the space allotted to the column break heading.
TEMPLATE nameFor graphical reports, the name of an optional template to define the layout of the report.
reportitemAny value expression. If the expression is complex, it must be enclosed in parentheses.
formatA set of instructions defining the format for the associated reportitem. Format is enclosed in : (colons) and can consist of any valid combination of format options.

Comments

The DETAIL LINE command is executed for every record of the set specified in the REPORT FROM command.

The column headings for all reportitems specified in the DETAIL LINE command are displayed, subject to any colheadings specification.

Only one detail line is produced for each record of the report set. If more than one DETAIL LINE command is used in a report specification, the DETAIL LINE command that is executed for a particular record in the report set is the first DETAIL LINE without a WHERE clause, or the first DETAIL LINE whose WHERE clause is true for that record.

For more information on format, see Available Format Options.

See Also

Boolean Expressions

Conditional Expressions

BREAK (Reports)

COLUMN BREAK

How to Use The Report Generator

How To Use Value Expressions

CASE

Enables conditional execution of commands.

Syntax

CASE

WHEN expression

commands1

[OTHERWISE

commands2]

ENDCASE

Parameters

expressionA logical expression (using conditional or Boolean operators).
commands1Commands that are executed if expression is logically true.
commands2Commands that are executed if expression is logically false.

Comments

A CASE command must always have a corresponding ENDCASE. Any number of WHEN clauses can appear between CASE and ENDCASE.

The WHEN phrases between CASE and ENDCASE are evaluated in order. Execution control transfers to the commands associated with the first WHEN clause whose expression is determined to be logically true. If none of the WHEN phrases contain an expression that evaluates to “true”, the commands associated with OTHERWISE (if used) are executed. Execution then resumes at the first command following ENDCASE.

If a WHEN expression includes fields from the current set, then the expression uses the values found in the current member of the current set.

If a BYE, RETURN, STOP, or TRANSFORM command exits a procedure in the middle of a CASE structure, the “open” CASE command is automatically closed. Also, if the end of the current procedure is reached before a necessary ENDCASE is encountered, the “open” CASE command is closed.

If the ENDCASE is missing, all subsequent commands in the current procedure are treated as part of the CASE structure.

Example

If the value for salary is neither less than 20,000, nor between 20,00 and 30,000, the first and second set of commands are skipped, and the third set of commands executed.

case

when salary < 20000

… first set of commands …

when Salary between 20000 and 20000

… second set of commands …

otherwise

… third set of commands …

endcase

The following program fragment illustrates how WHEN conditions in a CASE command can handle an application user’s choice of accelerator keys in an application. Depending on the key pressed by the application user, a particular procedure is executed.

form display input

case

when Event.EventName = “F3”

return

when Event.EventName = “F1”

AddNewRecord ()

when Event.EventName = “F2”

ChangeRecord ()

when Event.EventName = “F4”

DeleteRecord()

otherwise

GiveHelp ()

endcase

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

WINDOW SET CURRENT

Makes an open window the current window.

Syntax

WINDOW SET [NOT] CURRENT [window]

Parameters

NOTPlaces window at the bottom of the currency stack.
windowThe name of an open window. Can be
a window object name, or
(expr), where expr is a character string, or an expression that evaluates to a character string, that is to be used at run time as a window object name. The parentheses must be entered.

Comments

Before you can use this command, the target window must be open (WINDOW OPEN command), though it need not be active (WINDOW ACTIVATE command). The target window becomes the current window, unless NOT is specified. If NOT is specified, the target window is moved to the bottom of the “stack” of OPEN windows.

See Also

ThisWindow

pt_BRPortuguese