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.

$Null

A “null” value for comparison.

Syntax

$null

Value

“Null” (a state of valuelessness). Cannot be reset by an application program.

Description

The “null” property. $Null can be written without the dollar sign.

When certain atomic expressions (variable name, field name, form field name, or formal parameter name) are used before being assigned values, or if the values are unknown, those expressions are considered to be $Null.

$Null is a property indicating a state of valuelessness; $Null is not itself a value. The null string is a value and is therefore not the same as the $Null property.

An arithmetic or functional expression that includes a $Null argument or operand always evaluates to $Null.

A logic expression that includes a $Null operand always evaluates to $False.

Because $Null is not a value, you cannot use the conditional operators = (Equals) and <> (Not Equals) to determine if an expression is $Null. Instead, the operator IS [NOT] [$]NULL is used as shown in the following example:

Salary is $null
Salary is null
Salary is not $null
Salary is not null

Note: You can write $Null without the dollar sign.

Example

if Salary is $null
 let Salary = StartingSalary
 ... commands ...
endif

See Also

$False

$True

EDIT

Starts a text editor to edit an application document.

Syntax

EDIT docname [BACKGROUND]

Parameters

docname

The name of an application document.

BACKGROUND

Indicates that the editor is to be executed asynchronously while the application continues to run.

Comments

The value assigned to $Editor should be the full path and file name of the desired text editor.

With BACKGROUND omitted, the EDIT command causes execution to be suspended; the editor takes over. When you exit from the text editor, execution resumes from the point at which the EDIT command was encountered.

With BACKGROUND specified, the editor can be running in its own window while the application continues to execute. You can have concurrent editing sessions.

Note: Any return code that is generated by the editor is placed in the $ErrCode system variable.

BACKGROUND is ignored in some operating environments and when using Zim Thin Client.

Example

To start a text editor, edit.com, for editing MainProg, enter

let $Editor = “NotePad”

edit MainProg

that sets the $Editor system variable to the name of the desired edit program. It then calls up that program to edit the specified file.

 

See Also

$Editor

$ErrCode

GRAPH

SYSTEM

-> (Result Set)

Assigns a name to the set of records processed by the main command.

Syntax

-> setname

The set of records processed by the main command is given the name setname.

where

setnameThe name to be assigned to the result set.

Comments

You can explicitly create a result set by adding the characters -> and an appropriate name to the end of any set processing command.

The result setname can be:

  1. the name of a set object in the database. The set specification used in the main command must be consistent with the structure defined for the set object in the Object Dictionary.
  2.  the name of a result set previously created by a set-producing command such as FIND or DELETE. The set specification used in the main command must be consistent with the structure of the previously named result set unless a SET CHECKSETS OFF command has been issued.
  3. a new name

Example

find Employees where LastName = "Jones" -> JSet

The result set JSet contains all records from Employees in which the last name is Jones.

REPORT HEADING

Specifies the report heading.

Syntax

REPORT HEADING [TEMPLATE name] reportitem [:format:]

Parameters

TEMPLATE name

For graphical reports, the name of an optional template to define the layout of the report.

reportitem

Any valid expression. Complex expressions must be enclosed in parentheses. When you specify more than one expression, each must be separated from the next by at least one space.

format

A 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

Generates a line-oriented heading at the start of a report, regardless of whether the report itself is line-oriented or column-oriented. To generate column-oriented headings, use the BREAK (Reports) command with a constant expression.

Typically, the items specified are text (for titles), blank lines, dates, and so on. The heading can include individual data values only from the first member of the REPORT FROM set.

 

See Also

How to Use The Report Generator

PAGE FOOTING

REPORT FOOTING

Report Item Format Options

PREVIOUS

Moves the current member pointer one or more records “up” in a result set.

Syntax

PREVIOUS [num] [setname]

Parameters

num

 

The number of members “further up” 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, PREVIOUS num actually moves the current member pointer “down” in the set.

 

setname

 

The name of a result set. If setname is omitted, the current set is used.

 

Comments

UP is a synonym for PREVIOUS.

Example

previous 10

Moves the current member pointer 10 members “up” towards the start of the set.

previous 5 MySet

list 5 MySet

