VISUALPQL homecontents start chapter top of pagebottom of pagenext page indexFunctions

Functions

Functions return a single numeric or string value derived from the arguments of the function. Arguments are separated by commas. In general, the functions can appear in any string, arithmetic or logical expression in a VisualPQL program. Schema functions can be used in a PROGRAM. The functions are listed by type and in alphabetical order with a full explanation of each.

List of Functions by Type

Function types are:

For a detailed description of all functions, see the alphabetic list of functions.


Trigonometric Functions

ACOS arc cosine (also ARCOS)

ASIN arc sine (also ARSIN)

ATAN arc tangent

COS trigonometric cosine

SIN trigonometric sine

TAN trigonometric tangent

TANH hyperbolic tangent


Mathematical Functions

ABS absolute value

AINT truncation (also TRUNC)

ALOG natural logarithm (also LN or LOG)

ALOG10 base 10 logarithm (also LG10 or LOG10)

AMOD remainder of division (also MOD)

EXP exponentiation (base e)

FEQ compares two floating point numbers within a tolerance

RAND random uniform number (0-1) (also RANF)

REAL4 returns the REAL*4 value of a REAL*8 number

RND rounding

SIGN transfer of sign

SQRT square root

TRUNC truncates least significant digits


Argument List Functions

CNT count the number of arguments that are not missing

FST return the first argument that is not missing

LST return the last argument that is not missing

MAX return the largest argument that is not missing

MEAN compute the mean of the arguments that are not missing

MIN return the smallest argument that is not missing

STDEV compute the standard deviation of nonmissing values

SUM compute the sum of all arguments that are not missing


Across Record Functions

The "across records" functions may only appear in PROCESS REC or PROCESS ROW blocks . They compute a result based on a single variable in each record or row processed in the PROCESS REC or PROCESS ROW block. They ignore values that are missing or undefined. Records that contain missing or undefined values are not counted nor are they used in the calculation of averages.

CNTR counts the number of times the variable occurs.

FSTR returns the first value processed.

LSTR returns the last value processed

MAXR returns the largest value processed

MEANR computes the average value (SUMR / CNTR)

MINR returns the smallest value

STDEVR computes the standard deviation

SUMR computes the sum of values


Date and Time Functions

CDATE converts a date string to a date integer

CTIME converts a time string to a time integer

DATEC converts a date integer to a date string

DATET returns the current date and time as a string

JULC converts a date integer to a date string

JULN converts day, month, and year to a date integer

NOW returns the current time as a time integer

TIME converts hours, minutes, and seconds to a time integer

TIMEC converts a time integer to a time string

TODAY returns current date as a date integer


Global Functions

DGLOBAL Deletes a global variable

DSN Returns a full filename associated with an attribute

GLOBALN Assigns a numeric value to a global variable

GLOBALS Assigns a string value to a global variable

NARG Returns a numeric argument from run parameter list

NGLOBAL Returns the value of a global numeric variable

SARG Returns a string argument from run parameter list

SGLOBAL Returns the value of a global string variable


String Functions

CAPITAL Capitalises the first letter of each word in string

CATINT Returns an integer value of a categorical variable

CATSTR Returns a string value of a categorical variable

CENTER Returns a centred string

CHAR Returns the character with the numeric internal value

COMMA Separates thousands by inserting commas in a numeric string

EDIT Applies editing template to a data string

FILL Replaces blanks in string

FORMAT Converts a number to a string

ICHAR Returns the numeric internal value of a character

LEN Returns the string length in characters

LOWER Converts all characters in string to lower case

NUMBR Converts a string to a number

PACK Returns the string with compressed blanks

PAD Pads a string with character to specified length

PATTERN Returns whether a pattern is found in a string

PFORMAT Converts a number to a formatted string

PICTURE Validates a string by comparing to a picture

REPLACE Replaces substrings with a specified string

REVERSE Returns a string spelled backwards

SBST Returns a substring of a string

SGET Returns the value of a string variable

SPREAD Returns a string with single blanks between characters

SPUT Stores string value in string variable

SRST Searches for a substring

SUBSTR Returns a substring of a string

TRIM Trims trailing blanks from a string

TRIML Deletes blanks from the left

TRIMLR Deletes blanks from the left and the right

TRIMR Deletes blanks from the right

UPPER Converts all characters of string to upper case

VARGET Gets value from string variable where variable name is an expression.

VARPUT Puts value into string variable where variable name is an expression.


Concurrent Functions

CASELOCK Change lock type for and retry current CIR (also CIRLOCK)

RECLOCK Change lock type for and retry current record

SYSTEM(36) Whether current record is locked

SYSTEM(37) Whether current CIR is locked

SYSTEM(38) Whether a concurrent session using Master

SYSTEM(39) Returns the ordinal number of the default database. No Database returns 0


Miscellaneous Functions

ARRDIMN Returns number of dimensions of a local array variable

ARRDIMST Returns start value of a dimension of a local array variable

ARRDIMSZ Returns number of entries of a dimension of a local array variable

EXISTS Indicates if variable exists (not missing or undefined)

ERROR Displays a text message error box

HELP Invokes the Help system

MISNUM Returns the "type" of missing or undefined value

MISSING Returns the original value for missing values

MSGTXT Returns the error message text for an error number

PROGRESS Controls the display of a progress bar

SOUND Produces a tone

SRCH Searches a table of values

SYSTEM Returns various system values such as cpu time used, whether a database access has been successful, etc.

YESNO Displays a text question box and returns response


Session Functions

APPDIR Returns application directory

ATTRNAME Attribute n name (str)

BUFFNAME Buffer n name

CURDIR Returns current directory

DEFFAM Default family (name)

DEFMEM Default member (name)

DELDIR Deletes the named directory

DELFILE Deletes the named file

EDITNAME Editor name

FAMNAME Family n name (string)

FILECNT Returns a count of files in named directory

FILEIN Browses for a file

FILEIS Returns if name exists as file or directory

FILEN Returns the nth file in directory

FILEOUT Browses for an output file

FILESTAT Returns various data about named file e.g. Date/time of creation/access, size of file, etc. Times and dates are in system format

FILETIME Returns various data about times of creation/access of file with times and dates converted to SIR formats

GETENV Gets a string environment variable value

GLOBNAME Gets the numeric value from named global

MAKEDIR Creates a directory

MEMCOUNT Count of members in family

MEMNAME Name of nth member

NSUBDIR Name of nth subdirectory

OUTFNAME Name of current output file

PAGELEN Length of output page

PAGENO Current output page number

PAGEWIDWidth of output page

PROCFILE Procedure file filename

PROCNAME Procedure file attribute name

RACCESS Returns the read access level of user

RNMFILE Renames a file

SETDIR Sets current directory

SETRC Sets a return code

SUBDIR Concatenates a subdirectory to existing directory path in correct system specific manner

SYSTEM Returns various "system" status values

UPGET Gets User Preference (from INI file)

UPSET Sets User Preference (in INI file)

WACCESS Returns the write access level of user

WINCNT Returns the number of lines in the output window

WINLIN Returns the nth line from the output window

WINMOVE Moves and resizes the main window

WINPOS Moves to line in output window

WINSELL Returns selected line from output window

WINSELP Returns position in line selected from output window


Schema & Database Functions

COUNT Number of records of a given type in the current case

DATEMAP Returns the date map of a date variable

DBINDN Name of nth index on default database

DBINDR Number of record type indexed

DBINDS Number of indexes on default database

DBINDT Name of the nth variable in index followed by either ASC or DESC and UPPER if uppercase index

DBINDU Returns 1 if index is unique

DBINDV Number of variables in index

DBNAME Name of the nth database

DBTYPE Returns database type, case or caseless

JOUFLAG Returns whether journalling is on for default database

KEYNAME Returns name of a record type key field

KEYORDER Returns sort order ("A" or "D") of a key field

MAXRECS Returns the maximum allowed number of a particular record type

MISS Returns the original (string) for missing values (0 - 3) for a variable

MKEYSIZE Returns the size of the largest record key in the database

MRECSIZE Returns size of the largest record in the database

NKEYS Returns the number of key fields for a record type

NLABELS Synonym for NVALLAB. Returns the number of variable value labels defined for a variable

NMAX Returns the maximum value of a numeric variable range

NMIN Returns the minimum value of a numeric variable range

NOFCASES Returns the maximum number of cases for the database

NRECS Returns the maximum number of record types for the database

NUMCASES Returns the number of cases in the database

NUMRECS Returns the number of records of a given type in the database

NVALID Returns the number of defined valid values for a variable

NVALLAB Returns the number of variable value labels defined for a variable

NVARLAB Returns the number of lines of variable labels defined for a variable

NVARS Returns the number of variables for the specified record type

NVARSC Returns the number of variables including common vars for the specified record type

NVVAL Returns the nth valid value of a numeric variable

RECDOC Returns the nth line of documentation for a record

RECDOCN Returns the number of lines of documentation for a record

RECLEVEL Returns the update level at which a record was last written to database

RECNAME Returns the name of the record type

RECNUM Returns the number of the record name

RECSIZE Returns the record size of a specified record type

RKEYSIZE Returns the key size of a specified record type

RRECSEC Returns the read security level of a record type

RVARSEC Returns the read security level of a variable

SMAX Returns the maximum value of a string variable range

SMIN Returns the minimum value of a string variable range

STATTYPE Returns whether a numeric variable is defined as observation, control or neither

SVVAL Returns the nth defined string valid value of a variable

TIMEMAP Returns the time map string format of a time variable

UPDLEVEL Returns the current update level of database

VALIDATE Validates a value of a database variable against schema

VALLAB Returns the value label for the current value of a variable

VALLABSC Returns the value label for a specified value of a variable

VALLABSN Returns the nth value label of a variable

VALLABSP Returns the number (nth) of the value label associated with a specified value of a variable.

