|
VisualPQL | Functions |
PROGRAM
. The functions are listed by type and in alphabetical order with a full explanation of each.
Trigonometric Functions
ACOS
arc cosine (also ARCOS
)ASIN
arc sine (also ARSIN
)ATAN
arc tangentCOS
trigonometric cosineSIN
trigonometric sineTAN
trigonometric tangentTANH
hyperbolic tangent
Mathematical Functions
ABS
absolute valueAINT
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 toleranceRAND
random uniform number (0-1) (also RANF
)REAL4
returns the REAL*4
value of a
REAL*8
numberRND
roundingSIGN
transfer of signSQRT
square rootTRUNC
truncates least significant digits Argument List Functions
CNT
count the number of arguments that are not missingFST
return the first argument that is not missingLST
return the last argument that is not missingMAX
return the largest argument that is not missingMEAN
compute the mean of the arguments that are not missingMIN
return the smallest argument that is not missingSTDEV
compute the standard deviation of non missing valuesSUM
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.
Some of these functions can be used with string values, others do not apply to strings. If a function returns a string
(e.g. as a maximum), a maximum of 32 characters are returned.
If the PROCESS RECORD
command includes the CASEFUNR
keyword then the statistics will be calculated over all records in all cases.
CNTR,FSTR,LSTR,MAXR,MINR,CNT,FST,LST,MAX,MIN
can all be used with strings. MEANR,STDEVR,SUMR,AMOD,MEAN,STDVEV,SUM
are only relevant to numeric values.CNTR
counts the number of times the variable occurs.FSTR
returns the first value processed.LSTR
returns the last value processedMAXR
returns the largest value processedMEANR
computes the average value (SUMR / CNTR
)MINR
returns the smallest valueSTDEVR
computes the standard deviationSUMR
computes the sum of values Date and Time Functions
CDATE
converts a date string to a date integerCTIME
converts a time string to a time integerDATEC
converts a date integer to a date stringDATET
returns the current date and time as a stringDTTOTS
takes a date and a time integer and returns a Timestamp as a real*8 valueJULC
converts a date integer to a date stringJULN
converts day, month, and year to a date integerNOW
returns the current time as a time integerTIME
converts hours, minutes, and seconds to a time integerTIMEC
converts a time integer to a time stringTODAY
returns current date as a date integerTSTODT
takes a Timestamp and returns the date component as an integerTSTOTM
takes a Timestamp and returns the time component as an integer Global Functions
DGLOBAL
Deletes a global variableDSN
Returns a full filename associated with an attributeGLOBALN
Assigns a numeric value to a global variableGLOBALS
Assigns a string value to a global variableNARG
Returns a numeric argument from run parameter listNGLOBAL
Returns the value of a global numeric variableSARG
Returns a string argument from run parameter listSGLOBAL
Returns the value of a global string variable String Functions
CAPITAL
Capitalises the first letter of each word in stringCATINT
Returns an integer value of a categorical variableCATSTR
Returns a string value of a categorical variableCENTER
Returns a centred stringCHAR
Returns the character with the numeric internal valueCHARHEX
Converts a character or character string into a hex representation of the character codes.COMMA
Separates thousands by inserting commas in a numeric stringEDIT
Applies editing template to a data stringFILL
Replaces blanks in stringFORMAT
Converts a number to a stringHEXCHAR
Converts a hex representation of a character string into the ASCII characters.ICHAR
Returns the numeric internal value of a characterLEN
Returns the string length in charactersLOWER
Converts all characters in string to lower caseNUMBR
Converts a string to a numberPACK
Returns the string with compressed blanksPAD
Pads a string with character to specified lengthPATTERN
Returns whether a pattern is found in a stringPFORMAT
Converts a number to a formatted stringPICTURE
Validates a string by comparing to a pictureREGEXP
Searches a string for a substring specified by a regular expressionREGREP
Searches a string for a substring specified by a regular expression and replaces it according to a second regular expressionREPLACE
Replaces substrings with a specified stringREVERSE
Returns a string spelled backwardsSBST
Returns a substring of a stringSGET
Returns the value of a string variableSPREAD
Returns a string with single blanks between charactersSPUT
Stores string value in string variableSRST
Searches for a substringSUBSTR
Returns a substring of a stringTRIM
Trims trailing blanks from a stringTRIML
Deletes blanks from the leftTRIMLR
Deletes blanks from the left and the rightTRIMR
Deletes blanks from the rightUPPER
Converts all characters of string to upper caseVARGET
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 recordSYSTEM(36)
Whether current record is lockedSYSTEM(37)
Whether current CIR is lockedSYSTEM(38)
Whether a concurrent session using MasterSYSTEM(39)
Returns the ordinal number of the default database. No Database returns 0 Miscellaneous Functions
ARRDIMN
Returns number of dimensions of a local array variableARRDIMST
Returns start value of a dimension of a local array variableARRDIMSZ
Returns number of entries of a dimension of a local array variableCLIPAPP
Adds text to the clipboardCLIPGET
Gets text from the clipboardCLIPLINE
Gets count of lines in the clipboardCLIPSET
Clears the clipboard and adds text to the clipboardCRYPTKEY
Sets the key for the encryption functions.CURREC
Returns the record type (number) for the record currently being processed.DECRYPT
Decrypts an encrypted string.ENCRYPT
Encrypts a string.ERROR
Displays a text message error boxEXISTS
Indicates if variable exists (not missing or undefined)EXTERN
Invokes user-supplied external functions returning a numeric value. These must be in the EXTERN
dll.EXTERNS
Invokes user-supplied external functions returning a string value. These must be in the EXTERN
dll.HELP
Invokes the Help systemMISNUM
Returns the "type" of missing or undefined valueMISSING
Returns the original value for missing valuesMSGTXT
Returns the error message text for an error numberPROGRESS
Controls the display of a progress barSEEK
Sets a position on an open file.SRCH
Searches a table of valuesSTDNAME
Checks a name and wraps curly brackets around if it is a non-standard name.
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 directoryATTRNAME
Attribute n name (str)BUFNAME
Buffer n nameCPYFILE
copies a fileCURDIR
Returns current directoryDEFFAM
Default family nameDEFMEM
Default member nameDEFTFN
Default tabfile nameDELDIR
Deletes the named directoryDELFILE
Deletes the named fileEDITNAME
Editor nameFAMNAME
Family n name FILECNT
Returns a count of files in named directoryFILEIN
Browses for a fileFILEIS
Returns if name exists as file or directoryFILEN
Returns the nth file in directoryFILEOUT
Browses for an output fileFILESTAT
Returns various data about named file e.g. Date/time of creation/access, size of file, etc. Times and dates are in system formatFILETIME
Returns various data about times of creation/access of file with times and dates converted to SIR formatsGETENV
Gets a string environment variable valueGLOBNAME
Gets the name of the nth global variableLINES
Lines remaining on output pageMAKEDIR
Creates a directoryMEMCOUNT
Count of members in familyMEMINFO
Various information about a memberMEMNAME
Name of nth memberNSUBDIR
Name of nth subdirectoryOUTFNAME
Name of current output filePAGELEN
Length of output pagePAGENO
Current output page numberPAGEWID
Width of output pagePROCFILE
Procedure file attribute namePROCNAME
Procedure file filenameRACCESS
Returns the read access level of userRNMFILE
Renames a file or directorySETDIR
Sets current directorySETRC
Sets a return codeSIRUSER
Sets/returns the current user nameSUBDIR
Concatenates a subdirectory to existing directory path in correct system specific mannerSYSTEM
Returns various "system" status valuesUPGET
Gets User Preference (from INI file)UPSET
Sets User Preference (in INI file) WACCESS
Returns the write access level of userWINCNT
Returns the number of lines in the output windowWINLIN
Returns the nth line from the output windowWINMOVE
Moves and resizes the main windowWINPOS
Moves to line in output windowWINSELL
Returns selected line from output windowWINSELP
Returns position in line selected from output window Schema & Database Functions
COUNT
Number of records of a given type in the current caseDATEMAP
Returns the date format (map) of a date variableDBINDN
Name of nth index on default databaseDBINDR
Number of record type indexedDBINDS
Number of indexes on default databaseDBINDT
Name of the nth variable in index followed by either ASC or DESC and UPPER if uppercase indexDBINDU
Returns 1 if index is uniqueDBINDV
Number of variables in indexDBNAME
Name of the nth databaseDBTYPE
Returns database type, case or caselessJOUFLAG
Returns whether journaling is on for default databaseKEYNAME
Returns name of a record type key fieldKEYORDER
Returns sort order ("A" or "D") of a key fieldMAXRECS
Returns the maximum allowed number of a particular record typeMISS
Returns the original (string) for missing values (0 - 3) for a variableMKEYSIZE
Returns the size of the largest record key in the databaseMRECSIZE
Returns size of the largest record in the databaseNKEYS
Returns the number of key fields for a record typeNLABELS
Synonym for NVALLAB. Returns the number of variable value labels defined for a variableNMAX
Returns the maximum value of a numeric variable rangeNMIN
Returns the minimum value of a numeric variable rangeNOFCASES
Returns the maximum number of cases for the databaseNRECS
Returns the maximum number of record types for the databaseNUMCASES
Returns the number of cases in the databaseNUMRECS
Returns the number of records of a given type in the databaseNVALID
Returns the number of defined valid values for a variableNVALLAB
Returns the number of variable value labels defined for a variableNVARDOC
Returns the number of lines of variable documentation defined for a variableNVARS
Returns the number of variables for the specified record typeNVARSC
Returns the number of variables including common vars for the specified record typeNVVAL
Returns the nth valid value of a numeric variableRECDOC
Returns the nth line of documentation for a record or databaseRECDOCN
Returns the number of lines of documentation for a recordRECLEVEL
Returns the update level at which a record was last written to databaseRECNAME
Returns the name of the record typeRECNUM
Returns the number of the record nameRECSIZE
Returns the record size of a specified record typeRKEYSIZE
Returns the key size of a specified record typeRRECSEC
Returns the read security level of a record typeRVARSEC
Returns the read security level of a variableSMAX
Returns the maximum value of a string variable rangeSMIN
Returns the minimum value of a string variable rangeSTATTYPE
Returns whether a numeric variable is defined as observation, control
or neitherSVVAL
Returns the nth defined string valid value of a variableTIMEMAP
Returns the time format (map) string format of a time variableUPDLEVEL
Returns the current update level of databaseVALIDATE
Validates a value of a database variable against schemaVALLAB
Returns the value label for the current value of a variableVALLABSC
Returns the value label for a specified value of a variableVALLABSN
Returns the nth value label of a variableVALLABSP
Returns the number (nth) of the value label associated with a specified value of a variable.VALLABSV
Returns a string that is the nth value associated with value labels of a variable.VARLAB
Returns the variable label for a variable (up to 78 characters)VARLABSC
Returns the variable label of a specified variable (up to 78 characters)VARDOCSN
Returns the nth line of variable documentation of a specified variableVARNAME
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 variableVARTYPE
Returns the storage type of a variable (string or numeric)VFORMAT
Returns a string representing the variable input formatVSCALE
Returns the scaling factor for a scaled integerVSCHFMT
Returns the variable input output format as shown in the schema DATA LISTVTYPE
Returns the SIR data type of a variable (7 types)VXLEN
Returns the number of characters required to display the variableWRECSEC
Returns the write security level of a record typeWVARSEC
Returns the write security level of a variable Tabfile & Table Functions
TABINDN
Index name of nth indexTABINDS
Number of indexes on nth tableTABINDT
Variable name and sequence of nth variable on indexTABINDU
If nth index is uniqueTABINDV
Number of variables in nth indexTABNAME
Name of nth tableTABRECS
Number of rows on nth tableTABVARS
Number of cols (variables) in nth tableTABVINFN
Various numeric data about columnTABVINFS
Various string data about columnTABVNAME
Column nameTABVRANG
Value of valid/missing range for columnTABVTYPE
Column typeTABVVALI
Validates table columnTABVVLAB
Value label for table columnTABVVVAL
Value label value for table columnTFACCESS
Access a(uto),r(ead) w(rite) of nth tabfileTFATTR
Internal attribute name of nth tabfileTFCOUNT
Number of connected tabfilesTFFILE
Filename of nth tabfileTFGRNAME
Group name of nth tabfileTFGRPW
Group password of nth tabfileTFJNNAME
Journal name of nth tabfileTFNAME
Name of nth tabfileTFTABS
Number of tables on nth tabfileTFUSNAME
User name of nth tabfileTFUSPW
User password of nth tabfile Read/Write Functions
NGET
Gets the value of a numeric variableNPUT
Stores a value in a numeric variableNREAD
Pops up a box on the screen with a prompt and returns a number from the userSGET
Gets the value of a string variableSPUT
Stores a value in a string variableSREAD
Pops up a box on the screen with a prompt and returns a string from the userTWRITE
Writes a string to the scrolled output window Dialog & Menu Functions
BRANCH
Adds a branch to the tree at a particular place.BRANCHD
Deletes a branch from the tree.BRANCHN
Returns id of nth branch.FINDITEM
Search list for textGETBTNH
Returns the height of button controlGETCHCH
Returns the height of choice controlGETCHKH
Returns the height of check controlGETFLT
Gets floating point as per GETTXT
GETFOCUS
Returns id of control with focusGETICHK
Returns check or radio stateGETIFLT
Returns floating point from a listGETIINT
Returns integer of item from a listGETINT
Gets integer as per GETTXT
. 0 if not integerGETITXT
Returns text of item from a listGETLBLH
Returns the height of labelsGETLTXT
Gets the text from a line in a multi-line text controlGETMAXCH
Returns the height of the maximum single line controlGETMCHK
Tests the state of a menu or toolbar itemGETMSEL
Returns pos of nth selected item from multiple selectionGETNITEM
Returns number of items in choice or listGETNLINE
Gets number of lines in multi-line text controlGETNSEL
Returns number of items selected in multiple selectionGETPOS
Returns pos of current selection in list or choice or keyboard focus in multiple selectionGETRADH
Returns the height of radio controlGETRSTEP
Returns the size of the row stepGETTXT
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 controlIDSTATUS
Returns the status of a controlNBRANCH
Returns number of braches in a tree below a point.SCROLLAT
Gets a position in a GUI scrollable itemSCROLLTO
Sets a position in a GUI scrollable itemSETPOS
Sets a position in a GUI multi-line itemSETRANGE
Sets minimum/maximum values in a GUI slider/spin/progress control. Sets the maximum number of characters allowed in
an edit or text field (ignoring the minimum parameter).Dialog Editor
DITEM...
There are a number of functions that 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
There are three servers in SIR/XS and a client program may be communicating with one of those or with an ODBC server from another software supplier. The three SIR/XS servers are Master that controls concurrent updates, the SQLServer, that acts as an ODBC server for other packages, and the PQLServer that is a server that can run any SIR/XS processes requested by a client. Most communication with master is done transparently i.e. it does not require specific functions, however there are a set of functions that can be used to administer master if required.
Client Functions to administer Master
DELMCLID
Deletes the client from Master.GETAKL
Returns the client AutoKill Limit from Master.GETDFC
Returns the difference file copy interval from Master.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.SETAKL
Sets the AutoKill time Limit for master clients.SETDFC
Sets the difference file copy interval for Master.Client Functions to SQLServer/ODBC
BINDPARM
Binds an SQLServer/ODBC parameter.COLCOUNT
Returns a count of columns created by the executeCOLLABEL
Returns the label of a specific column created by the executeCOLLEN
Returns the length of a specific string column created by the executeCOLNAME
Returns the name of a specific column created by the executeCOLTYPE
Returns the type of a specific column created by the executeCOLVALN
Returns the numeric value of a specific column created by the executeCOLVALS
Returns the string value of a specific column created by the executeGETERR
Returns the oldest error posted for this application and deletes the message.NEXTROW
Steps through the rows one at a timeODBCTABS
Produce list of tables on the data sourceODBCCOLS
Produce list of columns from the named table on the data sourceROWCOUNT
Count of rows created by the executeClient Functions to PQLServer
SERADMIN
Various server administration capabilities (returning numeric values)SERADMIS
Various server administration capabilities (returning string values)SEREXEC
Instructs server to execute previously sent commandsSERGET
Gets a line of output from serverSERLINES
Asks server how many lines of output are leftSERLOG
Logs on to the serverSERSEND
Sends a string to the serverSERSENDB
Sends a buffer to the serverSERTEST
Asks server if execution has completedPQLServer Functions
(These have no effect if used in a program that is not running on the server)
SERNOOUT
Suppresses server outputSERWRITE
Writes a line of output from server CGI Functions
Buffer functions return number of lines. All parameters are string expressions.CGIBUFPN
Get buffer of value of parameterCGIBUFPN
Get buffer of value of parameterCGIBUFSV
Get buffer of value of server variableCGIVARPN
Get parameter valueCGIVARSV
Get server variable value Alphabetic List of All Functions
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
Returns the absolute value of 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.
Returns the truncated value of X. If
Returns the natural logarithm (base e) of X. Values less than or
equal to zero return undefined.
Returns the base 10 logarithm of X. Values less than or equal to
zero return undefined.
Returns the remainder of X divided by Y. If Y is zero, undefined is
returned.
Returns SIR/XS application directory. That is the directory where the SIR executables are installed.
See
Returns the number of dimensions for specified local array variable.
Returns the start value for the specified dimension for specified local array variable (normally 1 unless array specified to start at different value).
Returns the size of the specified dimension for specified local array variable.
See
See
Returns the arc sine of X. The result is in the range
-
Returns the arctangent of X. The result is in the range
-
Returns the nth Attribute name (SYSTEM(52) = attribute count).
Binds an sqlserver/odbc parameter.
Creates a new node under the given parent node in the tree control.
Deletes a branch in the tree control given by the node.
Returns id of nth child of the given node.
Returns the nth Buffer name (SYSTEM(56) = buffer count).
Capitalises the first alphabetic character of the string and the
first alphabetic character following a blank. All other characters remain
unedited. For example:
Changes the lock type for the current Case (CIR) and attempts to read
the current CIR from the database. See
1 = Exclusive
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.
Returns a string corresponding to the current value of the specified
categorical variable.
Returns the date integer equivalent to the date string X that may be a string constant, variable or expression. The date format is a string expression. See date formats for a complete description.
If a date earlier than October 15, 1582 is specified, undefined is returned. Example:
Returns string strY centred in a string X characters in length.
Example:
Used when dealing with CGI from webserver. Puts value of CGI parameter into named buffer. Returns number of lines. Parameters are string expressions.
Used when dealing with CGI from webserver. Puts value of server variable into named buffer. Returns number of lines. Parameters are string expressions.
Used when dealing with CGI from webserver. Returns named parameter value in string variable. Parameter name is a string expression.
Used when dealing with CGI from webserver. Returns named server variable value in string variable. Server variable name is a string expression.
Returns a single character. The character returned is the character with the internal value of N. (See the
Returns a hex representation of the input string. Each character is converted to its ASCII value then that is converted to hexadecimal.
Converts the hexadecimal codes in the input string to their associated ASCII characters.
Appends text to the clipboard (the place holding text you cut and paste).
Gets a line of text from the clipboard (the place holding text you cut and paste).
Gets number of lines of text currently in the clipboard (the place holding text you cut and paste).
Clears the clipboard and puts text into the clipboard (the place holding text you cut and paste).
Counts the number of values in a list that exist (not missing or undefined). There may be up to 128 variables in the list. Returns zero (0) if no values exist.
Returns the number of values of X found during a
Client/Server function. Returns a count of columns created by the execute.
Client/Server function. Returns the label of a specific column created by the execute.
Client/Server function. Returns the length of a specific string column created by the execute.
Client/Server function. Returns the name of a specific column created by the execute.
Client/Server function. Returns the type of a specific column
created by the execute. This is one of the following:
A timestamp string is a formatted 18 byte string containing a combination date/time as follows:
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
Client/Server function. Returns the string value of a
specific column created by the execute.
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,
Returns the trigonometric cosine of X, where X is measured in
radians.
Copies a file from oldname_str to newname_str. Returns 0 for a success, -1 for a problem opening the source file, -2 for a problem opening the target file and -3 for errors during the copy.
Sets the key used by the encryption functions
The specified key is an expression. i.e. a variable name or a string in quotes.
Returns the number of records for record type X within the current
case.
Returns the number of seconds from midnight to the given time.
Returns the current directory.
Returns the record type number for the record currently being processed in a
Returns a date string equivalent to the date integer X formatted according to the date format. The format is a string constant. See date formats for a complete description. For example,
Returns a string with the date format (map) of the specified date variable. If the record number (rtnum) is negative, the function applies to a summary variable; if rtnum is one more than the maximum record count (i.e. NRECS(0)+1) then this applies to a standard variable.
Returns a 27-character string containing the current date and time.
The string is composed of the following substrings:
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.
Takes a date and time integer and returns a timestamp. A timestamp is a real*8 representation and is the number of seconds since the start of the SIR/XS calendar. You can do calculations between timestamps but the individual date and time components must be extracted using the
Returns name of nth index.
Returns number of record type indexed by nth index.
Returns number of indexes on default database.
Name of nth variable in nth index plus ASC/DESC and UPPER.
Returns 1 if the index is unique or 0 if the index is not unique.
Returns number of variables in nth index.
Returns a string with the name of the nth attached database. If n is zero, returns the name of the default database.
Returns 1 if a case structured database or 0 if caseless.
Decrypts an encrypted string. Set the encryption key (using
Returns the default family name.
Returns the default member name.
Returns the default tabfile name.
Deletes the named directory. Returns 0 for success.
Deletes the named file (use filename not attribute). Returns 0 for success.
Deletes the client from master. Get the client id from
Deletes a global. The string expression may be the global name enclosed in quotes or a string variable.
The
Returns the operating system filename of an attribute. The
attribute may be a variable or constant.
EDIT applies an edit string to data to produce the output. The edit string is made up of circumflexes ( ^ ), that represent a character of the input string, and any other characters to insert. Example:
Returns the name of the current text editor.
Encrypts a string. Set the encryption key (using
Displays an error box with the specified text and waits for
acknowledgment.
Returns 1 if X exists, 0 if X is missing or undefined. To test
several numeric variables for existence, use the
Invokes a user-supplied external function from the
Invokes a user-supplied external function from the
Returns the value of e raised to the X power. e is the
constant 2.71828.
Returns the nth family name in the default procfile. (
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.
Counts the files in the directory given by the string argument. The string must be a filename or mask. For example, specify a mask like '*.pql' for the count of those files with extension "pql" in the current directory.
Displays a file browse box for user to choose existing file. Returns zero length string if user cancels.
Tests if file exists. Returns -1 if name is a directory; 0 if no such name; 1 if file exists.
Returns the nth file name in the directory given by the string argument.
The string must be a filename or mask. For example, to list all files with extension "pql" in the current directory:
Displays a file browse box for user to choose output file. Returns zero length string if user cancels.
Returns various system specific data about a named file.
Returns SIR times or dates about a file
Replaces all blank characters in strX with the first character of string argument strY. The length of strX does not change. For example:
Search dialog choice or list for text and return position. Can start from partway through.
Converts X to a string.
Returns the first value in the list of up to 128 variables that is not missing or undefined.
Returns the first value of X encountered during a
Returns the height of button control (for positioning).
Returns the height of choice control( for positioning).
Returns the height of check control( for positioning).
Returns automatic disconnection timeout for idle clients (from Master) in minutes.
Returns time (from Master) of difference file copy interval in minutes.
Returns the value of the named environment variable.
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 SIR/XS 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.
Gets floating point as per
Returns id of control with focus.
Returns check or radio state.
Returns floating point from a list.
Returns integer of item from a list.
Gets integer as per
Returns text of item from a list.
Returns the height of labels ( for positioning).
Gets the text from a line in a multi-line text control.
Returns the height of the maximum single line control ( for positioning).
Returns tcp/ip address for client from master.
Returns check state from menu item.
Returns id for nth client from master.
Returns time of last message for nth client from master.
Returns time of log on for nth client from master.
Returns name of nth database from master.
Returns the position of the nth selected item from a single or multiple selection list.
In the case of a single selection list then
Returns number of items in choice or list.
Gets number of lines in multi-line text.
Returns number of items selected in multiple selection or returns 1 for a single selection list.
Returns pos of current selection in list or choice or keyboard focus in multiple selection.
Returns the height of radio control (for positioning).
Returns the size of the row step (for positioning).
Gets text from edit and from highlighted item in choice or list. (Gets label text from label, button, check and radio).
Returns the height of text control (for positioning).
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:
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:
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
Returns the name of the nth global variable. (SYSTEM(53) = Global Count).
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 converts this to a file name prefixed with a path pointing to the help directory and suffixed with the file extension
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 (ASCII).
Returns the status of a GUI element. -1 = the control does not exist; 0 = the control is disabled; 1 = the control is enabled.
Returns whether journaling is on (1) or off (0) for the database.
Converts a "date integer", X, into an 12-character string of the form 'MMM DD, YYYY'.
Returns a "date integer" where the three numeric arguments are month, day and year. A "date integer" is the number
of days since the start of the Gregorian calendar on October 15, 1582.
Returns the name of the specified keyfield for the specified record type.
Returns "A" or "D" for the sort order of the specified keyfield. The variable name argument is an expression.
Returns an integer value that is the length, in characters, of the string strX, leading and trailing blanks included.ABS
num = ABS( X )
ACOS
num = ACOS( X )
AINT
num = AINT( X [,n] )
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 )
ALOG10
num = ALOG10( X )
AMOD
num = AMOD(X , Y)
APPDIR
str = APPDIR(0)
ARCOS
num = ARCOS( X )
ACOS
function.ARRDIMN
num = ARRDIMN(array_name_exp)
ARRDIMST
num = ARRDIMST(array_name_exp,dim)
ARRDIMSZ
num = ARRDIMSZ(array_name_exp,dim)
ARCOS
num = ARCOS( X )
ACOS
function.ARSIN
num = ARSIN( X )
ASIN
function.ASIN
num = ASIN( X )
pi
/2 to +pi
/2 radians. Values outside the
range-1<X>1 return undefined.ATAN
num = ATAN( X )
pi
/2 to +pi
/2 radians.ATTRNAME
str = ATTRNAME(n)
BINDPARM
num = BINDPARM(conid,statid,parmno,num_exp)
BRANCH
num = BRANCH(control_id,parent_id,node_id,text)
BRANCHD
num = BRANCHD(control_id,node)
BRANCHN
num = BRANCHN(control_id,node,n)
BUFNAME
str = BUFNAME(n)
CAPITAL
str = CAPITAL( str )
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)
SYSTEM(37)
function to
determine if current CIR is locked. The locktype
codes are
(any other values set concurrent read):
2 = Concurrent Read
3 = Concurrent Write
4 = Protected Read
5 = Protected Write
6 = Exclusive CATINT
num = CATINT(A, B)
CATSTR
str = CATSTR(A)
CDATE
num = CDATE(X, date format)
INTDATE = CDATE('6/3/7', 'MM/DD/YY')
CENTER
str = CENTER(X , strY)
RESULT = CENTER(9, 'ABC')
returns: " ABC ".
CGIBUFPN
n = CGIBUFPN(buf,pn)
CGIBUFSV
n = CGIBUFSV(buf,sv)
CGIVARPN
str = CGIVARPN(pn)
CGIVARSV
str = CGIVARSV(sv)
CHAR
str = CHAR(N)
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).CHARHEX
hexstr = CHARHEX(str)
COMPUTE HEX1 = CHARHEX("Hello World")
HEXCHAR
str = HEXCHAR(hexstr)
COMPUTE STR = HEXCHAR("48656C6C6F20576F726C64")
See CIRLOCK
CASELOCK
functionCLIPAPP
num = CLIPAPP(text)
CLIPGET
str = CLIPGET(line)
CLIPLINE
num = CLIPLINE(dummy)
CLIPSET
num = CLIPSET(text)
CNT
num = CNT(X1 , X,..... , Xn)
CNTR
num = CNTR( X )
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)
COLLABEL
str = COLLABEL (conid,statid,colno)
COLLEN
num = COLLEN (conid,statid,colno)
COLNAME
str = COLNAME (conid,statid,colno)
COLTYPE
num = COLTYPE (conid,statid,colno)
1 = String
2 = Timestamp string
3 = Date
4 = Time
5 = Integer
6 = R4
7 = R8
8 = Scaled Integer
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)
COLTYPE
. e.g. Integers can be assigned to a real.COLVALS
str = COLVALS (conid,statid,rowno,colno)
COMMA
str = COMMA( str )
COMMA ('4500000')
returns '4,500,000'.COS
num = COS( X )
CPYFILE
num = CPYFILE (oldname_str,newname_str)
CRYPTKEY
num = CRYPTKEY(encryption_key)
ENCRYPT/DECRYPT
. The key is a 256 bit (32 character) string. The key only needs to be set once in a session that uses the encryption functions.
If the key is not set, the encryption functions use a key of all blanks.COUNT
num = COUNT( X )
CTIME
num = CTIME(X , time format)
Specify a time string X and a time format. See time formats for a complete description. If the hour, minute or second field is omitted, they default to zero. For example:WINTIME = CTIME('18:36:45', 'HH:MM:SS')
CURDIR
str = CURDIR( 0 )
CURREC
num = CURREC( 0 )
PROCESS RECORD
or
PROCESS DATA
block.DATEC
str = DATEC(X , date format)
DATEC(XBEG, 'Www, Mmm DDth, YYYY')
produces a
result such as "Thu, May 25th, 2007DATEMAP
str = DATEMAP (rtnum, varname_exp)
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 format "MM DD YY" defined in the schema, then DATESTR equals "MM DD YY".DATESTR = DATEMAP (1, 'BIRTHDAY')
DATET
str = DATET(N1 , N)
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
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
DTTOTS
real*8 = DTTOTS (date,time)
TSTODT
and TSTOTM
functions before using any other date and time functions e.g. for print formatting.DBINDN
str = DBINDN (index)
DBINDR
n = DBINDR (index)
DBINDS
n = DBINDS (dummy)
DBINDT
str = DBINDT (index,varno)
DBINDU
n = DBINDU (index)
DBINDV
n = DBINDV (index)
DBNAME
str = DBNAME (n)
DBTYPE
num = DBTYPE (dummy)
DECRYPT
str = DECRYPT(string,length)
CRYPTKEY
prior to the first invocation of this function. Obviously the key must be the same as was used to encrypt the string.DEFFAM
str = DEFFAM(0)
DEFMEM
str = DEFMEM(0)
DEFTFN
str = DEFTFN(0)
DELDIR
n = DELDIR(dir_name)
DELFILE
n = DELFILE(file_name)
DELMCLID
str = DELMCLID(id,password)
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)
DITEM
DITEM...
DITEM
series of functions all pertain to the Dialog Editor 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 )
EDIT
output_str = EDIT( input_str,edit_str )
PROGRAM
SSN = EDIT('123456789','^^^-^^-^^^^')
WRITE SSN
END PROGRAM
Output: 123-45-6789
EDITNAME
str = EDITNAME(0)
ENCRYPT
str = ENCRYPT(string,length)
CRYPTKEY
) prior to the first invocation of this function.
The string is a SIR string and the encrypted string is also a normal SIR string but it should be noted that encryption may result in non-text characters and so encrypted strings should not be written to text files.
The encryption algorithm encrypts eight (8) characters at a time and any input string is padded with blanks so that the output is a correctly encrypted string. If you truncate this and save an encrypted string that is not a multiple of eight, the last few characters will not decrypt properly.ERROR
num = ERROR( strX )
EXISTS
num = EXISTS( X )
CNT
function.EXTERN
num = EXTERN ( X )
EXTERN
dll. The function can take a numeric or string parameter and calls a different user function for each case. The extern.dll
library supplied by SIR contains dummy functions which return zero.EXTERNS
str = EXTERNS ( X )
EXTERN
dll. The function can take a numeric or string parameter and calls a different user function for each case. The extern.dll
library supplied by SIR contains dummy functions which return blank (a zero length string).EXP
num = EXP( X )
FAMNAME
str = FAMNAME(n)
SYSTEM(57)
= Count of families). FEQ
str = FEQ(real1,real2,exponent)
FILECNT
n = FILECNT(str)
FILEIN
str = FILEIN(filter,default_extension)
FILEIS
n = FILEIS(file_name_string)
FILEN
str = FILEN(string,n)
FOR N = 1,FILECNT("*.pql")
. WRITE [FILEN("*.pql",N)
END FOR
FILEOUT
str = FILEOUT(filter,default_extension)
FILESTAT
n = FILESTAT(filename_string,type_of_data)
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)
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)
RESULT = FILL (' $100.00', '*')
returns "**$100.00"
FINDITEM
num = FINDITEM (id,pos,txt)
FORMAT
str = FORMAT( X [,W [,D ]] )
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|str = FST( X1, X.., Xn )
FSTR
num|str = FSTR( X )
PROCESS REC
or PROCESS ROWS
loop that is not missing or undefined.GETBTNH
num = GETBTNH (dummy)
GETCHCH
num = GETCHCH (dummy)
GETCHKH
num = GETCHKH (dummy)
GETAKL
n = GETAKL(0)
GETDFC
n = GETDFC(0)
GETENV
str = GETENV(variable_str)
COMPUTE OSPATH = GETENV('PATH')
GETERR
str = GETERR (dummy)
GETFLT
dbl = GETFLT (id)
GETTXT
. Returns 0.0 if not f.p. number.GETFOCUS
num = GETFOCUS (0)
GETICHK
num = GETICHK (id)
GETIFLT
dbl = GETIFLT (id,pos)
GETIINT
int = GETIINT (id,pos)
GETINT
int = GETINT (id)
GETTXT
. 0 if not integer.GETITXT
str = GETITXT (id,pos)
GETLBLH
num = GETLBLH (dummy)
GETLTXT
str = GETLTXT (id,p)
GETMAXCH
num = GETMAXCH (dummy)
GETMCADD
str = GETMCADD (id)
GETMCHK
num = GETMCHK (id)
GETMCLID
n = GETMCLID (n)
GETMCLST
n = GETMCLST (n)
GETMCON
n = GETMCON (n)
GETMDBN
str = GETMDBN (n)
GETMSEL
num = GETMSEL (id,N)
GETMSEL(id,1)
is the same as GETPOS(id)
.GETNITEM
num = GETNITEM (id)
GETNLINE
num = GETNLINE (id)
GETNSEL
num = GETNSEL (id)
GETPOS
num = GETPOS (id)
GETRADH
num = GETRADH (dummy)
GETRSTEP
num = GETRSTEP (dummy)
GETTXT
str = GETTXT (id)
GETTXTH
num = GETTXTH (dummy)
GLOBALN
num = GLOBALN(globvar_exp , numeric_exp)
COMPUTE Y = GLOBALN('RT', 25.5)
GLOBALS
num = GLOBALS(stringexp , stringexp)
COMPUTE Y = GLOBALS ('TEMP','JOE SMITH')
GLOBALN
and GLOBALS
return: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)
HELP
error = HELP( help page )
.htm
.
For example:COMPUTE X = HELP ('visualpql/function/foreword')
ICHAR
num = ICHAR(C)
IDSTATUS
num = IDSTATUS(id)
JOUFLAG
num = JOUFLAG (dummy)
JULC
str = JULC( X )
JULN
num = JULN(month,day,year)
Years can be specified as various values. If a year of zero is specified, this year is used. If a year of less than 10 is specified, this decade is used. If a year between 10 and 99 is specified, the CENTYR
parameter is used to determine the appropriate century to use. If a year between 100 and 999 is specified, then values greater than 583 are taken to be in the last millennium (1583 - 1999), values smaller than 583 are taken to be in the current millennium (2000+).
A value of undefined is returned if a date earlier than October 15, 1582 is specified. Because of leap years, this routine is only accurate for dates up to Dec 31 29999.
For example:
DURATION = JULN(4, 8, 0) - BEGINDAT
ENDPROJ = JUNL(TMON, TDAY, TYEAR)KEYNAME
str = KEYNAME (rtnum, keynum)
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)
LEN
num = LEN( strX )