Glossary

The Sage X3 script glossary documents the language elements of the Sage X3 scripting engine. Every language element has an associated keyword. A keyword cannot be used as a variable or property name, whenever the case is the same or not. The keyword recognition is not case sensitive, but this will change in the future.

For instance, as For is a keyword of the language, FOR, FoR, fOR, FOr, fOr, foR and for variables are not allowed.

For a complete list of keywords, see Sage X3 Script Keywords Glossary.

To describe the language, this documentation includes four categories of documents:

Concepts

Functions ABCDEFGHLMNOPRSTUVWXY



* abs : absolute value of a number
* ach: Inverse hyperbolic cosine
* acos : arc cosine computation
* addmonth : Adds months to a date
* adxmac : Returns name of the servers
* adxpno: Returns the stack of the calling scripts
* adxseek : "Read / Write" pointer on a file
* adxtcp : Returns the connection port
* adxuid : Unique session identifier
* allocgrp : Allocation group for an instance
* and : Logical "And"
* anp : Ordered arrangements (statistical function)
* ar2 : Rounding to two digits
* arr : Rounding
* ascii : ASCII code of first char in a string
* ash : Inverse hyperbolic sine
* asin : arc sine computation
* atan : arc tangent computation
* atan2 : arc tangent for a quotient
* ath : Inverse hyperbolic tangent
* avg : average value of a list of numeric elements
* aweek : First day of a week in a year


* B64Decode : base 64 decoding
* B64Encode : base 64 encoding


* cast : cast of a generic instance pointer
* ch : Hyperbolic cosine
* checkpath : checks the path validity against engine sandbox rules
* chr$ : Character from ASCII code
* clalev : Level value for a variable class
* clanam : Variable class name
* clanbs : Variable class number of variables
* clasiz : Size of a variable class
* clavar : Name of a variable in a variable class
* clacmp : Compares two variable classes
* closelog : closes the engine log
* cnp : Combinations (statistical function)
* cos : cosine computation
* ctrans : String character substitutions


* date$ : gets the current date
* datetime$ : gets the current date and time
* day : Current day
* day$ : Name of the day in a week
* dayn : Number of the day in a week
* delfile : Deletes a file in a file system
* dim : Dimensions of variable arrays
* dir$ : Directory where the runtime is installed


* eomonth : Last day of a month
* errl : Line number in a script when an error occurs
* errm : Error message details
* errmes$ : Translatable error message
* errn : Error number
* errp : Error program
* escjson : Character escaping function for "JSON" constants
* evalue : Evaluation of an expression
* evalueSData : evaluation of SData conditions in database queries
* exp : Exponential function


* filexist : Existence of a file
* fac : Factorial function
* filinfo : Access to file information
* filexist : checks the existence of a file
* filpath : Path builder for files on X3 servers
* find : Finds the first occurrence of a value in a list
* fix : Integer truncation
* fmet : Call of a method
* format$ : Formats a value according to a format description
* freeheap : Gives free memory available in the object heap
* freemem : Gives free memory in the common memory segment
* freesnapshot : Method that frees a snapshot
* func : Calls a function


* gdat$ : Constructs a date from day, month, year
* gdatetime$ : transforms a string canonical date / time value to a datetime
* getBit : Extracts out of an integer the value of the bit in the rank i
* getenv$ : Access to variable environment values
* getlogname : returns the engine log file name
* getmodified : returns the list of modified properties on an instance
* Getuuid : returns a unique id (UUID)


* Heapdmp : Dumps the memory allocation for classes


* instr : First occurrence of a substring in a string from a position
* int : Integer value function


* left$ : Left part of a string
* len : Length of a string
* ln : e-based logarithm
* lobsize : Gives the real size of a LOB
* log : 10 based logarithm


* max : maximum of a list of values
* maxtab : Maximum index in a variable length array
* mess : Translatable messages
* mid$ : Extracts a substring of a string
* min : minimum of a list of values
* mod : Modulus function
* modified : Checks if a property of an instance has been modified
* month : Extracts the month number of a date
* month$ : Returns the month name from a date


* nbrecord : Returns count() on a database table or cursor
* nday : Returns a number of days from a date
* nday$ : Returns a date from a number of days
* NewInstance : Creates an instance in memory
* not : Logical negation
* null : returns a null instance pointer
* Nulluuid : returns a null UUID
* num$ : string Decimal representation of a number


* objectexist : checks if a given class exists on a folder
* objectnbs : Gives the number of property of an instance
* objecttype : Gives the name of the class associated to an instance
* objectvar : Gives the "n" property of an instance
* openlog : sets the engine in a log mode
* or : Logical "Or"


* parse : Parses a string containing a Sage X3 script expression
* pat : Checks the conformity of a string against a pattern
* pi : "pi" rounded to 32 digits precision (3.14159265358979323846264338328)
* prd : multiplication of a list of values


