$filebrowse

Presents the application user with a File Open common dialog box.

Syntax

$filebrowse(directorypath, pattern, flags ,[heading])

Parameters

directorypathA character string or an expression that evaluates to a character string, naming the default directory path to show in the dialog box. If path is the null string (”), the current directory is used as the default directory.
patternA character string or an expression that evaluates to a character string, specifying the pattern names and associated patterns that can be searched for, in the dialog box. If pattern is the null string (”), no patterns are searched for. Otherwise, pattern is specified in the form:
“patternname1|pattern1[«|patternname2|pattern2»]”
flagsA number or an expression that evaluates to a number, determining the attributes of the dialog box.
headingA character string, or an expression that evaluates to a character string, setting the title for the dialog box.
FlagsMeaningConstant Name
0The dialog box opens for saving a file. 
2Path must exist.cPathMustExist
4Prevent read-only files from being returned.cNoReadOnlyFiles
8Enable multiple selections.cAllowMultiSelect

Flags can contain any single number, or the sum of two or more numbers from the Flags column.

Return Value

For EntitySets, relationships, and application directories, the value returned is the number associated with the disk file that contains the specified object.

For application documents, the value returned is the number associated with the disk file that contains the application directory in which the application document was created.

Comments

Use $filebrowse to display the File Open common dialog box and select a file.

The value returned by the function depends on the application user’s interaction with the dialog box:

  • If the application user activates the Cancel push button, $Null is returned.
  • If the application user makes a selection (multiple selections not enabled), the function returns the directory path concatenated with the file name.
  • If the application user makes a selection (multiple selections enabled), the function returns the directory path and a list of one or more file names separated by semicolons.

Example

A properly constructed pattern appears as shown below:

'All files |*.*|ZIM files|*.zim;zim0*'

In the following code fragment, the variable vIconFileSel is assigned the results of the user’s interaction with the File Open dialog box:

let vIconFileSel= $filebrowse ($concat($DBPath, "\Icons"), "Icon files|*.ico|All files|*.*", cFileMustExist + cPathMustExist, "Icon File Selection")

$getproperty

Returns the current settings of certain device or registry properties.

Remarks

The function $getproperty always returns a 260-character string aligned to the left. If needed to handle numeric values, a $trim function needs to be used to remove all trailing blanks thus avoiding conversion errors.

Syntax #1

Returns the current settings of certain desktop properties.

$getproperty("desktop", property)

Parameters

propertyA character string or an expression that evaluates to a character string. Properties include MousePresent, ScreenColors (or ScreenColours), ScreenHeight, ScreenUnits, and ScreenWidth.

Return Value

Character string or $null if property is not a recognized string.

Syntax #2

Returns the current settings of certain printer properties in the Windows environment.

$getproperty("printer", property)

Parameters

propertyA character string, or an expression that evaluates to a character string. Properties include CharsPerLine, Color (or Colour), DeviceName, DisplayPrintDialog, DriverVersion, Duplex, FontName, FontSize, LinesPerPage, MonospacedFont, Orientation, PaperBin, PaperLength, PaperSize, PaperWidth, PrintQuality, Scale, TrueTypeOption, and YResolution.

Return Value

Character string or $null if property is not a recognized string.

Comments

The string contains the current setting of property.

Syntax #3

Returns the current settings of the Zim variables stored in the Windows Registry.

$getproperty (registry_section, registry_variable)

Parameters

registry_sectionA character string, or an expression that evaluates to a character string with the format “REG:[sectionname]” or “SERVREG:[sectionname]”. The sectionname can be ODBC, ZIM or a user-defined name.
registry_variableThe registry variable being queried.

Return Value

Character string or $null if the section or the variable is not present in the Registry.

Syntax #4

$GetProperty ("session", <config_setting>)

Parameters

sessionThe operating environment of one particular invocation of a Zim executable.
config_settingA valid configuration setting.

Return Value

The return value is the current value of the specified config_setting.

Syntax #5

$GetProperty ("OleVerbList", FileOrClassName)

Parameters

OleVerbListThe list of verb names supported by an OLE object.
FileOrClassNameA valid OLE file or classname.

Return Value

The return value is the list of supported verbnames of a file or OLE class. Semicolons separate the verbs in the returned list.

Examples

>out $getproperty ("OleVerbList", "ztizim.bmp")
Edit;Open

In the above command, the OleVerbList associated with a .bmp file is “Edit;Open” which means that there are two available verbs: Edit and Open.

let vFontSize = $getproperty ("printer", "fontsize")

In the above command, vFontSize can be a character or number variable. (The software converts the character string returned by $getproperty to a number, if required.)

let vODBCVersion = $getproperty ("REG:[ODBC]", "VERSION")

Gets the version of the installed Zim ODBC Driver.

See Also

$printersetup
$setproperty

$setproperty

Changes the settings of certain device properties of the registry variables file.

Syntax

$setproperty(section, property, newsetting)

Parameters

sectionA character string or an expression that evaluates to a character string to indicate the group of properties or registry values that should be changed.
propertyA character string or an expression that evaluates to a character string to name the property or register that should be changed.
newsettingA character string or an expression that evaluates to a character string containing the new value for the property or register value.

