sanScript Command Listing

 

Application

close application

Closes all windows and quits the current application.

run application

Starts an external application.

 

COM

import

Creates a reference to the specified type library file, allowing the current script to access the items described in the type library.

new

Creates a reference to a new COM object.

this

Used to reference the current callback object from within a method defined for that callback object.

 

Commands

check command

Sets a command to the checked state

disable command

Disables a command.

enable command

Enables a command.

hide command

Makes the named command invisible every place it is displayed,

run command

Performs the action for the specified command.

show command

Makes the named command visible every place it is displayed

uncheck command

Sets a command to the unchecked state

check command

Sets a command to the checked state

 

Currency

currencydecimals()

Returns the current value of the operating system’s decimal digits setting.

default roundmode to

Sets the default rounding behavior for calculations performed in the current script.

format()

Converts a currency or variable currency value to a string and applies a format.

precision()

Returns the total number of digits available for a variable currency field or variable.

round()

Returns a rounded value of a currency or variable currency field. The field can be rounded on either side of the decimal separator.

scale()

Returns the number of decimal digits for a variable currency field or variable.

set precision of

Sets the decimal precision of a currency or variable currency field.

truncate()

Returns a truncated value of a specified currency or variable currency field. The field can be truncated on either side of the decimal separator.

 

Date

addmonth()

Adjusts the month portion of a given date.

day()

Retrieves the day portion of a given date.

dow()

Returns the day of the week for a given date.

eom()

Returns the last date of the month for a given date.

mkdate()

Creates a date value from three integer values.

month()

Retrieves the month portion of a given date.

setdate()

Creates or modifies a date.

sysdate()

Returns the current date from either the current computer or the server the computer is accessing.

year()

Retrieves the year portion of a given date.

 

Exception handling

exit

Exits the current instance of the specified program structure.

restart script

Restarts the current script after an exception.

restart try

Restarts executing sanScript statements in a try...end try block after an exception.

throw

Throws a user exception or rethrows the current exception.

throw system exception for table

Throws a system exception for an error that has occurred for a table.

try...end try

Implements structured exception handling in an application.

 

Error handling

assert

Allows verifying the state of computation at a given point in a script.

check error

Checks the value of the err() function for the last operation on the specified table and displays a message.

editexisting()

Indicates whether the last edit statement retrieved an existing record or reserved space for a new record.

err()

Returns the result of the last operation on a table.

error

Creates an error dialog box displaying a specified string. The dialog may also contain a Help button that will reference a specified entry in the help system.

naterr()

Returns the native error code for the last table operation on a specified table.

warning

Creates a warning dialog box displaying a specified string. The dialog may also contain a Help button that will reference a specified entry in the help system.

 

Fields and window objects

add item

Adds a specified string to a specified list field. Can also add a numeric item associated with the specified string.

arraysize()

Retrieves the size of the specified array field or variable.

assign

Creates a reference to a window field.

change item

Changes the text for an item in a menu or a list field.

changed()

Returns a boolean value indicating whether any of the non-button fields in a window or form have been changed.

check field

Highlights a specified item in a multi-select list box or places a check mark next to an item in a button drop list.

checkedfield()

Indicates whether a specified position in a multi-select list box is selected or an item in a button drop list is checked.

clear field

Clears the specified field, or list of fields.

copy from field to field

Copies matching components from one composite to another.

countitems()

Returns the number of items in a menu or list field.

currentcomponent()

Returns an integer indicating which component of a composite that focus has moved from.

datatype()

Returns the data type associated with a field.

default window to

Provides default qualification for window names within a script.

delete item

Removes an item from a list field or visual switch.

diff()

Returns the difference between a field’s previous value and its current value.

disable field

Disables a field or multiple fields.

disable item

Disables a specific item in a button drop list.

empty()

Indicates whether a given field is empty.

enable field

Enables a field or multiple fields.

enable item

Enables a specific item in a button drop list.

fill

Sets the specified field to the maximum value each field’s data type will allow.

filled()

Returns true if the specified field is set to its maximum value.

finddata()

Returns the numeric position of a data item in a list field that is associated with the specified numeric value.

finditem()

Returns the numeric position of a specific item in a menu or list field.

focus

Moves the input focus to a field.

format()

Converts a currency or variable currency value to a string and applies a format.

hide field

Makes the named field or fields invisible and inaccessible to the user.

insert item

Inserts an item into the specified position in a list field.

itemdata()

Returns the numeric value associated with the item in the specified position in the specified list field.

itemname()

Returns the text value in a specified position in a menu or list field.

length()

Returns the length of a specified string, string field or text field.

lock

Prevents a user from changing the contents of the specified field or fields.

move field

Changes the position of a field in a window.

old()

Retrieves the previous contents of a field after it has been changed.

override component

Sets the length of a component of an extended composite.