* renamefile : Renames a file
* reverttosnapshot : Reassigns a class with the snapshot values
* revertupdtick : Reassigns a class hierarchy with the "Updtick" values from snapshot
* right$ : Right part of a string
* rnd : Returns a random number between 0 and x
* rowcount : Performs count(
) on a filtered database table


* seg$ : Extracts a substring of a string
* setBit : Sets one of the bits of an integer to a given value (0 or 1)
* sgn : Returns the sign (+1/-1) of a number
* sh : Hyperbolic sine function
* sigma : Performs a sum on expressions based on an index value
* sin : sine computation
* space$ : Returns a string filled with a given number of spaces
* sqr : Square root function
* strDecode : UTF8 to UCS2 character encoder
* strEncode : UCS2 to UTF8 character encoder
* string$ : Returns a string filled with a repeated character or character sequence
* sum : sum or concatenation of a list of values


* tan : tangent computation
* th : Hyperbolic tangent function
* time : Returns the number of second elapsed since the beginning of the day
* time$ : Returns a string giving the current time on the server
* timestamp$ : Returns a string containing the digital representation of a time stamp
* tolower : Transforms the upper case characters in a string into lower case
* toSData : transforms a X3 where clause in a SData sentence
* toupper : Transforms the lower case characters in a string into upper case
* Touuid : conversion of a canonical string UUID representation to a UUID
* trtcou : Returns the name of the current executed Sage X3 script file
* type : returns the data type of a variable


* unescjson : replaces a JSON escaped character string by its character value
* uni : Returns the first occurrence of a duplicate value in a list of values
* uniqid : Returns a sequence unique value for a database table
* uuid$ : Returns a unique "id" in canonical (string) format


* val : Returns a numeric value from a string containing a decimal representation
* var : Gives the variance of several arguments
* ver$ : Returns a revision number
* vireblc : Space cleaning of a string (leading, trailing, consecutive...)


* week : Returns the week number from a date


* Xgetchar : extracts one character from string or clob value
* xor : Logical exclusive "Or"


* year : Extracts the date from a year

Instructions ABCDEFGHIKLMNOPRSTUVW



* Anasql : Parses an SQl sentence
* Append : Append a string or a clob to another clob
* As : used in different syntaxes
* Asc: ascending order for Sorta syntax and Order By syntax
* Assign : Assign a variable which name is evaluated


* Blbfile : Declaration of a large binary object (Blob) variable
* Break : Break in "For...Next", "Repeat...Until", "While...Wend" loops
* By : Used in several syntaxes. See Order By


* Call : Call of a subroutine
* Case : Defines a branch sequence based on list of values
* Char : String character variable declaration
* Clbfile : Declaration of a large character object (Clob) variable
* Close : Closes a database file
* ColumnsDefines a list of columns that will be read on a database table on "For" loops
* Commit : Commits a database transaction
* Const : Declaration of constant parameters
* Contains$ : Used to check if a parsed JSON contains a given property
* Copfile : Copies a file on a file system
* Curr : Current line in some database access syntaxes


* Date : Declaration of a date variable
* Datetime : Declaration of a Date and time variable
* Dbgaff : Opens the debugger
* Decimal : Declaration of a binary coded decimal variable
* Default : Declaration of default classes
* Dela : Deletes positions in a list of arrays
* Delete : Deletes lines in the database
* DeleteByKey : Deletes a line in the database with a condition on the update tick
* Delfile : Deletes a file on a file system
* Desc: descending order for Sorta syntax and Order By syntax
* Double : Declaration of a double precision flaoting point variable


* Else : Alternative choice in an "If" sequence
* Elsif : Alternative condition in an "If" sequence
* End : Ends a subprogram or a function
* Endcase : Ends a "Case" sequence
* Endif : Ends an "If.. Elsif.. Else.." sequence
* Execsql : Executes a SQL command on the database
* Extended : Option Key word of Columns instruction


* File : Database table or view declaration
* Filter : Adds a filter ("Where" clause) on a database table
* First : Reads the first line in different database access syntax
* Float : Declaration of a floating point variable
* Flush : Flushes the "write buffer" used by Writeb
* Fmethod : Method declaration (in STC files)
* For : Performs loops
* FreeInstance : Frees an instance
* FreeGroup : Frees an allocation group associated to an instance
* FreeSnapshot : Releases a snapshot for an instance
* From : Used in different branch syntaxes
* Funprog : Function declaration


* Getseq : Reads data in a file in binary mode
* Global : Prefix of a declaration if the variable is in the [V] class
* Gosub : Calls a subroutine (ends with Return)
* Goto : Branches on another label


* Hint : used to force the database access strategy


* If : Test sequence
* Insa : Inserts positions in a list of arrays
* Instance : Declaration of a variable storing a reference to an instance
* Integer : Declaration of an integer variable
* Iomode : Parameter setting for sequential files


* Key : Used in different database access syntaxes
* Kill : Frees a variable
* Last : Reads the last line in different database access syntaxes