Return Value

A character string containing “1” ($True) if the arguments to the function were valid and newsetting was applied. Otherwise, it returns “0” ($False).

Comments

If more than one $setproperty is used during the generation of a report, then only the last $setproperty is in effect when the report is printed.

Care should be taken when changing the setting of registry values, as improper manipulation can result in program or system failure.

The following are possible values for section, property and their corresponding newsetting:

“DESKTOP”Changes properties of Zim desktop.
property and newsettingThe only possible value for a desktop property is “ScreenUnits” which accepts the following newsetting:0 = screen units are pixels;
1 = screen units are twips;
2 = screen units are points;
3 = screen units are logical inches;
“PRINTER”Sets printer properties of the default printer.
property and newsettingPossible values for a printer property and corresponding newsetting are:”Color” or “Colour” = 1, Monochrome; 2, color;
“Copies” = number of copies;
“DisplayPrintDialog” = 0 or 1, prints the dialog; 2, doesn’t print it;
“Duplex” = 1, Simplex; 2, Vertical; 3, Horizontal;
“FontName” = a valid font name;
“FontSize” = a valid font size;
“MonospacedFont” = 0 or 1, uses mono-spaced fonts; 2, doesn’t use it;
“Orientation” = 1 for Portrait and 2 for Landscape;
“PaperBin” = a number indicating the paper bin (see the printer manual);
“PaperLength” = a number to indicate the paper length (see the printer manual);
“PaperSize” = a number to indicate the paper size (see the printer manual);
“PaperWidth” = a number to indicate the paper width (see the printer manual);
“PrintQuality” = a number indicating the printing quality (see the printer manual);
“Reset” = any value resets to the default values (the value is ignored);
“Scale” = a number indicating the scale to be used for printing;
“TrueTypeOption” = 1, bitmap; 2, download; 3, substitute; 4, outline;
“YResolution” = a number indicating the Y resolution.
“SESSION”Sets properties for the current session of Zim.
property and newsettingPossible values for the Zim session property and the corresponding newsetting are the ones described in the Zim configuration options for the current database. See Zim Database Configuration File (zimconfig.zim) for further details.
“REG:[sub-section]” or “INI:[sub-section]”Sets any properties of this user-defined sub-section.
property and newsettingproperty and newsetting can have any values because they are user-defined.

“SESSION”:

“REG:[ODBC]”To programmatically create an ODBC data source connection.
property and newsettingPossible values for the ODBC Driver data source property and the corresponding newsetting are:The data source name = must be $getproperty(“REG:[ODBC]”, “VERSION”);
“DBQ” = the database name to connect to;
“Driver” = must be $getproperty(“REG:[ODBC]”, “DRIVER”);
“DSN NAME” = the name of the data source;
“Host” = the address of the machine running Zim Server;
“PWD” = the password of the connecting user;
“Server” = the port number that Zim Server is listening to;
“UID” = user name identification;
“WorkPath” = work path of the current session.

For more information, see Configuring a Data Source.

If running the Zim executable, the section “REG:[…]” sets the registry values in the machine where Zim Server is running because Zim only runs in the same machine as Zim Server runs.

If running the Zim Thin executable, the section “REG:[…]” sets the registry values in the machine where Zim Thin is running.

In order to set registry values in the machine where Zim Server is running when running Zim Thin, you must use the section “SERVREG:[…]” which has the same meaning and syntax as “REG:[…]”.

Examples

let vSet = $setproperty ("printer", "fontsize", "12")

Sets the font size of the default printer to 12.

let vSet = $setproperty ("REG:[MYSET]", "My Setting", "I like this one.")

Sets “I like this one.” in the property “My Setting” belonging to the sub-section “MYSET”. This kind of setting is useful for applications to keep track of values used in the Zim application.

let vSet = $setproperty ("SESSION", "Parameter Size", "2000")

Sets the database configuration option “Parameter Size” to 2000.

See Also

$getproperty
$printersetup

SET PAGEWIDTH

Controls the overall width of pages output by the LIST command.

Syntax

SET PAGEWIDTH num

Parameters

numNum specifies, in characters, the width of an output page.
Num can be
an integer constant (e.g., 15, 200).
a variable, form field, menu item, or parameter that evaluates to an integer.

Comments

The PAGEWIDTH option is set to 80 characters by default.
If the data generated by LIST or SELECT exceeds the current PAGEWIDTH, the software assumes that the output device wraps data onto subsequent lines.

Example

set output printer

set pause on

set pagesize 40

set pagewidth 120

list all Employees sorted by Department

Here, the SET PAGEWIDTH command (together with SET PAGESIZE) sets LIST output for printing in the landscape orientation.

See Also

SET HEADINGS

SET PAUSE

SET PAGESIZE

Controls the overall length of pages output by the LIST command.

Syntax

SET PAGESIZE num

Parameters

numNum specifies, in lines, the height of an output page.
Num can be:
an integer constant (e.g., 15, 200);
a variable, form field, menu item, or parameter that evaluates to an integer.