override field

Sets the separator for a composite and controls whether scroll arrows are displayed.

redraw

Updates and redisplays the specified field or fields.

resize field

Changes the display size of a specified field.

restart field

Restarts processing on a field.

return

Returns a value to a field in a different form that has requested a value.

set

Sets a field or variable to the value of an expression.

set precision of

Sets the decimal precision of a currency field.

show field

Makes the specified field or fields visible and accessible to the user.

uncheck field

Removes the highlight from a specified item in a multi-select list box or unchecks an item in a button drop list.

unlock

Allows a user to access previously locked fields.

 

Files

getfile()

Allows the user to select a file from the operating system.

savefile()

Allows the user to name and save an export file.

 

Forms

changed()

Indicates whether the contents of a form or window have changed.

clear changes

Clears the change flag for a window or form.

clear form

Clears the specified form.

close form

Closes the specified form.

default form to

Provides default qualification for form names within a script.

force changes

Sets the change flag for the specified window or form.

isopen()

Indicates whether a specified form or window is open.

open form

Opens the specified form.

open form with name

Opens a form for which the name is specified at runtime.

required()

Indicates whether all the required fields in a form or window contain values.

restart form

Clears a form and places the focus in the first field of the main window of the form.

return

Returns a value to a field in a different form that has requested a value.

 

Macros

run macro

Runs a Dexterity macro.

 

Menus

check menu

Places a check mark next to a specified menu item.

checkedmenu()

Indicates whether a specified menu item has a check mark by it.

countitems()

Returns the number of items in a menu or list field.

disable menu

Disables a menu item.

enable menu

Enables a menu item.

finditem()

Returns the numeric position of a specific item in a menu or list field.

hide menu

Hides the specified menu item.

itemname()

Returns the text value in a specified position in a menu or list field.

show menu

Shows the specified menu item.

uncheck menu

Removes a check mark from next to a menu item.

 

Messages and prompts

ask()

Displays a dialog box and returns a value indicating which button the user clicked.

beep

Generates one of three sounds.

check error

Checks the value of the err() function for the last operation on the specified table and displays a message.

debug

Displays messages in Dexterity test mode.

error

Creates an error dialog box displaying the specified string.

getfile()

Allows the user to select a file from the operating system.

getmsg()

Retrieves the message string associated with a specified message ID.

getstring()

Creates a dialog box and returns a string entered by the user.

savefile()

Displays a dialog that allows the user to specify a file name and location for an export file.

substitute

Substitutes text items for replacement markers in a string.

warning

Creates a warning dialog box displaying the specified string.

 

Numerics

abs()

Returns the absolute value of an expression.

bitclear()

Clears a specified bit and returns the value.

bitset()

Sets a specified bit and returns the value.

bittest()

Tests the status of a bit.

decrement

Allows you to decrease a numeric value by a specified amount.

diff()

Returns the difference between a field’s new value and its old value.

hex()

Returns the hexadecimal equivalent of an integral value.

increment

Allows you to increase a numeric value by a specified amount.

max()

Returns the greater of two values.

min()

Returns the lesser of two values.

str()

Converts a numeric value to a string.

value()

Returns a numeric value corresponding to the first set of numbers encountered in the specified string.

 

Process groups

begingroup

Indicates the beginning of a group of procedures that are to be processed as a single entity. Also specifies details of how the group should be processed.

endgroup

Indicates the end of a process group defined by the begingroup statement.

 

Program structures

case...end case

Allows a series of statements to run on a conditional basis.

continue

Continues the current instance of the specified loop type.

exit

Exits the current instance of the specified program structure.

for do...end for

Repeats a series of statements a given number of times.

if then...end if

Runs a series of statements when a condition is met.

repeat...until

Runs a series of statements until a condition is met.

while do...end while

Runs a series of statements while a condition is met.

 

Reports

run report

Prepares a predetermined report to be printed.

run report with name

Prepares a report, specified when the application is running, to be printed.

 

Resources

resourceid()

Returns the resource ID for the specified resource.

technicalname()

Returns the technical name for the specified resource.

 

Script controls

abort script

Halts the current script.

call

Starts the specified procedure.

call sproc

Starts a stored procedure on the current data source.

call with name

Starts a procedure that is specified at runtime.

clear force change

Stops a field’s change script from automatically running once the force change statement has been issued for that field.

debugger stop

Opens the Script Debugger window and causes the current script to stop processing at that point.

execute()

Compiles and executes sanScript code at runtime.

force change

Runs the change script for a field when the focus leaves the field, regardless of whether the field’s contents have changed.

missing()

Ascertains whether an optional parameter has been supplied to a procedure or function.

run script

Runs the change script for a given field.

run script delayed

Starts a script when other script processing is completed.

 

Scrolling windows

delete line

Runs the line delete script for the scrolling window.