VALLABSV Returns a string which is the nth value associated with value labels of a variable.

VARLAB Returns the variable label for a variable

VARLABSC Returns the variable label of a specified variable (first 40 chs)

VARLABSN Returns the nth line of a variable label of a specified variable

VARNAME Returns the name of the variable using counts excluding common vars.

VARNAMEC Returns the name of the variable using counts including common vars.

VARPOSIT Returns the input position of the variable

VARTYPE Returns the storage type of a variable (string or numeric)

VFORMAT Returns a string representing the variable input format

VTYPE Returns the SIR data type of a variable (7 types)

WRECSEC Returns the write security level of a record type

WVARSEC Returns the write security level of a variable


Tabfile & Table Functions

TABINDNIndex name of nth index

TABINDS Number of indexes on nth table

TABINDT Variable name and seq of nth variable on index

TABINDU If nth index is unique

TABINDV Number of variables in nth index

TABNAME Name of nth table

TABRECS Number of rows on nth table

TABVARS Number of cols (variables) in nth table

TABVINFN Various numeric data about column

TABVINFS Various string data about column

TABVNAME Column name

TABVRANG Value of valid/missing range for column

TABVTYPE Column type

TABVVALI Validates table column

TABVVLAB Value label for table column

TABVVVAL Value label value for table column

TFACCESS Access a(uto),r(ead) w(rite) of nth tabfile

TFATTR Internal attribute name of nth tabfile

TFCOUNT Number of connected tabfiles

TFFILE Filename of nth tabfile

TFGRNAME Group name of nth tabfile

TFGRPW Group password of nth tabfile

TFJNNAME Journal name of nth tabfile

TFNAME Name of nth tabfile

TFTABS Number of tables on nth tabfile

TFUSNAME User name of nth tabfile

TFUSPW User password of nth tabfile


Read/Write Functions

NGET Gets the value of a numeric variable

NPUT Stores a value in a numeric variable

NREAD Pops up a box on the screen with a prompt and returns a number from the user

SGET Gets the value of a string variable

SPUT Stores a value in a string variable

SREAD Pops up a box on the screen with a prompt and returns a string from the user

TWRITE Writes a string to the scrolled output window


Menu Functions

GETMCHK Tests the state of a menu or toolbar item

Dialog

FINDITEM Search list for text

GETBTNH Returns the height of button control

GETCHCH Returns the height of choice control

GETCHKH Returns the height of check control

GETFLT Gets floating point as per GETTXT

GETFOCUS Returns id of control with focus

GETICHK Returns check or radio state

GETIFLT Returns floating point from a list

GETIINT Returns integer of item from a list

GETINT Gets integer as per GETTXT. 0 if not integer

GETITXT Returns text of item from a list

GETLBLH Returns the height of labels

GETLTXT Gets the text from a line in a multi-line text control

GETMAXCH Returns the height of the maximum single line control

GETMSEL Returns pos of nth selected item from multiple selection

GETNITEM Returns number of items in choice or list

GETNLINE Gets number of lines in multi-line text control

GETNSEL Returns number of items selected in multiple selection

GETPOS Returns pos of current selection in list or choice or keyboard focus in multiple selection

GETRADH Returns the height of radio control

GETRSTEP Returns the size of the row step

GETTXT Gets text from edit and from highlighted item in choice or list. (Gets label text from label, button, check and radio)

GETTXTH Returns the height of text control

IDSTATUS Returns the status of a control

SETPOS Sets a position in a gui multi-line item

Dialog Editor

DITEM... There are a number of functions which return information about items on a DEDIT dialog, that is a dialog used for screen painting. These functions are all named DITEMxxx.


Client Server Functions

COLCOUNT Returns a count of columns created by the execute

COLLABEL Returns the label of a specific column created by the execute

COLLEN Returns the length of a specific string column created by the execute

COLNAME Returns the name of a specific column created by the execute

COLTYPE Returns the type of a specific column created by the execute

COLVALN Returns the numeric value of a specific column created by the execute

COLVALS Returns the string value of a specific column created by the execute

DELMCLID Deletes the client from Master.

GETDFC Returns the difference file copy interval from Master.

GETERR Returns the oldest error posted for this application and deletes the message.

GETMCADD Returns the client tcp/ip address from Master.

GETMCLID Returns the nth client id from Master.

GETMCLST Returns the time of last message for nth client from Master.

GETMCON Returns the time of log on for nth client from Master.

GETMDBN Returns the name for nth database from Master.

NEXTROW Steps through the rows one at a time

ODBCTABS Produce list of tables on the data source

ODBCCOLS Produce list of columns from the named table on the data source

ROWCOUNT Count of rows created by the execute

SETDFC Sets the difference file copy interval for Master.


CGI Functions

Buffer functions return number of lines. All parameters are string expressions.

CGIBUFPN Get buffer of value of parameter

CGIBUFPN Get buffer of value of parameter

CGIBUFSV Get buffer of value of server variable

CGIVARPN Get parameter value

CGIVARSV Get server variable value


List of Functions from A to Z

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

ABS

num = ABS( X )

Returns the absolute value of X.

ACOS

num = ACOS( X )

Returns the arc cosine of X. The result is in the range 0 to PI radians. Values of X outside the range -1<X>1 return undefined.

AINT

num = AINT( X [,n] )

Returns the truncated value of X. If n is omitted or 0, truncates to an integer value. If n is specified, truncates to that power of 10. e.g. AINT (1266,2) truncates to 1200, AINT(1.266,-2) truncates to 1.26.

ALOG

num = ALOG( X )

Returns the natural logarithm (base e) of X. Values less than or equal to zero return undefined.

ALOG10

num = ALOG10( X )

Returns the base 10 logarithm of X. Values less than or equal to zero return undefined.

AMOD

num = AMOD(X , Y)

Returns the remainder of X divided by Y. If Y is zero, undefined is returned.

APPDIR

str = APPDIR(0)

Returns SIR2002 application directory. That is the directory where the SIR executables are installed.

ARCOS

num = ARCOS( X )

See ACOS function.

ARRDIMN

num = ARRDIMN(array_name_exp)

Returns the number of dimensions for specified local array variable.

ARRDIMST

num = ARRDIMST(array_name_exp,dim)

Returns the start value for the specified dimension for specified local array variable (normally 1 unless array specified to start at different value).

ARRDIMSZ

num = ARRDIMSZ(array_name_exp,dim)

Returns the size of the specified dimension for specified local array variable.

ARSIN

num = ARSIN( X )

See ASIN function.

ASIN

num = ASIN( X )

Returns the arc sine of X. The result is in the range -pi/2 to +pi/2 radians. Values outside the range-1<X>1 return undefined.

ATAN

num = ATAN( X )

Returns the arctangent of X. The result is in the range -pi/2 to +pi/2 radians.

ATTRNAME

str = ATTRNAME(n)

Returns the nth Attribute name (SYSTEM(52) = attribute count).

BUFFNAME

str = BUFFNAME(n)

Returns the nth Buffer name (SYSTEM(56) = buffer count).

CAPITAL

str = CAPITAL( str )

Capitalises the first alphabetic character of the string and the first alphabetic character following a blank. All other characters remain unedited. For example:

NAME = 'this is the first day of the week'
NAME = CAPITAL(NAME)
Returns: This Is The First Day Of The Week

CASELOCK

num = CASELOCK(locktype)

Changes the lock type for the current Case (CIR) and attempts to read the current CIR from the database. See SYSTEM(37) function to determine if current CIR is locked. The locktype codes are (any other values set concurrent read):

1 = Exclusive
2 = Concurrent Read
3 = Concurrent Write
4 = Protected Read
5 = Protected Write
6 = Exclusive

CATINT

num = CATINT(A, B)

Returns an integer corresponding to the category in categorical variable A that B matches. A and B may be variables, string constants or expressions. Returns a zero if no match is found.

CATSTR

str = CATSTR(A)

Returns a string corresponding to the current value of the specified categorical variable.

CDATE

num = CDATE(X , date format)

Returns the date integer equivalent to the date string X which may be a string constant, variable or expression. The date format is a string constant consisting of a combination of the letters M(month), D(day), Y(year) and I(ignore). If the month or day field is omitted, the assumed value is 1. If fewer than four Y's are specified, the following applies:

With three Y's, the millennium is taken as 1nnn for values above 583 and 2nnn for values below this:

With two Y's, if the year is greater than the year specified in the CENY parameter, the century is taken as the century specified in the parameter otherwise the century is one greater.

With a single Y, the decade is taken as this decade.

If a date earlier than October 15, 1582 is specified, undefined is returned. Example:
INTDATE = CDATE('06/03/94', 'MMIDDIYY')

CENTER

str = CENTER(X , strY)

Returns string strY centred in a string X characters in length. Example:

RESULT = CENTER(9, 'ABC')

returns:  "   ABC   ".

CGIBUFPN

n = CGIBUFPN(buf,pn)

Used when dealing with CGI from webserver. Puts value of CGI parameter into named buffer. Returns number of lines. Parameters are string expressions.

CGIBUFSV

n = CGIBUFSV(buf,sv)

Used when dealing with CGI from webserver. Puts value of server variable into named buffer. Returns number of lines. Parameters are string expressions.

CGIVARPN

str = CGIVARPN(pn)

Used when dealing with CGI from webserver. Returns named parameter value in string variable. Parameter name is a string expression.

CGIVARSV

str = CGIVARSV(sv)

Used when dealing with CGI from webserver. Returns named server variable value in string variable. Server variable name is a string expression.

CHAR

str = CHAR(N)

Returns a single character. The character returned is the character whose internal value is N. (See the ICHAR function.) If N is larger than 255, N is divided by 256 and the remainder is taken. This gives the set of standard characters. If N is missing, a null string is returned (length 0).

CIRLOCK