Comments

The PAGESIZE option is set to 24 lines by default.

The PAGESIZE option should be adjusted to suit the current output device (e.g., 66 lines for a printer, 24 lines for a terminal screen).

Example

set output printer
set pause on
set pagesize 40
set pagewidth 120
list all Employees sorted by Department

Here, the SET PAGESIZE command (together with SET PAGEWIDTH) sets LIST output for printing in the landscape orientation.

See Also

LIST

SET HEADINGS

SET PAGEWIDTH

SET PAUSE

SET MEMBERINTERVAL

Sets the interval between set-processing progress messages.

Syntax

SET MEMBERINTERVAL num

Parameters

numNum can be:
an integer constant (e.g., 15, 200)
a variable, form field, menu item, or parameter that evaluates to an integer.

Comments

The MEMBERINTERVAL option is set to 1 by default.

The MEMBERINTERVAL option determines how many records are to be processed between messages tracking the progress of set-processing commands. Set-processing progress messages are turned on or off with the SET MEMBERCOUNT command.

Example

> set membercount on
> set member interval 10
> find Employees
200 processed.
200 selected.
>

The number of records processed and selected are displayed in increments of ten until all records are processed.

See Also

$MemberCount

SET ERRORS

SET MEMBERCOUNT

SET STOP ERRORS

Halts the execution of an application program if an error occurs.

Syntax

SET STOP ERRORS ON|OFF

Comments

The STOP ERRORS option is OFF by default.

When STOP ERRORS is switched ON, execution is halted (by the HALT utility) when an error occurs. To resume execution after the HALT, press Enter at the HALT prompt (>>).

Compiled application programs are not affected by SET STOP ERRORS.

The ET STOP ERRORS command is not affected by the SET RESET and SET RESTORE commands.

Example

> set stop errors on
:
> list all test
procedure test (p_OwnerName)
report from Fields where OwnerName = p_OwnerName % Spelling error
… body of report …
endreport
endprocedure
> test
*** Error *** …
>>

The HALT command is executed when the execution of test results in an error. (The name of the EntitySet Fields is misspelled in the body of the procedure.)

See Also

$ErrCode

SET SELECTIVITY

SET SINGLESTEP

SET EXECUTEMODE

SET EXECUTEMODE

Controls the mode of software execution.

Syntax

SET EXECUTEMODE SQLMODE | ZIMMODE | SERVERMODE

Comments

The EXECUTEMODE option is set to SQLMODE by default.

The SQLMODE option executes SQL database code.

The SERVERMODE option executes integrated Zim server code.

The ZIMMODE option executes standard Zim code. In ZIMMODE, EntType, RelType, and so on are ignored. In this way, it can be used for testing without an effective connection.

When EXECUTEMODE is SQLMODE, Zim executes integrated server requests on the target Zim server if possible. Otherwise, it sends SQL requests to the server. When EXECUTEMODE is SQLMODE, Zim executes code against the target SQL database. By setting EXECUTEMODE to ZIMMODE, Zim executes the code as standard Zim code.

Example

To execute Zim Client-server code as standard Zim code, enter

> set executemode zimmode

See Also

COMPILE

SET COMPILEMODE

SET SQLCOMPILE

UNCOMPILE

SET CHECKSETS

Controls consistency checking of result sets.

Syntax

SET CHECKSETS ON|OFF

Comments

The CHECKSETS option is set ON by default.
When CHECKSETS is ON, the software checks certain aspects of the component structure of result sets for consistency. This consistency checking is performed when a command creates a result set (using the -> (Result set) subcommand), if the set has already been defined as a result set, either in a previous set-producing command, or as a NamedSet object in the Object Dictionary. Normally, you should always leave CHECKSETS set ON.
The SET CHECKSETS command is not affected by the SET RESET and SET RESTORE commands.

Example

find Employees -> Set1

find Departments -> Set1

With CHECKSETS set ON, the second command in the preceding sequence produces an error (the component structure of the set is not consistent from one command to the next).

set checksets off

find Employees -> Set1

find Departments -> Set1

By setting CHECKSETS OFF, the command sequence produces no error.

See Also

CREATE

SET SQLCOMPILE

SET SQLCOMPILE

Controls the compilation of generated SQL statements within the SQL database.

Syntax

SET SQLCOMPILE ON|OFF

Comments

The SQLCOMPILE option is OFF by default. The software stores SQL statements generated in the compiled code and executes them dynamically at run time.

When SQLCOMPILE is switched ON, the software attempts to compile all generated SQL statements at the SQL database server. Before attempting to compile with SQL compiling switched on, you must be connected to the SQL database.

Changes to this setting provide control over how the SQL statements are to be executed. The query optimizers for certain SQL databases perform differently when processing SQL statements dynamically.

Example

set sqlcompile off
list all Customers format CC LastName
set sqlcompile on

Forces the statement list all Customers format CC LastName to be executed dynamically at the server within a compiled application program.

See Also

COMPILE

SET COMPILEMODE

SET EXECUTEMODE

SET SQLTRACE

UNCOMPILE

pt_BRPortuguese