expand window

Switches between normal and expanded scrolling window line sizes.

fill window

Fills the scrolling window with data from a specified table.

hide window

Makes the specified scrolling window invisible and inaccessible to the user.

insert line

Runs the line insert script for the scrolling window.

move window

Changes the position of the specified scrolling window.

reject record

Skips specified records during fill and scrolling processes.

show window

Makes the specified scrolling window visible and accessible to the user.

 

Sound

beep

Generates one of three sounds.

 

Strings

ascii()

Returns the ASCII value of the first character in a string.

char()

Returns a one-character string corresponding to the specified ASCII value.

isalpha()

Indicates whether a string expression contains only alphabetic characters.

length()

Returns the length of a specified string, string field or text field.

lower()

Returns the specified string in lower case.

pad()

Adds a specified string to the beginning, end, or both the beginning and end of another specified string.

pos()

Returns the starting position of a given string within another text or string field.

replace()

Replaces a portion of a given string with another string.

str()

Converts a numeric value to a string value.

substitute

Substitutes values for replacement markers in a string.

substring()

Retrieves a portion of a given string.

trim()

Removes a specified string from the beginning, end, or both the beginning and end of another specified string.

upper()

Returns the specified string in upper case.

value()

Derives a numeric value from a set of numeric characters in a string.

 

System calls

currencydecimals()

Returns the current value of the operating system’s decimal digits setting.

extern

Calls a function in a Dynamic Link Library (DLL).

physicalname()

Returns the physical name of a global field, the physical name of a table, or the column name of a field in a SQL table.

resourceid()

Returns the resource ID for the specified resource.

sysdate()

Returns the current date from either the current computer or the server the computer is accessing.

sysdatetime()

Returns the current date and time from the current computer.

system

Calls a Dexterity system command.

systime()

Returns the current time from either the current computer or the server the computer is accessing.

technicalname()

Returns the technical name for the specified resource.

 

Tables

assign

Creates a reference to a table.

change

Reads a record and actively or passively locks it.

clear table

Clears the table buffer for the specified table.

close table

Closes the specified table.

column()

Retrieves the value from a specified field in a table.

copy from table

Copies fields from the table buffer to the window buffer.

copy from table to table

Copies matching fields from one table buffer to another.

copy from table to window

Copies information from the specified table buffer to the specified window buffer.

copy from window to table

Copies information from the specified window buffer to the specified table buffer.

copy to table

Copies fields from the window buffer to the table buffer.

countrecords()

Counts the number of records in a table.

delete table

Removes the named table from the operating system. When using the SQL database type, delete table can remove the table’s data, but leave the table structure.

edit table

Reads or reserves a record from a table.

editexisting()

Indicates whether the last edit statement retrieved an existing record or reserved space for a new record.

fill table

Sets every field in the table buffer for the specified table to the largest value represented by the field’s data type.

get

Reads a record from a table without locking the record.

keynumber()

Returns the number of a named table key.

open table

Opens the specified table using the specified options.

range

Limits table access to a portion of the table.

range copy

Copies records in the current range from a source table to a destination table.

range where

Allows you to apply additional restrictions to a range of records in a table.

release table

Releases a locked or reserved record.

remove

Removes a record or range from a table.

save table

Saves the contents of the table buffer to a table.

sum range

Totals each field that has a numeric data type (integer, long integer or currency) in a specified range.

 

Time

hour()

Retrieves the hour portion of a given time.

minute()

Retrieves the minute portion of a given time.

mktime()

Creates a time value from a given set of numbers.

second()

Retrieves the seconds portion of a given time.

systime()

Returns the current time from either the current computer or the server the computer is accessing.

 

Transactions

havetransactions()

Indicates whether a database type has transaction capability.

transaction begin

Starts a set of table operations.

transaction commit

Ends a set of table operations.

transaction rollback

Discards transaction results.

 

Triggers

anonymous()

Used to refer to resources when registering triggers.

column()

Retrieves the value from a specified field in a table.

reject record

Stops processing of trigger processing scripts.

 

Windows

abort close

Halts the process of closing a window.

changed()

Indicates whether the contents of a form or window have changed.

clear changes

Clears the change flag for a window or form.

clear window

Clears the specified window.

close palettes

Closes all palettes.

close window

Closes the specified window.

close windows

Closes all standard windows and palettes.

copy from window to window

Copies the contents of matching fields from one window to another.

force changes

Sets the change flag for the specified window or form.

isopen()

Indicates whether a specified form or window is open.

move window

Changes the position of the specified window.

open window

Opens the specified window.

required()

Indicates whether all the required fields in a form or window contain values.

resize window

Changes the size of a window.

restart window

Clears a window and places the focus in the first field of the window.

set title of window to

Changes the display name of a window at runtime.

 


Documentation Feedback