See CASELOCK function

CNT

num = CNT(X1 , X,..... , Xn)

Counts the number of values in a list that exist (not missing or undefined). There may be up to 128 numeric variables in the list. Returns zero (0) if no values exist.

CNTR

num = CNTR( X )

Returns the number of values of X found during a PROCESS REC or PROCESS ROWS loop that are not missing or undefined. Returns zero if all values are missing or undefined.

COLCOUNT

num = COLCOUNT (conid,statid)

Client/Server function. Returns a count of columns created by the execute.

COLLABEL

str = COLLABEL (conid,statid,colno)

Client/Server function. Returns the label of a specific column created by the execute.

COLLEN

num = COLLEN (conid,statid,colno)

Client/Server function. Returns the length of a specific string column created by the execute.

COLNAME

str = COLNAME (conid,statid,colno)

Client/Server function. Returns the name of a specific column created by the execute.

COLTYPE

num = COLTYPE (conid,statid,colno)

Client/Server function. Returns the type of a specific column created by the execute. This is one of the following:
1 = String
2 = Timestamp string
3 = Date
4 = Time
5 = Integer
6 = R4
7 = R8
8 = Scaled Integer

A timestamp string is a formatted 18 byte string containing a combination date/time as follows:
YYYYMMDDHHMMSStttt where YYYY is the year, MM is the month, DD is the day number, HH is the 24 hour number, MM is the minutes, SS is the seconds and tttt is the thousandths of a second. Any of these components may be zero.

COLVALN

num = COLVALN (conid,statid,rowno,colno)

Client/Server function. Returns the numeric value of a specific column created by the execute. This does not have to be the same type as returned by COLTYPE. e.g. Integers can be assigned to a real.

COLVALS

str = COLVALS (conid,statid,rowno,colno)

Client/Server function. Returns the string value of a specific column created by the execute.

COMMA

str = COMMA( str )

Places a comma between every third digit to the left of a decimal point (actual or implied) in a string with a numeric form. For example, COMMA ('4500000') returns '4,500,000'.

COS

num = COS( X )

Returns the trigonometric cosine of X, where X is measured in radians.

COUNT

num = COUNT( X )

Returns the number of records for record type X within the current case.

CTIME

num = CTIME(X , time format)

Returns the number of seconds from midnight to the given time. Specify a time string X and a time format consisting of the letters H (hours), M (minutes), S (seconds) and I (ignore). The time, X, can be a string constant, variable, or expression. If the hour, minute or second field is omitted, the assumed value is zero. For example:

WINTIME = CTIME('18:36:45', 'HHIMMISS')

CURDIR

str = CURDIR(0)

Returns the current directory.

DATEC

str = DATEC(X , date format)

Returns a date string equivalent to the date integer X formatted according to the date format which is a string constant using the letters M(month), D(day), Y(year) and W(Day of week). All other characters are passed directly to the result string. One or two Ms result in the month number, three or more result in the first n letters of the month name. The case of the letters in the date format (upper or lower), specifies the case of strings returned. For example, DATEC(XBEG, 'Www, Mmm DDth, YYYY') produces a result such as "Thu, May 25th, 2000

DATEMAP

str = DATEMAP (rtnum, varname_exp)

Returns a string with the date map of the specified date variable. If the record number (rtnum) is negative, the function applies to a summary variable. The varname is an expression. If this is a constant, enclose the name in single quotes. Undefined is returned if the variable is unknown or is not a date variable. For example, if the variable BIRTHDAY in record type one has the date map "MM DD YY" defined in the schema, then DATESTR equals "MM DD YY".

DATESTR = DATEMAP (1, 'BIRTHDAY')

DATET

str = DATET(N1 , N)

Returns a 27-character string containing the current date and time. The string is composed of the following substrings:

Date
  1- 3 Day of  the week  (SUN,MON,etc.)
  4- 5 Comma and blank
  6- 8 Month of the year  (JAN,FEB,etc.)
     9 Blank
 10-11 Day of the month
 12-13 Comma and blank
 14-17 Year
 18-19 Comma and blank

Time
 20-21 Hour (1 to 12)
    22 Period
 23-24 Minutes
    25 Blank
 26-27 AM or PM

The two arguments N1 and N are constants in the range 1 to 27 that select a substring of the 27-character string. For example, suppose the current date is May 25, 2000, and the time is 1:05 PM; the day is Thursday.

PROGRAM
TODATE  = DATET (6, 17)
NOWTIME = DATET(20, 27)
WKDAY   = DATET(1, 3)
WRITE TODATE NOWTIME WKDAY
END PROGRAM

OUTPUT:  MAY 25, 2000 01.05 PM THU

DBINDN

str = DBINDN (index)

Returns name of nth index.

DBINDR

n = DBINDR (index)

Returns number of record type indexed by nth index.

DBINDS

n = DBINDS (0)

Returns number of indexes on default database.

DBINDT

str = DBINDT (index,varno)

Name of nth variable in nth index plus ASC/DESC and UPPER.

DBINDU

n = DBINDU (index)

Returns 1 if index is unique.

DBINDV

n = DBINDV (index)

Returns number of variables in nth index.

DBNAME

str = DBNAME (n)

Returns a string with the name of the nth attached database. If n is zero, returns the name of the default database.

DBTYPE

num = DBTYPE (0)

Returns 1 if a case structured database or 0 if caseless.

DEFFAM

str = DEFFAM(0)

Returns the default family name.

DEFMEM

str = DEFMEM(0)

Returns the default member name.

DELDIR

n = DELDIR(dir_name)

Deletes the named directory. Returns 0 for success.

DELFILE

n = DELFILE(file_name)

Deletes the named file (use filename not attribute). Returns 0 for success.

DELMCLID

str = DELMCLID(id,password)

Deletes the client from master. Get the client id from GETMCLID. Specify a password as a string variable or string in quotes if the Master is started with a password.

DGLOBAL

num = DGLOBAL(string_exp)

Deletes a global. The string expression may be the global name enclosed in quotes or a string variable.

DITEM

DITEM...

The DITEM series of functions all pertain to the Dialog Editor which is used to construct screen painting applications.

DITEMCOL

num = DITEMCOL(n) Returns the column the nth DEDIT item is positioned at.

DITEMH

num = DITEMH(n) Returns the height of the nth DEDIT item.

DITEMID

num = DITEMID(n)Returns the id of the nth DEDIT item.

DITEMROW

num = DITEMROW(n) Returns the row the nth DEDIT item is positioned at.

DITEMS

num = DITEMS(0) Returns the number of items on DEDIT dialog.

DITEMSEL

num = DITEMSEL(0) Returns the number of items selected on DEDIT dialog.

DITEMSID

num = DITEMSID(n) Returns the id of the nth selected DEDIT item.

DITEMTXT

str = DITEMTXT(n) Returns the text of the nth DEDIT item.

DITEMTYP

num = DITEMTYP(n) Returns the type of control of the nth DEDIT item.

DITEMW

num = DITEMW(n) Returns the width of the nth DEDIT item.

DSN

str = DSN( string_exp )

Returns the operating system filename of an attribute. The attribute may be a variable or constant.

EDIT

output_str = EDIT( input_str,edit_str )

EDIT applies an edit string to data to produce the output. The edit string is made up of circumflexes ( ^ ), which represent a character of the input string, and any other characters to insert. Example:

PROGRAM
SSN = EDIT('123456789','^^^-^^-^^^^')
WRITE SSN STOP
END PROGRAM

Output: 123-45-6789

EDITNAME

str = EDITNAME(0)

Returns the name of the current text editor.

ERROR

num = ERROR( strX )

Displays an error box with the specified text and waits for acknowledgment.

EXISTS

num = EXISTS( X )

Returns 1 if X exists, 0 if X is missing or undefined. To test several numeric variables for existence, use the CNT function.

EXP

num = EXP( X )

Returns the value of e raised to the X power. e is the constant 2.71828.

FAMNAME

str = FAMNAME(n)

Returns the nth family name in the default procfile. (SYSTEM(57) = Count of families).

FEQ

str = FEQ(real1,real2,exponent)

Tests two floating point numbers for equality within a limit of accuracy. The function returns 0 if approximately equal, 1 if unequal. For example, if the exponent was -3, the numbers would be equal if within .001.

FILECNT

n = FILECNT(str)

Counts the files in the directory given by name. Specify a mask like '*.pql' for the count of those files in the current directory.

FILEIN

str = FILEIN(filter,default_extension)

Displays a file browse box for user to choose existing file. Returns zero length string if user cancels.

FILEIS

n = FILEIS(file_name_string)

Tests if file exists. Returns -1 if name is a directory; 0 if no such name; 1 if file exists.

FILEN

str = FILEN(string,n)

Returns the nth file name in the given directory (or mask).

FILEOUT

str = FILEOUT(filter,default_extension)

Displays a file browse box for user to choose output file. Returns zero length string if user cancels.

FILESTAT

n = FILESTAT(filename_string,type_of_data)

Returns various system specific data about a named file.
Type of data
1 gid Numeric identifier of group that owns file (UNIX-specific)
2 st_atime Time of last access of file. (system date/time integer)
3 st_ctime Time of creation of file. (system date/time integer)
4 st_dev Drive number of the disk containing the file (same as st_rdev).
5 st_ino Number of the information node (the inode) for the file (UNIX-specific).
6 st_mode Bit mask for file-mode information. The _S_IFDIR bit is set if path specifies a directory; the _S_IFREG bit is set if path specifies an ordinary file or a device. User read/write bits are set according to the file's permission mode; user execute bits are set according to the filename extension.
7 st_mtime Time of last modification of file. (system date/time integer)
8 st_nlink Always 1 on non-NTFS file systems.
9 st_rdev Drive number of the disk containing the file (same as st_dev).
10 st_size Size of the file in bytes; (Can exceed I4 in size)
11 uid Numeric identifier of user who owns file (UNIX-specific)

