[NOT] IN

Compares one value to a list of values.

Syntax

expression [NOT] IN («expr»)

Parameters

expressionAn expression that evaluates to either a number or a character string.
exprA list of expressions whose values are to be compared to expression. Members of the list are separated from one another by commas.

Return Value

Logical

Comments

An IN comparison is logically true if expression is equal to at least one of the values in the specified list.

A NOT IN comparison is logically true if expression is not equal to any of the values in the specified list.

In either case, the comparison ends as soon as a logically true instance is found.

Example

The conditional expression that follows is logically true if the value of AirPollutants matches any of CFC, CO, or NOX.

AirPollutants in (" CFC","CO"," NOX")

The conditional expression that follows is logically true if the value obtained from either TicketAmt*5 or Receipts*10 equals 10,000.

10000 in ( TicketAmt * 5,Receipts * 10)

See Also

About Conditional Expressions

ZIM Comment Block << >>

(Program template delimiters)

<< your code >>

Quickly marks a large block of code that you want to prevent from running or that you want to be generated by the GENERATE command by putting the delimiters at the start and end of an output section in a template program.

Syntax

Place a two less than characters before the start of the code.

<< 
code / statements

>>

Place a two greater than characters at the end of your code.

Parameters

code \ statements

 

one or more command statements, typically using macros, to send to the current output destination when the program containing them is processed with a GENERATE command

 

Comments

The program template delimiters, << and >>, must appear alone on a physical line in the application document. When the program is executed, parsed, or compiled, the statements between the delimiters are ignored.

When the program is run under the GENERATE command, the statements are sent as output, after macro substitution, to the current output device.

Example

… commands1 …
<<
… commands2 …
>>
… commands3 …

Under normal execution, commands1 and commands3 execute normally; commands2 are ignored.

When the program is parsed or compiled, commands1 and commands3 are parsed or complied in the usual manner; commands2 are ignored.

When the GENERATE command is used, commands1 and commands3 execute normally; commands2 are sent as output, after macro substitution, to the current output device.

< > (Macro name delimiters)

Marks the start and end of a macro name in an application program.

Syntax

<name>

Parameters

nameThe name to be assigned to a global macro, or a digit from 0 to 9 referring to one of the local macros belonging to the current macro program.

Comments

A macro is a dynamically declared name that represents a character string. When a macro call is encountered in an application program, the macro call is replaced by the current character value of the macro.

A macro acquires values in one of two ways: implicitly, when the software encounters a call to a previously unknown global macro or unassigned local macro, or explicitly, in a LET or INPUT statement or a call to a local macro.

Example

let <EntSet> = "ENTS"
let <Name> = "EntName"

Defines the global macro to represent the string ENT. Then the statement

list #<EntSet> format #<Name>

is interpreted as

list ENTs format EntName

See Also

Conventions

How To Construct Logic Expressions

How To Use Logic Expressions

% (Comment)

Marks the start of a comment in an application program.

Syntax

[ZIMcommand] % comment

Parameters

ZIMcommandAny portion of a command that appears on one line in an application program.
commentAny string of characters, normally a few words explaining either ZIMcommand or an entire section of the program. The command parser ignores comment.

Comments

The percent sign marks the start of a comment in an application program.

Example

% Process accelerators
form set (not scroll) fPlayers     % switch off scrolling
case
when Event.EventName = "F3"    % "Exit" accelerator
return           % terminate main procedure
when Event.EventName = "F4"    % "Update" accelerator
UpdatePlayers ()
when Event.EventName = "F5"    % "Add" accelerator
AddPlayers (PlayersAdded)
when Event.EventName = "F6"    % "Delete" accelerator
DeletePlayers (PlayersDeleted)
when Event.EventName = "F7"    % "Report" accelerator
ReportPlayers ()
endcase

? (Wildcard)

Matches all subsequent characters in a value.

Syntax

expression1 = expression2 ?

Parameters

expression1A character string, or a variable or form field that evaluates to a character string.
expression2A character string, or a variable or form field that evaluates to a character string.

Comments

Used with the equals sign in logic expressions, the ? wildcard matches any number of subsequent characters when expression2 is compared to expression1. The question mark must appear outside of the pattern string.

Example

DeptNum = "D56"?

