PickBASIC / FlashBASIC

BASIC functions

.md

The following BASIC functions are available.

In this section

@() functionThe @() function provides a standard means of performing control functions on a wide array of terminals.abs() functionThe abs() function returns the absolute (positive) portion of the integer number derived from the given numeric expression.access() functionThe access() function provides data about the AQL or Update processor environments when the program is called from a dictionary.alpha() functionThe alpha() function evaluates the expression and returns 1 (true) if every character in the string is alphabetical (that is, a—z upper and lowercase), or 0 (false) if any character is nonalphabetical.ascii() functionThe ascii() function converts a string of EBCDIC-encoded characters into their equivalent ASCII values.assigned() functionThe assigned() function determines if the variable has been assigned a value.change() functionThe change() function searches a str.exp for the search.str. If the search.str is at the start occurrence, then replacement.str replaces search.str for the amount specified in occurrences.char() functionThe char() function converts a number between 0 and 255 to its corresponding ASCII character equivalent.col1() functionThe col1() function returns the numeric column position of the character immediately preceding the substring retrieved in the most recently executed field() function.col2() functionThe col2() function returns the numeric column position of the character following the substring retrieved in the most recently executed field() function.convert() functionThe convert() function searches a given variable and replaces each occurrence of a character by another.cos() functionThe cos() function calculates the trigonometric cosine of an angle of a specified numeric expression in the range 0 to 360 degrees.count() functionThe count() function returns the number of occurrences of str.exp2 within str.exp1.date() functionThe date() function returns the current system date in internal format as an integer number representing the number of days that have elapsed since December 31, 1967 (day 0 on the D3 calendar).dcount() functionThe dcount() function returns the number of occurrences of the delimiter specified in str.exp2 within str.exp1, plus one.delete() functionThe delete() function removes a specific attribute, value, or subvalue from a dimensioned or dynamic array.dquote() functionThe dquote() function extracts a double-quoted string from str.exp.dtx() functionThe dtx() function converts a given decimal number to its corresponding hexadecimal equivalent. The number is first converted to an integer by truncating the fractional part.ebcdic() functionThe ebcdic() function converts a string of ASCII-encoded characters into their equivalent EBCDIC values.ereplace() functionThe ereplace() function searches a str.exp for the search.str. If the search.str is at the start occurrence, then replacement.str replaces search.str for the amount specified in occurrences.error() functionThe error() function retrieves the TCL command used to activate the program and loads it into a specified variable.exchange() functionThe exchange() function replaces the character specified as a hexadecimal string in str.exp1 with the character specified as a hexadecimal string in str.exp2.exp() functionThe exp() function returns the exponential of a numeric expression, that is, base e, which is 2.718281828 rounded to precision to the power of the numeric expression.extract() functionThe extract() function retrieves a specific attribute, value, or subvalue from a dimensioned or dynamic array.field() functionThe field() function returns a substring from a string expression, by specifying a delimiter and the desired occurrence.fmt() functionThe fmt() function is identical to performing a FlashBASIC or BASIC mask.fold() functionThe fold() function folds a string expression into a string of a given length.iconv() functionThe iconv() function converts a value from its external format to its internal equivalent, according to the processing code being applied.index() functionThe index() function searches through a given str.exp for the occurrence of the character or substring specified by substr.exp and if found, returns the numeric position where the nth occurrence of the substring begins. Null strings are skipped.inmat() functionThe inmat() function returns information about arrays.insert() functionThe insert() function inserts the element referenced by str.exp into a specific attribute, value, or subvalue location in dyn.array.exp.int() functionThe int() function returns the numeric integer equivalent from a given expression.len() functionThe len() function returns the length of a string expression.ln() functionThe ln() function returns the natural logarithm (base e, which is 2.718281828 rounded to precision) of a given numeric expression.locate() functionSee the locate statement documentation.maximum() functionThe maximum() function returns the maximum of a list of numbers delimited by attribute, value, or subvalue marks. If different orders of marks are present, the maximum() function returns the maximum of all fields, regardless of delimiter.minimum() functionThe minimum() function returns the minimum of a list of numbers delimited by attribute, value, or subvalue marks. If different orders of marks are present, the minimum() function returns the minimum of all fields, regardless of delimiter.mod() functionThe mod() function returns the remainder portion of the result of dividing one number by another.not() functionThe not() function returns the logical inverse of the normal outcome of true and false generated by a logical expression.num() functionThe num() function evaluates an expression and returns 1 (true) if it is a decimal numeric. Otherwise, it returns 0, if the expression contains any nonnumeric characters.occurs() functionThe occurs() function searches a string for attributes or values that occur consecutively.oconv() functionThe oconv() function converts a value from its internal format to its external equivalent, according to the processing code being applied.pwr() functionThe pwr() function raises a value contained in an expression to the power of the value of a second expression.rem() functionThe rem() function returns the remainder portion of the result of dividing one number by another.replace() functionThe replace() function inserts or replaces a specific attribute, value, or subvalue in the string referenced by dyn.array.exp with the value referenced in str.exp.rnd() functionThe rnd() function generates a random number.scan() functionThe scan() function searches through a specified str.exp for the first occurrence of up to three user-definable characters specified by search.delimiters, in addition to the system delimiters value, subvalue, and attribute.sentence() functionThe sentence() function is identical to performing a tclread statement. It returns the TCL command used to activate the program into a variable.seq() functionThe seq() function converts any ASCII character to its corresponding numeric equivalent in the range 0 through 255.sin() functionThe sin() function calculates the sine of an angle specified in degrees.sort() functionThe sort() function sorts an attribute or value mark delimited str.exp in ascending order.soundex() functionThe soundex() function returns the 4-digit soundex code for a phonetic string expression.space() functionThe space() function generates a string of spaces of a length equal to the value of the numeric expression.sqrt() functionThe sqrt() function calculates the square root of a given numeric expression.squote() functionThe squote() function extracts a single-quoted string from str.exp.status() functionThe status() function returns the value of system(0).str() functionThe str() function repeats a str.exp the number of times specified in num.exp.sum() functionThe sum() function returns the sum of a list of numbers delimited by attribute, value, or subvalue marks. If different orders of marks are present, the sum() function computes the sum of each sublist.summation() functionThe summation() function returns the sum of a list of numbers delimited by attribute, value, or subvalue marks.swap() functionThe swap() function searches a str.exp for the search.str. If the search.str is at the start occurrence, then replacement.str replaces search.str for the amount specified in occurrences.system() functionThe system() function provides an interface to a number of system variables, depending on the requested numeric argument.ta() functionThe ta() function returns the number of characters in the type-ahead buffer for the current process or for any other process.tan() functionThe tan() function calculates the trigonometric tangent of the angle specified in degrees.time() functionThe time() function returns the current system time in its internal format, representing the number of seconds past midnight.timedate() functionThe timedate() function returns the current system time and date in external format (hh:mm:ss dd mmm yyyy).trim() functionThe trim() function removes leading, trailing, and/or redundant characters from a string.trimb() functionThe trimb() function removes trailing spaces from a string.trimf() functionThe trimf() function removes leading spaces from a string.unassigned() functionThe unassigned() function indicates whether a variable has an assigned value.xtd() functionThe xtd() function converts an expression from its hexadecimal format into its equivalent decimal format.