FILETIME

n = FILETIME(filename_string,type_of_data)

Returns SIR times or dates about a file
Type of data
1 Time of last access of file. (SIR time integer)
2 Date of last access of file. (SIR date integer)
3 Time of creation of file. (SIR time integer)
4 Date of creation of file. (SIR date integer)
5 Time of last modification of file. (SIR time integer)
6 Date of last modification of file. (SIR date integer)

FILL

str = FILL(strX , strY)

Replaces all blank characters in strX with the first character of string argument strY. The length of strX does not change. For example:

RESULT = FILL ('  $100.00', '*')
returns  "**$100.00"

FINDITEM

num = FINDITEM (id,pos,txt)

Search dialog choice or list for text and return position. Can start from partway through.

FORMAT

str = FORMAT( X [,W [,D ]] )

Converts X to a string. FORMAT( X ) returns free-field format as wide as necessary to fit the value. FORMAT(X,W) returns a free field format of width W. FORMAT(X,W,D) returns a number with D decimal places in width W. X, W and D, can be variables, constants or expressions. W, if specified, must be greater than or equal to zero. D, if specified, can be -1 or greater than or equal to zero. -1 is equivalent to not specifying a value (free field format). If D is specified, W must be greater than D. For example:

STR = FORMAT (1.3)       returns  '1.3'
STR = FORMAT (1.3, 4)    returns  ' 1.3'
STR = FORMAT (1.3, 5, 2) returns  ' 1.30'

FST

num = FST( X1, X.., Xn )

Returns the first value in the list of up to 128 numeric variables that is not missing or undefined.

FSTR

num = FSTR( X )

Returns the first value of X encountered during a PROCESS REC or PROCESS ROWS loop that is not missing or undefined.

GETBTNH

num = GETBTNH (0)

Returns the height of button control (for positioning).

GETCHCH

num = GETCHCH (0)

Returns the height of choice control( for positioning).

GETCHKH

num = GETCHKH (0)

Returns the height of check control( for positioning).

GETDFC

n = GETDFC(0)

Returns time (from Master) of difference file copy interval in minutes.

GETENV

str = GETENV(variable_str)

Returns the value of the named environment variable.
COMPUTE OSPATH = GETENV('PATH')

GETERR

str = GETERR (0)

Client/server function. Returns the oldest error posted for this application and deletes the message. Returns a zero length string if no messages. Errors are not specific to a connection or statement, rather they are posted for this instance of SIR2002 and, if errors are not retrieved when an error condition occurs, multiple error messages may be waiting. One logical error may also give rise to multiple error messages from the server.

GETFLT

dbl = GETFLT (id)

Gets floating point as per GETTXT. Returns 0.0 if not f.p. number.

GETFOCUS

num = GETFOCUS (0)

Returns id of control with focus.

GETICHK

num = GETICHK (id)

Returns check or radio state.

GETIFLT

dbl = GETIFLT (id,pos)

Returns floating point from a list.

GETIINT

int = GETIINT (id,pos)

Returns integer of item from a list.

GETINT

int = GETINT (id)

Gets integer as per GETTXT. 0 if not integer.

GETITXT

str = GETITXT (id,pos)

Returns text of item from a list.

GETLBLH

num = GETLBLH (0)

Returns the height of labels ( for positioning).

GETLTXT

str = GETLTXT (id,p)

Gets the text from a line in a multi-line text control.

GETMAXCH

num = GETMAXCH (0)

Returns the height of the maximum single line control ( for positioning).

GETMCADD

str = GETMCADD (id)

Returns tcp/ip address for client from master.

GETMCHK

num = GETMCHK (id)

Returns check state from menu item.

GETMCLID

n = GETMCLID (n)

Returns id for nth client from master.

GETMCLST

n = GETMCLST (n)

Returns time of last message for nth client from master.

GETMCON

n = GETMCON (n)

Returns time of log on for nth client from master.

GETMDBN

str = GETMDBN (n)

Returns name of nth database from master.

GETMSEL

num = GETMSEL (id,N)

Returns pos of nth selected item from multiple selection.

GETNITEM

num = GETNITEM (id)

Returns number of items in choice or list.

GETNLINE

num = GETNLINE (id)

Gets number of lines in multi-line text.

GETNSEL

num = GETNSEL (id)

Returns number of items selected in multiple selection.

GETPOS

num = GETPOS (id)

Returns pos of current selection in list or choice or keyboard focus in multiple selection.

GETRADH

num = GETRADH (0)

Returns the height of radio control( for positioning).

GETRSTEP

num = GETRSTEP (0)

Returns the size of the row step ( for positioning).

GETTXT

str = GETTXT (id)

Gets text from edit and from highlighted item in choice or list. (Gets label text from label, button, check and radio!).

GETTXTH

num = GETTXTH (0)

Returns the height of text control ( for positioning).

GLOBALN

num = GLOBALN(globvar_exp , numeric_exp)

Assigns a numeric value to a global variable. The first argument is the name of the global variable, the second argument is the numeric expression (or variable name). For example: To assign the global variable RT the value 25.5:

COMPUTE Y = GLOBALN('RT', 25.5)

GLOBALS

num = GLOBALS(stringexp , stringexp)

Assigns a string value to a global variable. The first argument is the name of the global variable, the second argument is the string expression (or variable name). For example: To assign the global variable TEMP the value JOE SMITH:

COMPUTE Y = GLOBALS ('TEMP','JOE SMITH')
GLOBALN and GLOBALS return:

0 if the assignment was made.

-1 if the first argument is not a valid global variable name.

-2 if the second argument is missing.

Do not try to use the value of globals set by GLOBALN or GLOBALS for text substitution in the same program (by using the global variable name within angle brackets) because the functions work at execution time and text substitution happens at compile time.

GLOBNAME

str = GLOBNAME(n)

Returns the name of the nth global variable. (SYSTEM(53) = Global Count).

HELP

error = HELP( help page )

Invokes the HELP system, beginning with the specified help page. The page must be in html format in the help directory. The page name can contain directory names using forward slashes to delimit. Enclose the name in quotes. The system will convert this to a file name prefixed with a path pointing to the help directory and suffixed with the file extension .htm. For example:

COMPUTE X = HELP ('visualpql/function/foreword')

ICHAR

num = ICHAR(C)

Returns a numeric value equivalent to the position in the character collating sequence of the first character in string C. The character collating sequence for a given computer is the set of numeric codes used for internal character representation (such as ASCII or EBCDIC).

IDSTATUS

num = IDSTATUS(id)

Returns the status of a gui element.

JOUFLAG

num = JOUFLAG (0)

Returns whether the journalling option is on (1) or off (0) for the database.

JULC

str = JULC( X )

Converts a "date integer", X, into an 12-character string of the form 'MMM DD, YYYY'.

JULN

num = JULN( X , Y , Z)

Returns a "date integer" where the three numeric arguments X, Y and Z, stand for month, day and year, respectively. A "date integer" is the number of days since the start of the Gregorian calendar on October 15, 1582. If Z is in the range 0 - 99, the year is 1900 + Z. If Z is in the range 100 - 999, the year is 1000 + Z. A value of undefined is returned if a date earlier than October 15, 1582 is specified by X, Y and Z. For example:

DURATION  =  JULN(4, 8, 87) - BEGINDAT
ENDPROJ = JUNL(TMON, TDAY, TYEAR)

KEYNAME

str = KEYNAME (rtnum, keynum)

Returns the name of the specified keyfield for the specified record type. RTNUM is the record number. KEYNUM is the number of the keyfield, i.e 1 is the case id, 2 is the first key field in the record type, etc.

KEYORDER

str = KEYORDER (rtnum, varname_string)

Returns "A" or "D" for the sort order of the specified keyfield. The variable name argument is an expression.

LEN

num = LEN( strX )

Returns an integer value that is the length, in characters, of the string strX, leading and trailing blanks included.

LN

num = LN( X )

See ALOG function.

LOG

num = LOG( X )

See ALOG function.

LOG10

num = LOG10( X )

See ALOG10 function. (LG10 is also allowed.)

LOWER

str = LOWER( string )

Returns the string with all characters converted to lower case.

LST

num = LST(X1 , X ,....., Xn)

Returns the last value in the list that is not missing or undefined. The maximum number of variables allowed in the argument list is 128. Arguments must be numeric.

LSTR

num = LSTR( X )

Returns the last value of X encountered in a PROCESS REC or PROCESS ROWS loop that is not missing or undefined.

MAKEDIR

num = MAKEDIR(name)

Creates a new directory using the name. Returns -1 if the directory cannot be created.

MAX

num = MAX(X1 , X ,....., Xn)

Returns the largest value in the list that is not missing or undefined. The maximum number of variables allowed in the argument list is 128.

MAXR

num = MAXR( varname )

Returns the largest value of the specified variable encountered during a PROCESS REC or PROCESS ROWS loop that is not missing or undefined.

MAXRECS

num = MAXRECS( rectype )

Returns the maximum number of records allowed for this record type.

MEAN

num = MEAN(X1 , X ,....., Xn)

Returns the mean (arithmetic average), of the values within the list that are not missing or undefined. The maximum number of variables allowed in the argument list is 128.

MEANR

num = MEANR( varname )

Returns the mean (arithmetic average), for the values of the specified variable encountered during a PROCESS REC or PROCESS ROWS loop that are not missing or undefined.

MEMCOUNT

num = MEMCOUNT(famname)

Returns the count of members in the named family of the default procfile.

MEMNAME

str = MEMNAME(famname,n)

Returns the name of the nth members in the named family of the default procfile.

MIN

num = MIN(X1 , X ,..., Xn)

Returns the smallest value within the list that is not missing or undefined. The maximum number of variables allowed in the argument list is 128.

MINR