Logically true if the department number begins with the string “D56”. Notice that the question mark must appear outside the string.

RemarkField = "Smith?"

Shows the question mark being used literally in a string. (The characters appear inside the quotation marks.) The expression is logically true only if Remarkfield contains the exact characters Smith?.

Surname = fCustomer.LastName?

Shows how the wildcard can be attached directly to an atomic expression employing a variable, local variable, form field, or formal parameter, provided the object is of a character data type. (Trailing blanks in the specified object are trimmed for pattern-matching purposes.)

See Also

Conventions

How To Construct Logic Expressions

How To Use Logic Expressions

DDEExecute

DDEExecute

Send commands and macros to the target application.

Syntax

procedure DDEExecute (out tErrCode, inout tServ,
 in app_cmd)

Parameters

tErrCode

longint, an error code

tServ

longint, connection handle

app_cmd

char, command or macro to be executed

Comments

DDEExecute sends target application specific commands and macros to be executed by the remote application. Consult the documentation of the remote application for information on these commands.

The filename is ddeexec.pgm.

Example

For example, given that DDE_Err and hServ are of type longint and that hServ has been set by a previous call to DDEConnect, to send the ‘[NEW(1)]” command to EXCEL

DDEExecute(DDE_Err, hServ, ‘[NEW(1)]’)

instructs EXCEL to open a new spreadsheet.

DDEPoke

DDEPoke

Assigns a value to a specific item in a remote application.

Syntax

procedure DDEPoke (out tErrCode, inout tServ,
 in dde_item, in dde_val)

Parameters

tErrCode

longint, an error code

tServ

longint, connection handle

dde_item

char, item name

dde_val

char, value of the item

Comments

DDEPoke assigns a value to a specific item in a remote application. Consult the documentation of the remote application for information on what constitutes an item. The value of an item is always given as char.

The filename is ddepoke.pgm.

Example

For example, given that DDE_Err and hServ are of type longint, to set the value of row 1, column 1 in the current spreadsheet, enter the following:

DDEPoke (DDE_Err, hServ, ‘R1C1′, ’25’)

This example “pokes” the value ’25’ into row 1, column 1.

DDEPeek

DDEPeek

Syntax

procedure DDEPeek (out tErrCode, inout tServ, in dde_item, out dde_val)

Parameters

tErrCodelongint, an error code
tServlongint, connection handle
dde_itemchar, item name
dde_valchar, value of the returned item. Must be a string at least five characters in length

Comments

DDEPeek retrieves the value of a specific item from a remote application. Consult the documentation of the remote application for information on what constitutes an item. The value of an item is always returned as char.

The filename is ddepeek.pgm.

Example

For example, given that DDE_Err and hServ are of type longint, that DDE_OutValue is of type alpha and is 10 characters long, and that hServ has been set in a previous call to DDEConnect, to retrieve the value of row 1, column 1 in the current spreadsheet, enter the following:

DDEPeek(DDE_Err, hServ, ‘R1C1’, DDE_OutValue)

This example “peeks” at the value of the cell at row 1, column 1 and places the retrieved value in DDE_OutValue.

$year

Extracts the year number associated with a specified date value.

Syntax

$year(date)

Parameters

datea data, or an expression that evaluates to a date, in the form YYYYMMDD

Return Value

Character string.

Comments

This function extracts day information from standard date values. Date is often the system variable $Date.

Example

$year(19981225)

Evaluates to “1998”.

$year($date + 7)

Evaluates to “1999” when $Date is 19991225.

See Also

$addyears

$Date

$day

$dayname

$month

$monthname

$weekday

About Data Types

About Functional Expressions

$iszimname

Tests if a character string is a valid object name.

Syntax

$iszimname(string)

Parameters

stringa character string or an expression that evaluates to a character string

Return Value

1-character binary string. Evaluates to 1 ($True) if string meets the validation test; otherwise, evaluates to 0 ($False).

Comments

This function tests if a particular character string is valid zim object name.

Example

$iszimname(189)

Evaluates to $False.

$iszimname("Fields")

Evaluates to $True.

See Also

$isalphabetic

$isalphanumeric

$isdate

$isdigit

$islower

$isnumber

$isupper

About Character Literals

About Functional Expressions

pt_BRPortuguese