* Link : Performs a "Join" between tables in a SQL cursor declaration
* Local: Prefix of a declaration if the variable is in the local [L] class
* Lock: Performs a lock on a database table
* LogicClose: Closes a Table declared by File in an optimized way
* Look: Performs a select on a database without filling the [F] buffer


* Method : Method declaration (in STC files)
* Movfile : Move a file on a file system


* NewInstance : Creation of a new instance for a given class
* Next : Ends a "For" loop; also used as Read mode
* Nohint : used to force the database access strategy


* Onerrgo : Declares a label in which a branch will be done if an error occurs
* Openi : Opens a file for reading data
* Openio : Opens a file for reading and writing data
* Openo : Opens a file for writing data
* Order By : Used in different database access and sorting syntax


* Parse Instance : Parses a JSON string
* Prev : Reads the previous line in different database access syntax
* Putseq : Writes data in binary mode in a file


* Raz : Fills variables with a null value
* Rdseq : Reads data as characters string in a file
* Read : Reads a line from a cursor in a database
* Readlock : Reads a line with a lock from a cursor in a database
* RenameFile : Renames a file on a file system
* RenameFile : Renames a file on a file system
* Repeat : Performs a loop until a condition is fulfilled
* Resume : Resumes the execution of a script after the error handling script has been executed
* Return : Ends a subroutine called by Gosub
* Rewrite : Rewrites a line in the database
* RewriteByKey : Rewrites a line in the database with a condition on the update tick
* Rollback : Aborts (rolls back) a database transaction


* Schar : Declares a single char (1 byte) variable
* Seek : Moves the "Read / Write" cursor in a sequential file
* Select$ : Used to select properties in a parsed JSON
* Setlob : Assignment of clob values
* SetInstance : Assignment of an instance from or to a file class
* SetInstancenosys : Assignment of an instance from or to a file class with excluded properties
* Shortint : Declaration of a short integer variable
* Sleep : Suspends the execution of a script during a given number of seconds
* Sorta : Sorts a list of arrays
* Sql : Used by several syntax to access to the database by an Sql query
* Stability : Clause used in For statements
* Step : used to define the increment in a For loop
* Subprog : Declaration of a subprogram called by Call
* System : Used by different syntaxes to perform a system call


* Then : Used to separate members of an If structure
* Tinyint : Declaration of a tiny integer variable stored on 1 byte (replaces Libelle)
* To : Used in For syntax to define the end value for a loop
* Trbegin : Begins a database transaction


* Unlock : Releases symbol locks and database locks
* Until : End condition of a Repeat loop
* Update : Updates lines in the database
* Using : Used by different syntaxes
* Uuident : Declaration of a UUID variable


* Value : Declaration of parameters sent as values
* Variable : Declaration of parameters sent as references


* Wend : Ends a [While]] loop
* When : Used in Case syntax
* Where : Used in different database syntaxes
* While : Starts a While...Wend sequence
* With : Used in different syntaxes
* Write : Inserts a line in the database
* Writeb : Buffered insertion of lines in the database
* Wrseq : Writes data in string mode in a file

Variables or Methods ACFGMNORSTU



* adxdcs : pivot year used when a year has been given on 2 digits
* adxdir : base directory on the application server
* adxfname : column names in an opened table
* adxdlrec : number of records processed by the last Delete order
* adxftl : grouping factor for read operation in a SQL For instruction
* adxifs : field separator when reading or writing texts in files
* adxirs : field separator when reading or writing texts in files
* adxium : character coding used for strings when reading or writing texts in files
* adxlog : identifies that a database transaction is in progress
* adxmda : identifies the angular mode
* adxmother : identifies the reference folders of the current folder
* adxsqlrec : number of records processed by the last ExecSql order
* adxtct : counter table definition
* adxtms : message table definition
* adxtlk : locks table definition
* adxuprec : number of records processed by the last Update or Rewrite order
* adxwrb : grouping factor for write operation in a SQL Writeb instruction
* allocgrp : allocation group


* currind : current index for database operations
* currlen : current number of segments used in a key for database operations


* freemem : free memory for variables and table buffers
* freeheap : free memory for classes instances


* getAccessorEnabled : get accessor enablement indicator on properties


* isReadonly : read-only indicator on instance properties


* maxmem : maximum memory for variables and table buffers
* maxheap : maximum memory for classes instance
* maxtab : maximum index assigned in a variable array
* modified : modification indicator on instance properties


* nbind : Number of indexes in an opened table
* nbzon : Number of columns in an opened table
* nomap : identifies the current folder


* objectnbs : number of properties of an instance
* objecttype : class name for an instance
* objectvar : property names of a class


* reckey : fast order in For loops
* revertUpdtick : returns to the previous update tick


* setAccessorEnabled : set accessor enablement indicator on properties
* snapshot : access to the snapshot image of an instance
* snapshotEnabled : snapshot enablement indicator on a class


* tairec : size of a record in an opened table
* this : current instance pointer (in a method)
* revertToSnapshot : replaces the instance modifications by their snapshot values


* Updtick: update tick property in a table buffer