num = MINR( varname )

Returns the smallest value of the specified variable encountered during a PROCESS REC or PROCESS ROWS loop that is not missing or undefined.

MISNUM

num = MISNUM( X )

If X is undefined, 0 is returned. If X is missing, the missing type is returned (1 to 3). If X is neither missing nor undefined, undefined is returned. X may be a numeric or string variable.

MISS

str = MISS (rtnum, varname_str , n)

Returns the original value for undefined and first, second and third missing values (as a string), where n is 0, 1, 2, or 3. If the record number (rtnum) is negative, the function applies to a summary variable.

MISSING

num|str = MISSING(varname)

Returns the original value of a variable if it is missing, otherwise undefined is returned. If the variable is a time, date, or categorical integer, the original string value is returned. If the variable is an integer or floating point variable, the original numeric value is returned. If the argument is not a single variable name, undefined is returned.

MKEYSIZE

num = MKEYSIZE (0)

Returns the maximum key size in bytes for the database. The key for a record is comprised of the case identifier (in a case structured database), the record type number, and the keyfields defined for the record type (if any). Refer to the schema definition command MAX KEY SIZE for more information about maximum key size.

MOD

See AMOD function.

MRECSIZE

num = MRECSIZE (0)

Returns the size of the largest record type in the database. Size is expressed in the number of SIR "double words".

MSGTXT

str = MSGTXT (num)

Returns the text of the error or warning massage given by the number num.

NARG

num = NARG( num )

Returns numeric arguments from the command parameter list. (String parameters are retrieved with the SARG function.)

The argument is the position of the parameter in the list. An argument value of zero returns the number of parameters in the list. If the argument is greater than the number of parameters in the parameter list or the argument is a string, undefined is returned. For example, to return the value of the third argument of the parameter list which must be numeric:

COMPUTE ARG4 = NARG(3)

NEXTROW

num = NEXTROW (conid,statid)

Client/server function. Steps through the rows one at a time. This must be issued before getting data for the first row. Returns the row number or zero if no more rows.

NGET

num = NGET( varname_str )

Returns the value of the specified numeric variable. The variable name is specified as a string variable, quoted string constant or string expression whose value is the name of a common, record or program variable.

NGLOBAL

num = NGLOBAL( C )

Returns the value of numeric global parameters. C is a character variable, constant or expression whose value specifies the name of the global parameter. If C is not a defined global parameter, undefined is returned. String global parameters are retrieved with SGLOBAL. For example, to set the variable NVAL to the value of global parameter RACETIME:

COMPUTE NVAL = NGLOBAL ('RACETIME')

NKEYS

num = NKEYS ( rtnum )

Returns the number of keyfields (sort-ids) for the specified record type (excluding the case id).

NVALLAB

num = NVALLAB ( rtnum , varname_str )

Returns the number of value labels defined for a variable. NLABELS is a synonym. If the record number (rtnum) is negative, the function applies to a summary variable. See VALUE LABELS for more information about value labels.

NVARLAB

num = NVARLAB ( rtnum , varname_str )

Returns the number of lines of documentary labels defined for a variable. If the record number (rtnum) is negative, the function applies to a summary variable. See VAR LABELS for more information about variable labels.

NMAX

num = NMAX ( rtnum , varname_str )

Returns the highest valid numeric value for the specified variable. If the record number (rtnum) is negative, the function applies to a summary variable. See VAR RANGES for more information about valid ranges.

NMIN

num = NMIN (rtnum, varname_str)

Returns the lowest valid numeric value for the specified variable. If the record number (rtnum) is negative, the function applies to a summary variable. See VAR RANGES for more information about valid ranges.

NOFCASES

num = NOFCASES (0)

Returns the current maximum number of cases as defined in the schema See N of CASES for more information.

NOW

num = NOW(0)

Returns a "time integer" representing the current time of day as the number of seconds since midnight. The argument is a dummy argument, specify zero.

NPUT

num = NPUT ( A , Y )

Stores the value of numeric argument Y in numeric variable A. A is a string variable name, quoted string constant or string expression whose value is the name of a common, record, or program variable. The value returned by the function is the value actually stored in A (possibly undefined, missing, etc.). If A refers to a common or record variable, the Retrieval must be in update mode. The following example stores 175 in the variable Height:

COMPUTE DUMMY = NPUT('HEIGHT', 175)

NREAD

num = NREAD( strX )

Pops up a box on the screen with a prompt and returns a number from the user.

If a non-numeric field is entered, a message is issued and the user is prompted again.

NRECS

num = NRECS (0)

Returns the maximum number of record types for the database which is the maximum possible number of record types, not the actual number of record types defined for the database.

NSUBDIR

str = NSUBDIR (n)

Returns the name of the nth sub-directory.

NUMBR

num = NUMBR( strX )

Returns the numeric value of the string strX, where strX is a string constant, variable name or expression which contains only numerical characters, at most one decimal point and a plus or minus sign or is in E+exponent format.

NUMCASES

num = NUMCASES (0)

Returns the number of cases in the database. Same as functions SYSTEM(24) or NUMRECS(0).

NUMRECS

num = NUMRECS ( rtnum )

Returns the number of records of the specified record type.

NVALID

num = NVALID ( rtnum , varname_str )

Returns the number of valid values for the specified variable. If the record number (rtnum) is negative, the function applies to a summary variable.

NVARS

num = NVARS ( rtnum )

Returns the number of variables (not Common) defined in the specified record type.

NVARSC

num = NVARSC ( rtnum )

Returns the number of variables (including Common) defined in the specified record type.

NVVAL

num = NVVAL ( rtnum , varname_str , n )

Returns the value of the nth valid value of a numeric variable. If the record number (rtnum) is negative, the function applies to a summary variable.

ODBCCOLS

num = ODBCCOLS (conid,statid,tabname)

Client/server function. Does an ODBC query which produces a result set which contains a list of columns from the named table on the data source and can be interrogated using the standard functions.

ODBCTABS

num = ODBCTABS (conid,statid)

Client/server function. Does an ODBC query which produces a result set which contains a list of tables on the data source and can be interrogated using the standard functions.

OUTFNAME

str = OUTFNAME (0)

Returns the name of the default output file.

PACK

str = PACK ( strX )

Returns a string with leading and trailing blanks deleted and multiple blanks compressed into one blank. The argument strX may be a string constant, variable name or string expression.

PAD

str = PAD( input, pad , len , trunc)

Pads the input string with the specified pad character to the pad length and then truncates the string to the truncation length.

PAGELEN

n = PAGELEN(0)

Returns the current setting for page length (length of page on output file).

PAGENO

n = PAGENO(0)

Returns the current page number on output file.

PAGEWID

n = PAGEWID(0)

Returns the current setting for page width (width of page on output file).

PATTERN

num = PATTERN (strX , pattern_str)

Returns 1 if the pattern specified by pattern_str is in strX, otherwise 0. Both arguments are strings and can be variables, constants or expressions. The pattern can contain the match anything character "@". Undefined is returned if either argument is missing or undefined. For example, the following returns 1.
THERE = PATTERN ('Mr. Ralph Jones', 'Mr.@Jones@')

PFORMAT

str = PFORMAT( num , format_str )

formats a number according to a picture clause, returning a string. (Picture clauses are the same as those used on the WRITE command.) The following special picture characters are recognised:

9 - digit or blank (for fill to the left)
z - digit or zero  (for fill to the left)
c - character
u - uppercase character
l - lowercase character

The format string may also contain asterisks (*), commas (,), decimal point (.), and dollar signs ($). In the following example, If SALARY equals 2500, then SALSTR equals " $2500.00".
SALSTR = PFORMAT(SALARY, '$zzzz.zz')

PICTURE

num = PICTURE( str , pstr )

Validates a string according to a specified picture string. The picture string ( pstr ) is composed of character codes and characters that must be matched exactly. Note: the character codes are lower case. They are:

a - any letter
d - any digit
n - any letter or digit
s - numeric value components (0-9, decimal point,+,+"",E)
u - any uppercase letter
l - any lowercase letter
x - any character

The first example returns a 0 showing the picture is correct. The second example returns a 6 to show that the picture fails in the sixth position:

X = PICTURE ('123-45-6789','ddd-dd-dddd')
X = PICTURE ('123-45-67',  'ddd-d-ddd')

PROCFILE

str = PROCFILE(0)

Returns the filename of the default procfile (eg: c:\SIR2002\company.sr4)

PROCNAME

str = PROCNAME(0)

Returns the attribute of the default procfile (eg: SIR054)

PROGRESS

num = PROGRESS ( type,percent )

Controls the display of a progress bar.
x = PROGRESS (0,0) initiates the display.
x = PROGRESS (1,n) displays progress up to n where n is a percentage from 1 to 100.
x = PROGRESS (2,0) closes the display.
The initiation, updating and closing do not have to be in the same VisualPQL program. Once initiated in a program, the progress display is closed only by this function, not automatically at the end of the program and thus can be used to display progress through a suite of programs. If the progress display has not been initiated, the function has no effect.

RACCESS

num = RACCESS (0)

Returns the read security access level of the current user. That is the level corresponding to the read security password of the user.

RAND

num = RAND(0)

Returns a uniform random number between 0 and 1. The argument is a dummy argument. For a given seed, the same sequence of random numbers is generated. To alter the default seed, specify a seed on the RETRIEVAL or PROGRAM command.

RANF

See RAND function.

REAL4

num = REAL4(real*8)

Converts a real*8 into a real*4 number.

RECDOC

num = RECDOC(recno,lineno)

Returns the nth line of documentation for the record. If the record number is zero, the function returns the nth line of database level documentation.

RECDOCN

num = RECDOCN(recno)

Returns the number of lines of documentation for the record. If the record number is zero, the function returns the number of lines of database level documentation.

RECLEVEL

num = RECLEVEL(0)