Moves the current member pointer “up” five members, then lists five members (starting with the new current member).

 

See Also

$currentmember

BOTTOM

DOWN

LOCATE

NEXT

TOP

CURSOR

Positions the text cursor in the current window.

Note: This command has been deprecated in Zim 8.50.
It is still accepted for backwards compatibility, but it is ignored.

Syntax

CURSOR expression1 expression2

Parameters

expression1A number or an expression that evaluates to a number. If the expression is complex, it must be enclosed in parentheses.
Indicates the character row in which the cursor is to be positioned. It should be a number from 1 to the maximum number of rows in the current window.
expression2A number or an expression that evaluates to a number. If the expression is complex, it must be enclosed in parentheses.
Indicates the character column in which the cursor is to be positioned. It should be a number from 1 to the maximum number of columns in the current window.

Comments

The text cursor is placed at the specified row (expression1) and column (expression2) coordinates.

Examples

cursor 10 (60/2)
output "Press Enter to continue" ;
input

Positions the cursor at row 10 and column 30, and displays a message.

input $CursorRow $CursorCol
cursor $CursorRow $CursorCol

Prompts for a new cursor position, and moves the cursor.

$tonumber

Converts a value into its numeric equivalent.

Syntax

$tonumber(expression,decimals)

Parameters

expressionAny value, or an expression that yields any value.
decimalsA number specifying the number of decimal places required in the converted value. Decimals can be negative.

Return Value

Number equivalent of expression.

Comments

Use $tonumber to obtain the numeric equivalent of expression. If decimals is negative, the implicit number of decimal places in expression is used.

Example

$tonumber(1.273,2)

Evaluates to 1.27.

$tonumber(16/6,3)

Evaluates to 2.667.

$tonumber("2345",2)

Evaluates to 2345.00.

$tonumber("Smith",5)

Evaluates to 0.00000 (and produces an error).

$tonumber("1.2"*1.20,-1)

Evaluates to 1.44.

See Also

$money
$round
$toalpha
$tocharacter
About Functional Expressions
Decimals and Rounding
Decimals in Functional Expressions
Number Literals

LOGIN

Identifies the current user to Zim for security purposes.

Syntax

LOGIN username [password]

Parameters

username

A character string, or an expression that evaluates to a character string.
The character string is checked against the list of valid user names (as defined in the Users EntitySet). User names are case-sensitive.
Complex expressions must be enclosed in parentheses.

password

A character string, or an expression that evaluates a character string.
If username does not have a defined password, any password entered is ignored.
Complex expressions must be enclosed in parentheses.

Comments

The LOGIN command can be entered at any time during an application session.

When the software is started, it automatically tries to log the user as the default user ZIM. If ZIM is not a defined user in the Users entity set, access to any EntitySets or relationships is denied.

Example

If your user name is Boss and your password is $profits, to log in use

login “Boss” “$profits”

If you do not have a password, all you need to login is

login newuser

This example can be used if the application uses a log-in form

login fLogin.Username fLogin.Password

 

See Also

PASSWORD

PERMISSION

Securing Data Inside an Application

$min

Returns the minimum value of a set of values.

Syntax

$min(expression)

Parameters

expressionany expression

Return Value

The value of the selected instance of expression.

Comments

Use $min to find the smallest value among members of a set. Instances of expression that are $Null are ignored.

Expression is often a WHERE expression that includes only selected values in the operation. If the WHERE expression (expr1 WHERE expr2) is true, the expr1 value is included in the operation; otherwise, expression is considered $Null and is ignored.

Example

compute Employees where DeptName = "Sales" 
  evaluate (let MaxSal = $max(Salary)) 
      (let MinSal = $min(Salary)) 
      (let MaxSalF = $max(Salary where Sex = "F")) 
      (let MinSalF = $min(Salary where Sex = "F"))

At the end of this operation, MaxSal contains the highest salary paid to any employee in Sales; MinSal contains the lowest salary paid to any employee in Sales; MaxSalF contains the highest salary paid to any female employee in Sales; and, MinSalF contains the lowest salary paid to any female employee in Sales.

See Also

$average

$count

$max

$total

About Functional Expressions

WHERE

pt_BRPortuguese