﻿# System-Defined Functions

__

The following sections of the documentation show A-Shell's various functions grouped by category—String Functions, Trig Functions, etc. Below is a table showing all of the functions in alphabetical order.

Note that although all functions require a parenthesized argument list (even if empty), the function names themselves are effectively ASB Keywords in that they cannot be used as variable names. 

| | | |
|------|------|------|
| **Name** | **Description** | **Type/Category** |
| ABS(x) | Returns absolute value of x. | Numeric |
| ACS(x) | Arccosine of x. | Trigonometric |
| [.ARG\_PASSED()](arg_passed().md) | Indicates whether the specified argument was passed to the current SBX, function, or procedure. | Other / Misc |
| [.ARGSIZ()](otherfunctions.md) | Returns the size of the specified argument passed to the current SBX, function, or procedure. | Other / Misc |
| [.ARGTYP()](otherfunctions.md) | Returns the type of the specified argument passed to the current SBX, function, or procedure. | Other / Misc |
| [.ARGTYP\_READONLY()](argtype_readonly.md) | Indicates whether the specified argument is read-only. | Other / Misc |
| ASC(a\$) | Returns the numeric value of the first character of a\$. | String |
| ASN(x) | Arcsine of x. | Trigonometric |
| ATN(x) | Arctangent of x. | Trigonometric |
| [AUTOCAP\$(a\$)](string_functions.md) | Intelligently capitalizes a specified string. | String |
| .BEFORE() | Specify insertion position in [MLIST](multi-level_list_mlist.md). |  |
| CHR\$(x) | Returns the OEM or Latin1 character of specified character. | String |
| COS(x) | Cosine of x. | Trigonometric |
| DATN(y,x) | Double arctangent. | Trigonometric |
| [.DYNOFFSET()](dynoffset().md) | Indirect deferred version. | Dynamic Structure |
| [.DYNOFFSIZ()](dynoffsize().md) | Dynamic structure version of .OFFSIZ\$(). | Dynamic Structure |
| [EDIT\$()](edit$().md) | Returns a modified version of a string based on specified options. | String |
| [EOF()](filefunctions.md) | Returns end-of-file status for a file channel. | File |
| [ERF()](filefunctions.md) | Returns error/status information about the last operation on an ISAM file. | File |
| [ERR()](err_system_def.md) | Used within an error trap to return information relating to a ASB error that has occurred. | Other / Misc |
| [ERRMSG()](otherfunctions.md) | Returns the message associated with ASB error x. | Other / Misc |
| EXP(x) | Returns the constant e raised to the power x. | Numeric |
| [.EXTENT()](extent().md) | Returns the "extent" of the specified array or collection. | Other / Misc |
| FACT(x) | Returns the factorial of x. | Numeric |
| [FILL\$()](fill$().md) | Returns a string consisting of a string repeated until it reaches specified length. | String |
| FIX(x) | Returns the integer part of the floating point value x. | Numeric |
| [.FSTAT()](filefunctions.md) | Returns the file status for the last ISAM-A operation on a specified channel. | File |
| [GETKEY()](getkey().md) | Inputs and returns the ASCII decimal value of a single character. | Input |
| [IFE(), IFE\$()](ife()andife$().md) | Ternary function; returns one of two parameters based on value of first. | String / Numeric |
| [IFELSE(), IFELSE\$()](ifelseandifelse$().md) | Ternary function; returns one of two parameters based on condition. | String / Numeric |
| [INSTR()](instr().md) | Returns position of first occurrence of a specified string. | String |
| [.INSTRR()](instrr().md) | Same as INSTR() but works in reverse direction. | String |
| INT(x) | Returns the largest integer less than or equal to x. | Numeric |
| [.ISBOUND()](dynamicstructurefunctions.md) | Returns TRUE if the specified variable is a DYNSTRUCT that has been bound to a defined structure. | Dynamic Structure |
| [.ISDEF()](isdef.md) | Indirect deferred version. | Dynamic Structure |
| [.ISEMPTY()](arg_passed().md) | Returns yes/no if the string or unformatted expression is "empty. | String |
| [.ISNULL()](specialordmapfunctions.md) | Tests for the .NULL condition. | Other |
| [.KEY()](specialordmapfunctions.md) | Returns the key associated with the element currently indexed by the iterator.  | Other |
| LCS\$(a\$) | Returns string a\$ folded to lower case. | String |
| [LEFT\$()](string_functions.md) | Returns leftmost x characters of string a\$.  | String |
| [LEN()](string_functions.md) | Returns length of string a\$. | String / Numeric |
| [.LINENO()](lineno()_pageno().md) | Returns current line number for sequential output files. | File |
| LOG(x) | Returns the natural (base e) log of x. | Numeric |
| LOG10(x) | Returns the decimal logarithm of x. | Numeric |
| [LOOKUP()](filefunctions.md) | Returns the size of the specified file in blocks. | File |
| LSTRIP\$(a\$) | Returns the string a\$ with the leading blanks and TABs removed. . | String |
| [MEM()](otherfunctions.md) | Returns information about available memory and resources.  | Other |
| MID\$(a\$,x,y) | Returns substring of a\$, starting in position x and extending y characters or until end. | String |
| [NUMEXPR()](numexpr().md) | Treats expression as numeric. | String / Numeric |
| [.NEXT()](specialordmapfunctions.md) | Advances the iterator, returning the associated key or .null if no more.  | Other |
| [ODTIM\$()](odtim().md) | Outputs the specified date and/or time according to the formatting flags. | String |
| [.OFFSET()](offset().md) | Returns the offset to the specified member variable within the specified structure. | Compiler |
| [.OFFSIZ\$()](offsiz$().md) | Returns the combination of the specified structure member's offset and size. | Compiler |
| [PAD\$()](pad().md) | Returns string truncated, or padded with trailing blanks, to the specified length. | String |
| [.PAGENO()](lineno()_pageno().md) | Returns current page number for sequential output files. | File |
| [PYFUNC()](pyfunc().md) | Provides a means to call an external function written in Python version 3. | Other / Misc |
| [.RECNO()](filefunctions.md) | Returns the current record number for the specified random, ISAM, or ISAM-A file channel. | File |
| [.RECSIZ()](filefunctions.md) | Returns the record size for the specified open file channel. | File |
| .REF() | Return a reference to iterator location in [MLIST](multi-level_list_mlist.md). |  |
| RIGHT\$(a\$,x) | Returns the rightmost x characters of string a\$. Equivalent to a\$\[-x,-1\]. | String |
| [RND(x)](randomnumbergenerators.md) | Returns a random number. | Numeric |
| [RND2()](randomnumbergenerators.md) | Enhanced version of RND(x). | Numeric |
| RTRIM\$(a\$) | Returns string a\$ with trailing spaces removed.  | String |
| SGN(x) | Returns the sign of x: -1 if x < 0, 0 if x = 0, 1 if x > 0. | Numeric |
| SIN(x) | Sine of x. | Trigonometric |
| [.SIZEOF()](sizeof().md) | Evaluates at compile-time to the size in bytes of the specified variable or defined structure. | Compiler |
| SPACE\$(x) | Returns a string of x spaces.  | String |
| SQR(x) | Returns the square root of x. | Numeric |
| [SRND2()](randomnumbergenerators.md) | Initializes the RND2() random number generator. | Numeric |
| [STR\$()](str$().md) | Converts a numeric value or expression to string. . | String |
| [STREXPR\$()](strexpr$().md) | Treats the expression argument as a string. | String |
| STRIP\$(a\$) | Returns the string a\$ with the trailing spaces and tabs removed. | String |
| TAN(x) | Tangent of x. | Trigonometric |
| [TRIM\$(a\$)](string_functions.md) | Returns the string a\$ with the leading spaces and tabs removed. | String |
| UCS\$(a\$) | Returns string a\$ folded to upper case. | String |
| [VAL()](val()andval$().md), [VAL\$()](val()andval$().md) | Returns the decimal value of a string. | String / Numeric |
| [.VALX()](val()andval$().md) | Extended version of VAL. | String |
| [XFUNC(), XFUNC\$()](xfunc().md) | Executes an external SBX routine. | Other / Misc |