Returns the update level of the current record (when it was last written to the database). The update level changes with each modification to the record (during a RETRIEVAL UPDATE, Batch Data Input run, FORMS updating session, etc.). This function can only be used in a PROCESS REC loop.

RECLOCK

num = RECLOCK(locktype)

Changes the lock type for the current record for concurrent operations and attempts to read the current record from the database. See SYSTEM(36) function to determine if current record is locked. The locktype codes are (all other values set concurrent read):

1 & 6 = Exclusive
2 = Concurrent Read
3 = Concurrent Write
4 = Protected Read
5 = Protected Write

RECNAME

str= RECNAME( rtnum )

Returns the name of the specified record type padded with blanks to eight characters. If rtnum is 0, "CIR " is returned. Only used in a RETRIEVAL.

RECNUM

num= RECNUM( recname )

Returns the number of the specified record name. If the name does not exist, returns undefined. Only used in a RETRIEVAL.

RECSIZE

num = RECSIZE ( rtnum )

Returns the record size for the specified record type in double words. For example, to find the length of record type 1:

EMPSIZE = RECSIZE (1)

REPLACE

str = REPLACE( original , search, replace, times , offset, anchor)

If the search string is found in the original string, occurrences are replaced by the replace string. The number of times the string is replaced, the offset for the next starting position, and an anchor column are also specified. The following example returns "CABCBCBBAA" if INLINE is "AABABABBAA".
INLINE = REPLACE (INLINE, 'A','C',3,2,0) When anything but 0 is specified as the anchor, the string is only replaced once, at the anchor position. The following example returns "AABCBABBAA" if INLINE is "AABABABBAA".
INLINE = REPLACE (INLINE, 'A','C',3,2,4)

REVERSE

str = REVERSE (str)

Reverses a string.

RKEYSIZE

num = RKEYSIZE (rtnum)

Returns the key length a record type. This is the sum of the key fields of the record type plus the case identifier in case structured databases.

RND

num = RND( X [,n ])

Returns X rounded to a number of decimal places. Express n as powers of 10, negative for numbers smaller than 1. Omit n or specify 0 to round to integers. Rounding is done by adding 0.5*10n to positive numbers, subtracting 0.5*10n from negative then truncating.
Examples:
RND( 1234.5678 , -3 ) = 1234.568
RND( 1234.5678 , -2 ) = 1234.57
RND( 1234.5678 , -1 ) = 1234.6
RND( 1234.5678 , 0 ) = 1235
RND( 1234.5678 , 1 ) = 1230
RND( 1234.5678 , 2 ) = 1200
RND( 1234.5678 , 3 ) = 1000

RNMFILE

num = num = RNMFILE (oldname_str,newname_str)

Renames a file from oldname_str to newname_str. Returns 0 for a success and -1 for fail.

ROWCOUNT

num = ROWCOUNT (conid,statid)

Client/Server function. Returns a count of rows created by the execute command. When using ODBC, this depends on the ODBC source and may not be available (returns -1).

RRECSEC

num = RRECSEC (rtnum)

Returns the read security level for a record type.

RVARSEC

num = RVARSEC (rtnum, varname_str)

Returns the read security level for a variable.

SARG

str = SARG( num )

Returns string arguments from the parameter list. The argument is the position in the list. If it is greater than the number of parameters in the list, undefined is returned. (Numeric parameters are retrieved with the NARG function. NARG(0) returns the number of parameters in the list.)

SBST

str = SBST( input_str , start_pos , num_chars )

Returns a substring of the input string. The second argument, start_pos, specifies the position within the input string at which the substring begins. The third argument specifies the number of characters to retrieve from the input string. If any of the arguments are undefined or missing, undefined is returned. If the starting position is larger than the length of the input string, undefined is returned.

SETDFC

n = SETDFC(time,password)

Sets the master difference file copy interval in minutes. If master has been started with a password, this must match the quoted password, otherwise any name up to eight characters can be used.

SETDIR

n = SETDIR(directory_name)

Sets the default directory.

SETPOS

n = SETPOS(id,pos)

Sets the position of a multi-line gui control.

SETRC

n = SETRC(numeric_return_code)

Sets the return code SIR2002 will send to the operating system when it finishes.

SGET

str = SGET( varname_str )

Returns the value of the specified string variable. The argument is a string variable, quoted string constant or string expression whose value is the name of a common, record or program variable.

SGLOBAL

str = SGLOBAL( varname_str )

Returns the string value of a global variable. The argument is a string variable, constant or expression which specifies a global variable name. If it is not the name of a defined global variable, undefined is returned. Use the NGLOBAL function for numeric global variables.

SIGN

num = SIGN( num_X , num_Y )

Transfers the sign (positive or negative) of num_Y to the absolute value of num_X. Zero is positive.

SIN

num = SIN( radnum )

Returns the trigonometric sine of radnum, where radnum is specified in radians.

SMAX

str = SMAX ( rtnum , varname_str )

Returns the maximum valid string value for the specified variable. If the record number (rtnum) is negative, the function applies to a summary variable.

SMIN

str = SMIN ( rtnum , varname_str )

Returns the minimum valid string value for the specified variable. If the record number (rtnum) is negative, the function applies to a summary variable.

SOUND

error = SOUND( frequency , duration )

Produces a tone.

SPREAD

str = SPREAD ( input_str )

Returns a string with a blank inserted between each character of the input string.

SPUT

str = SPUT (varname_str, str )

Stores the value of string argument str in the specified string variable. The variable name argument is a string variable name, quoted string constant or string expression whose value is the name of a common, record or program variable. The value returned by the function is the value actually stored in the variable (possibly undefined, missing, etc.). If the variable refers to a common or record variable, the Retrieval must be in UPDATE mode.

SQRT

num = SQRT( X )

Returns the square root of X. Missing is returned for negative values.

SRCH

num = SRCH( varX , varY , Z )

Returns the location of the value Z in the table of values VarX to VarY, where VarX and VarY are local numeric variables defined in the program from VarX to VarY. These cannot be arrays or string variables. The values in the variables must be in ascending order.

For example, if Z matched the fourth value in the table, SRCH returns 4. If no match is found, a negative value is returned. The value indicates the correct position for Z for in the table. For example:

SET INCOME1 TO INCOME8 (1,1.5,2.2,2.5,3,3.1, 3.5, 4)
COMPUTE LOC = SRCH (INCOME1,INCOME8,SALARY)

If SALARY has the value 3.5, the function returns 7, because the seventh variable has the value 3.5. If SALARY has the value 2, the function returns the value -3 indicating that the value is not present, and that the correct place in the list would be in the third position.

SREAD

str = SREAD( strX )

Pops up a box on the screen with a prompt and returns a string from the user. The maximum input field is 80 characters which are horizontally scrolled.

SRST

num = SRST (strX ,strY)

Returns the column number within strX that matches strY. If strY is delimited by characters other than letters or numbers, SRST returns a positive number, otherwise SRST returns a negative value. If strY is not a substring of strX, SRST returns a zero value. The length of strX must be greater than or equal to the length of strY. For example:

POS1 = SRST ('BUBBLE GUM','GUM') results in: POS1 = 8
POS2 = SRST ('ANITA TINKLE',' ') results in: POS3 = -6

STATTYPE

num = STATTYPE ( rtnum , varname_str )

Indicates if the variable is a control or observation variable. If the record number (rtnum) is negative, the function applies to a summary variable.

0 = not a control or observation variable.
1 = observation var
2 = control var

STDEV

num = STDEV(X1 , X ,...., Xn)

Returns the standard deviation for the values in the list that are not missing or undefined. If fewer than 2 values are not missing or undefined, a value of undefined is returned.

STDEVR

num = STDEVR( varname )

Returns the standard deviation for the values of the specified variable encountered during a PROCESS REC or PROCESS ROWS loop that are not missing or undefined. If fewer than 2 values are not missing or undefined, a value of undefined is returned.

SUBDIR

str = SUBDIR (dir_str,sub_str)

Concatenates a subdirectory name to a directory path in correct system specific manner
eg: DIR = SUBDIR(CURDIR(0),"data") would return a string like C:\SIR2002\data\ under windows or /usr/SIR2002/data/ under unix.

SUBSTR

str = SUBSTR(string,start,len)

Same as SBST function. Returns a null string if the starting position is outside the length of the string.

SUM

num = SUM(X1 , X ,...., Xn)

Returns the sum of the values in the list that are not missing or undefined. The maximum number of variables allowed in the argument list is 128. Arguments must be numeric.

SUMR

num = SUMR( X )

Returns the sum of the values of X encountered during a PROCESS REC or PROCESS ROWS loop that are not missing or undefined.

SVVAL

str = SVVAL ( rtnum , varname_str , n )

Returns the value of the nth valid value of a categorical string variable. If the record number (rtnum) is negative, the function applies to a summary variable.

SYSTEM

num = SYSTEM( X )

Extracts a wide variety of information from an executing VisualPQL program set. Some return undefined if not in a RETRIEVAL.

SYSTEM(1) returns cpu time elapsed since beginning of run

SYSTEM(2) returns the release level of this version of the software

SYSTEM(3) not used

SYSTEM(4) returns a 1 if current case is available for processing, returns a 0 if current case is not available for processing

SYSTEM(5) returns a 1 if current case has been modified, returns a 0 is current case has not been modified

SYSTEM(6) returns a 1 if current record is available for processing, returns a 0 if current record is not available for processing

SYSTEM(7) returns a 1 if current record has been modified, returns a 0 if current record has not been modified

SYSTEM(8) if current case is available for processing, returns the number of records of all types belonging to the current case

SYSTEM(9) returns the current output file page number

SYSTEM(10) returns the lines remaining on current output file page

SYSTEM(11) returns the total number or errors in the session

SYSTEM(12) returns the number of errors during the current task

SYSTEM(13) returns the number of warnings during the current task

SYSTEM(14) returns a 1 if last CASE IS block was executed, returns a 0 if last CASE IS block was not executed

SYSTEM(15) returns a 1 if last CASE IS block created a case, returns a 0 if last CASE IS block did not create a case

SYSTEM(16) returns a 1 if last RECORD IS block was executed, returns a 0 if last RECORD IS block was not executed

SYSTEM(17) returns a 1 if last RECORD IS block created a record, returns a 0 if last RECORD IS block did not create a record

SYSTEM(18) returns current row block number

SYSTEM(19) returns current row block position. Can be used to save a row position and retrieve the data with an OLD ROW IS AT (block,pos)

SYSTEM(20) returns the number of cases (CIRs) created during current run

SYSTEM(21) returns the number of cases (CIRs) updated during current run

SYSTEM(22) returns the number of cases (CIRs) deleted during current run

SYSTEM(23) returns the database update level

SYSTEM(24) returns the number of cases in database

SYSTEM(25) returns the number of data records in database

SYSTEM(26) returns the line width of current output page

SYSTEM(27) returns a 1 if the last ROW IS block was executed, returns a 0 if the last ROW IS block was not executed

SYSTEM(28) returns a 1 if the last ROW IS block created a row, returns a 0 if the last ROW IS block did not create a row

SYSTEM(29) returns a 1 if the current row is available for processing, returns a 0 if the current row is not available for processing

SYSTEM(30) returns a 1 if the current row was modified, returns a 0 if the current row was not modified

SYSTEM(31) returns the row ordinal of the current row

SYSTEM(32) returns the number of rows in the table

SYSTEM(33) Obsolete - used to return amount of free table space

SYSTEM(34) returns amount of table space, in SIR double words, used for the VisualPQL execution stack

SYSTEM(35) returns the amount of table space, in SIR double words, used for the program schema maps

SYSTEM(36) returns a 1 if the current record is available. A 0 (zero) is returned if access to the current record is denied for concurrent operations because the record is locked by another process with a non-compatible lock type

SYSTEM(37) returns a 1 if the current CIR is available. A 0 (zero) is returned if access to the current CIR is denied because the CIR is locked by another process with a non-compatible lock type

SYSTEM(38) returns a 1 if the session is a concurrent session using Master. A 0 (zero) is returned if this is a normal, single-user session

SYSTEM(39) Returns the ordinal number of the default database. No Database returns 0

SYSTEM(38) Using Master returns 1

SYSTEM(39) Returns the ordinal number of the default database. No Database returns 0

SYSTEM(40) Number of connected databases. This returns the size of the connected database table which may include entries for disconnected databases since the position number associated with a particular connected database never changes.

SYSTEM(41) string size (num)

SYSTEM(42) Editor Type (num)

SYSTEM(43) Error Limit (num)

SYSTEM(44) Template storage 1,0

SYSTEM(45) DBA ? 1,0

SYSTEM(46) Page Length (num)

SYSTEM(47) Page Width (num)

SYSTEM(48) Loading Factor (num)-real

SYSTEM(49) Sort Number (num)

SYSTEM(50) Sort option (num)

SYSTEM(51) Warning Limit (num)

SYSTEM(52) Attribute count

SYSTEM(53) Global Count

SYSTEM(54) Message level

SYSTEM(55) Century split

SYSTEM(56) Buffer Count

SYSTEM(57) Count of families

SYSTEM(58) Printback 1,0

SYSTEM(59) Printback dorepeat

SYSTEM(60) Printback calls

SYSTEM(61) Printback task stats

SYSTEM(62) Printback remarks

SYSTEM(63) Printback skipped commands

SYSTEM(64) Printback user created attributes

SYSTEM(65) Printback quiet

SYSTEM(66) Backup Interval

SYSTEM(67) Backup Count

SYSTEM(68) Number of Master clients

SYSTEM(69) Number of Master attached databases

SYSTEM(70) Password on default member? (Y-1/N-0)

SYSTEM(71) Default member type (1-6 1 - :T; 2 - :E; 3 - :P; 4 - :O; 5 - :V; 6 - :M)

SYSTEM(72) Default member public (Y-1/N-0)

SYSTEM(73) Length in bytes of default member

SYSTEM(74) Creation date of default member

SYSTEM(75) Creation time of default member

SYSTEM(76) Modification date of default member

SYSTEM(77) Modification time of default member

SYSTEM(78) Family password on default family? (Y/N)

SYSTEM(79) Execution window size in rows

SYSTEM(80) Execution window size in columns

TABINDN

str = TABINDN (fn,tn,in)

Returns the index name of nth index. See TABINDS.

TABINDS

num = TABINDS(fn,tn)

Returns the number of indexes on nth table.

TABINDT

str = TABINDT (fn,tn,in,vn)

Returns the variable name and sort sequence of nth variable on index.

TABINDU

num = TABINDU (fn,tn,in)

Returns whether nth index is unique 0 - Not unique, 1 - Unique.

TABINDV

num = TABINDV (fn,tn,in)

Returns the number of variables in nth index.

TABNAME

str = TABNAME(fn,tn)

Returns the name of nth table. TFTABS(fn) returns number of tables on nth tabfile.

TABRECS

n = TABRECS(fn,tn)

Returns the number of rows on the nth table. TFTABS(fn) returns number of tables on nth tabfile.

TABVARS

num = TABVARS(fn,tn)

Returns the number of variables in nth table.

TABVINFN

num = TABVINFN(fn,tn,vn,n)

Returns various numeric data about the nth variable in nth table. The type of data is set by the fourth parameter as follows:

  1 = Count of value labels
  2 = leading zero
  3 = print this column
  4 = null not allowed
  5 = ON if value labels printed
  6 = set break variable
  7 = option G on break
  8 = option C on break
  9 = option P on break
 10 = var label as col heading
 11 = unique flag
 12 = subtotal title to the left
 13 = count of ranges
 14 = SIR data type

TABVINFS

str = TABVINFN(fn,tn,vn,n)

Returns various string data about the nth variable in nth table. The type of data is set by the fourth parameter as follows:

 1 = variable label
 2 = LNEG
 3 = LPOS
 4 = NULL
 5 = ZERO
 6 = TNEG
 7 = TPOS
 8 = SEPARATE
 9 = date/time format (COL should have date/time type)
 10= break string

TABVNAME

str = TABVNAME(fn,tn,vn)

Returns the variable name for vnth var on tnth table.

TABVRANG

str = TABVRANG(fn,tn,vn,rn)

Returns a string representation of the value(s) for the rnth range for vnth var on tnth table. String starts with keyword VALID or MISSING to indicate the type of range. Then string may have two values separated by :. Also may contain keywords BLANK, LOWEST and HIGHEST.

TABVTYPE

str = TABVTYPE(fn,tn,vn)

Returns the variable type for vnth var on tnth table.

TABVVALI

n = TABVVALI(fn,tn,vn,expr)

Validates the value in the expression (numeric or string) against the vnth var on tnth table. Returns a code indicating whether a value is allowed in a variable. The codes are:

0 = Valid value
Negative = Error detected
2 = Violation of specified valid values or ranges
3 - n Missing value 0 to n
4 = Missing value 1
5 = Missing value 2, etc.

TABVVLAB

str = TABVVLAB(fn,tn,vn,vln)

Returns the label for the vlnth value label for vnth var on tnth table.

TABVVVAL

str = TABVVVAL(fn,tn,vn,vln)

Returns the value for the vlnth value label for vnth var on tnth table.

TAN

num = TAN( X )

Returns the trigonometric tangent of X, where x is in radians. If X is an odd integral multiple of p/2 (e.g., p/2, 3p/2, 5p/2, etc.), the value of undefined is returned.

TANH

num = TANH( X )

Returns the hyperbolic tangent of X.

TFACCESS

str = TFACCESS(fn)

Returns the access type a(uto),r(ead) w(rite) of nth tabfile.

TFATTR

str = TFATTR(fn)

Returns the internal attribute name of nth tabfile.

TFCOUNT

num = TFCOUNT(dum)

Returns the number of connected tabfiles.

TFFILE

str = TFFILE(fn)

Returns the filename of nth tabfile.

TFGRNAME

str = TFGRNAME(fn)

Returns the group name of nth tabfile.

TFGRPW

str = TFGRPW(fn)

Returns the group password of nth tabfile.

TFJNNAME

str = TFJNNAME(fn)

Returns the journal name of nth tabfile.

TFNAME

str = TFNAME(fn)

Returns the name of nth tabfile.

TFTABS

num = TFTABS(fn)

Returns the number of tables on nth tabfile.

TFUSNAME

str = TFUSNAME(fn)

Returns the user name of nth tabfile.

TFUSPW

str = TFUSPW(fn)

Returns the user password of nth tabfile.

TIME

num = TIME( X )

Returns an integer which is the number of seconds from midnight. The input argument, X, is an integer in the range 0 - 235959; the first two digits are hours, the next two are minutes and the last two are seconds. For example, to calculate the number of seconds from midnight to 8:30 AM.
SLEEPSEC = TIME(083000)

TIMEC

str = TIMEC( X , time_format)

Converts an integer, X, into a time formatted string. In the time format the letters H, M and S are converted to the corresponding integer parts of the "time integer". 'P' returns "A" or "P"; 'PP' returns "AM" or "PM", and the hours are reported in 12-hour format. All other characters are passed directly to the output string. Otherwise a 24-hour format time is returned. Values of X that are out of range are returned as undefined. For example:

WAKESTR = TIMEC(ALARM, 'HH:MM:SS')

TIMEMAP

str = TIMEMAP ( rtnum, varname_str )

Returns a string with the time map of the specified time variable. If the variable is not a time variable, undefined is returned. For example, TIMESTR equals "HH:MM:SS" if time variable INTIME has that time map. If the record number (rtnum) is negative, the function applies to a summary variable.

TIMESTR = TIMEMAP (1, 'INTIME')

TODAY

num = TODAY(0)

Returns the "date integer" representation of the current date. The argument is a dummy numeric argument (specify 0).

TRIM

str = TRIM( A )

Deletes trailing blanks from the string variable, expression or constant A reducing its length.

TRIML

str = TRIML(A)

Deletes leading blanks from the string variable, expression or constant A and reduces its length accordingly.

TRIMLR

str = TRIMLR(A)

Deletes leading and trailing blanks from the string variable, expression or constant A and reduces its length accordingly.

TRIMR

str = TRIMR(A)

Identical to TRIM function.

TRUNC

num = (X [,n])

Returns X, truncating to a number of decimal places. If n is omitted or 0, truncates to integers. Specify n as powers of 10, negative for numbers less than 1. Identical to AINT function.
Examples:
RND( 1234.5678 , -3 ) = 1234.567
RND( 1234.5678 , -2 ) = 1234.56
RND( 1234.5678 , -1 ) = 1234.5
RND( 1234.5678 , 0 ) = 1235
RND( 1234.5678 , 1 ) = 1230
RND( 1234.5678 , 2 ) = 1200
RND( 1234.5678 , 3 ) = 1000

TWRITE

str = TWRITE( C )

Writes the specified string variable, constant or expression to the scrolled output window. This function is especially useful when a program is run with an alternate output file (i.e., with the interactive SET OUTPUT command). This function can only be used during an interactive session.

UPDLEVEL

num = UPDLEVEL (0)

Returns the current database update level. (Same as SYSTEM(23).)

UPGET

str = UPGET (key_str)

Gets string value (User Preference) identified by key_str (from INI file)
e.g. COMPUTE TITLE= UPGET('SIR.TITLE')

UPPER

str = UPPER( A )

Changes lowercase letters to uppercase.

UPSET

num = UPSET (key_str,val_str)

Sets string value (User Preference) identified by key_str (in INI file). Returns zero for success, -1 for failure.
e.g. COMPUTE rc= UPGET('SIR.TITLE','SIR2002')

VALIDATE

num = VALIDATE (rtnum, varname_str ,value)

Returns a code indicating whether a value is allowed in a variable. If the record number (rtnum) is negative, the function applies to a summary variable. The codes are:

0 = Valid value
1 = Wrong data type/Not valid value
2 = Violation of specified valid values or ranges
3 = Missing value 0 (Undefined or system missing value)
4 = Missing value 1
5 = Missing value 2
6 = Missing value 3

VALLAB

str = VALLAB( varname )

Returns a character string containing the value label for the current value of the specified variable. If there is no label defined for the value, a zero length string is returned. The argument is a variable name, not a constant or expression.

VALLABSC

str = VALLABSC (rtnum,varname_str,value)

Returns the value label for the specified value of a variable padded with blanks to 40 long. If the record number (rtnum) is negative, the function applies to a summary variable. The value can be numeric or string.

For example, suppose the fourth value label for a variable DIVISION in record type 2 has value 10, label 'Head Office' then:

THISPOS = VALLABSC (2, 'DIVISION',10)
returns 'Head Office'.

VALLABSN

str = VALLABSN ( rtnum, varname_str , n)

Returns the nth value label for a variable padded with blanks to 40 long. If the record number (rtnum) is negative, the function applies to a summary variable. Note that the number of labels is returned by NVALLAB.

For example, suppose the fourth value label for a variable DIVISION in record type 2 has value 10, label 'Head Office' then:

THISPOS = VALLABSN (2, 'DIVISION',4)
returns 'Head Office'.

VALLABSP

n = VALLABSP ( rtnum, varname_str , value)

Returns the position (nth) of the specified value associated with value labels for a variable. If the record number (rtnum) is negative, the function applies to a summary variable. The value can be numeric or string.

For example, suppose the fourth value label for a variable DIVISION in record type 2 has value 10, label 'Head Office' then:

POS = VALLABSP (2, 'DIVISION',10)
returns 4.

VALLABSV

str = VALLABSV ( rtnum, varname_str , n)

Returns the nth value associated with value labels for a variable. If the record number (rtnum) is negative, the function applies to a summary variable. Note that the number of labels is returned by NVALLAB.

For example, suppose the fourth value label for a variable DIVISION in record type 2 has value 10, label 'Head Office' then:

THISPOS = VALLABSV (2, 'DIVISION',4)
returns '10'.

VARGET

str = VARGET (expression)

Returns a string representation of the value in the variable named in the expression. This works on all variable types. It converts catvar, date, time, integer and real to a string according to the format of the specified variable as per the VFORMAT function. Specify a string variable or expression which contains the name of another variable. For example:

INTEGER*1 INT1
STRING*8 STR1 STR2
COMPUTE INT1 = 1; STR1 = 'INT1'
COMPUTE STR2 = VARGET (STR1)
WRITE STR1 STR2

Output is:   INT1       1

VARLAB

str = VARLAB( varname )

Returns the variable label for the specified variable. If there is no label defined for the variable, a zero length string is returned. The argument is a variable name, not a constant or expression.

VARLABSC

str = VARLABSC ( rtnum, varname_str )

Returns the variable label for a variable. If the record number (rtnum) is negative, the function applies to a summary variable. In the following example, if MARSTAT in record type 1 has a variable label of "Marital Status", then COLHEAD equals "Marital Status" (padded with blanks to 64 characters).
COLHEAD = VARLABSC (1, 'MARSTAT')

VARLABSN

str = VARLABSN ( rtnum, varname_str,line_no )

Returns the nth line of a variable label for a variable. If the record number (rtnum) is negative, the function applies to a summary variable. In the following example, if MARSTAT in record type 1 has a variable label of "Marital Status", then COLHEAD equals "Marital Status" (padded with blanks to 64 characters).
COLDESC = VARLABSN (1, 'MARSTAT', n)

VARNAME

string = VARNAME (rtnum,varnum)

Returns the name of the specified variable. The first argument is the record number in which the variable occurs; the second argument is the number of the variable (not including common vars). Variables are numbered in the order in which they are defined in the record schema definition. The string returned is padded with blanks to eight characters.

VARNAMEC

string = VARNAMEC (rtnum,varnum)

Returns the name of the specified variable. The first argument is the record number in which the variable occurs; the second argument is the number of the variable (including common vars). Variables are numbered in the order in which they are defined in the record schema definition. The string returned is padded with blanks to eight characters.

VARLENG

num = VARLENG (rtnum,varname)

Returns the data length of the specified variable. The first argument is the record number in which the variable occurs; the second argument is the name of the variable.

VARPOSIT

num = VARPOSIT (rtnum,varname)

Returns the position in the data record of the specified variable. The first argument is the record number in which the variable occurs; the second argument is the name of the variable.

VARPUT

num = VARPUT(var_exp,string)

Places the value from the second argument into the first argument converting from a string to a numeric value if necessary. Var_exp contains the name of a variable. If the variable is a numeric variable, the string is converted to the appropriate numeric value and stored in the variable.

Returns the same numeric values as VALIDATE.

0 = Valid value
1 = Wrong data type/Not valid value
2 = Violation of specified valid values or ranges
3 = Missing value 0 (Undefined or system missing value)
4 = Missing value 1
5 = Missing value 2
6 = Missing value 3

For example:

COMPUTE RES = VARPUT ('BIRTHDAY','12/31/50')

VARTYPE

num = VARTYPE( varname_str )

Returns an integer code representing the type of the specified variable. The argument is a string variable, quoted string constant or string expression whose value is the name of a common, record or local variable. Codes are:

0         if variable is string
1         if variable is numeric
undefined if variable is undefined

VFORMAT

str = VFORMAT ( rtnum , varname_str )

Returns a string representing the format of the specified variable (for example, A20, F9.2, D'MMIDDIYY', etc.) If the record number (rtnum) is negative, the function applies to a summary variable. In the following example, if variable NEWSAL in record type 3 is a four digit integer, then XFMT equals "I4".

XFMT = VFORMAT (3, 'NEWSAL')

VTYPE

num = VTYPE ( rtnum , varname_str )

Returns an integer code representing the type of the variable, where:

1 = string
2 = categorical
3 = date
4 = time
5 = integer
6 = real (single precision)
7 = real (double precision)
8 = scaled variable
If the record number (rtnum) is negative, the function applies to a summary variable.

WACCESS

num = WACCESS (0)

Returns the write security access level of the current user (the level corresponding to the write security password entered).

WINCNT

num = WINCNT (0)

Returns the number of lines in the output window

WINLIN

str = WINLIN (n)

Returns the nth line from the output window

WINMOVE

num = WINMOVE (x,y,w,h)

Moves and resizes the main window. The window is placed at horizontal position x,vertical position y, size width w by height h. The horizontal units are 1/4 of the average width for the font being used. The vertical units are 1/8 font height. If w or h is zero the window is minimized; if w or h < 0, the window is restored to its original position (before being minimised).

WINPOS

num = WINPOS (line,pos,len)

Moves to line in output window and highlights from pos to len on that line

WINSELL

num = WINSELL(n)

Returns the line selected. 0 returns the current cursor line. 1 returns beginning line of selection. 2 reurins ending line of selection.

WINSELP

num = WINSELP(n)

Returns the position in the line selected. 0 returns the current cursor position. 1 returns beginning position of selection. 2 returns ending position of selection.

WRECSEC

num = WRECSEC ( rtnum )

Returns the write security level for a record type.

WVARSEC

num = WVARSEC ( rtnum , varname_str )

Returns the write security level for a variable.

YESNO

num = YESNO( strX )

Displays a question box with the specified text and returns response. 1 indicates Yes; 0 indicates No.

homecontents start chapter top of pagebottom of pagenext page index