ESCR Program and Callable System

Last updated 28 September 2020


Functions

Functions are special sequences of characters that are interpreted to produce a value. The original sequence of characters is replaced with this value in-place before higher level interpretation is performed on the characters.

Functions can be nested arbitrarily deep. They are expanded (interpreted and replaced with the resulting value) in innermost to outermost order.

Functions can expand to be command parameters. In preprocessor mode, functions can be in input data, in which case their expansions are written to the output file. In other words, the functions in the input file are replaced with the values of those functions in the output file.

A special syntax is required to indicate the start and end of functions. Applications can set these special syntaxes. The default is "[" starts a function and "]" ends a function. This default is used by the ESCR program. Functions are not expanded (more accurately, they are not recognized as functions) in comments or inside quoted strings.

For example, assuming the default function sytax rules, the sequence of characters:

  The answer is [+ 30 12]

will expand to:

  The answer is 42

Functions start with the special syntax that identifies the start of a function, which is always followed by the function name. Parameters may be supplied to the function. If so, these follow the function name, with one or more spaces delimiting each parameter. The number of parameters that are required or allowed, and what their meanings are, depend on the specific function.

This page describes all the built-in functions. The default syntax rules (using square brackets to identify functions) are used in examples. The documentation for the particular application using the ESCR scripting system should specify the syntax it actually uses. The ESCR program uses the default syntax. In the function descriptions below, the function start and end sequences have been removed.

Function Descriptions

+1 var

Increment the integer variable var by 1, then return its value.

1+ var

Return the value of the integer variable var, then increment it by 1.

-1 var

Decrement the integer variable var by 1, then return its value.

1- var

Return the value of the integer variable var, then decrement it by 1.

+ [arg1 ... argN]

Returns the sum of all the arguments. With no arguments, the result is integer 0.

If all arguments are numeric, then the result is integer if all are integer. Otherwise the result is floating point.

There may be a single TIME argument with the rest numeric. In that case the result data type is TIME, and the value is the TIME argument plus the seconds represented by the sum of the remaining arguments.

- arg1 [arg2 ... argN]

Subtraction of the first argument minus all the remaining arguments. The first argument is required.

If all arguments are numeric, then the result is integer if all are integer. Otherwise the result is floating point.

It is possible to subtract a numeric value from a time. The result is the time minus the numeric value interpreted as seconds. A time minus another time is the floating point distance in seconds from the second argument to the first.

The function is evaluated by starting with the first argument as the current value, then subtracting the second argument from it. The result becomes the current value, with the next argument subtracted from it, with the result becoming the new current value, etc. Note that the data type of the current value can change multiple times during the evaluation of the function. The function returns the current value and data type after the last argument is subtracted.

* [arg1 ... argN]

Returns the product of all the arguments. With no arguments, the result is integer 1.

All arguments must be numeric. If all are integer, then the function value is integer. Otherwise, the function value is floating point.

/ arg1 [arg2 ... argN]

Returns the first argument divided by the product of the remaining arguments. The first argument is required. All arguments must be numeric. The result is always floating point.

The function is evaluated by starting with the first argument as the current value, then dividing it by the second argument. The result becomes the current value, which is then divided by the next argument. The result of that becomes the new current value, which is divided by the next argument, etc.

~ arg

Bitwise inversion. Arg must be integer. The result is the integer value with each bit flipped. This is also known as the "one's complement".

< arg1 arg2

Returns TRUE when arg1 is less than arg2, otherwise FALSE.

The two arguments must be either both numeric, both strings, or both time values.

<= arg1 arg2

Returns TRUE when arg1 is less or equal to arg2, otherwise FALSE.

The two arguments must be either both numeric, both strings, or both time values.

= arg1 arg2

Returns TRUE when arg1 is equal to arg2, otherwise FALSE.

The two arguments must be either both numeric, both strings, or both time values.

<> arg1 arg2

Returns TRUE when arg1 is not equal to arg2, otherwise FALSE.

The two arguments must be either both numeric, both strings, or both time values.

>= arg1 arg2

Returns TRUE when arg1 is greater than or equal to arg2, otherwise FALSE.

The two arguments must be either both numeric, both strings, or both time values.

> arg1 arg2

Returns TRUE when arg1 is greater than arg2, otherwise FALSE.

The two arguments must be either both numeric, both strings, or both time values.

ABS arg

Returns the absolute value of arg. Arg must be numeric.

AND arg1 [arg2 ... argN]

Logical AND when all arguments are boolean.

Bitwise AND when all arguments are integer.

The arguments data types must be either all bool or all integer. Arg1 is required.

ARG n

Returns the raw characters of argument n to the innermost block that takes arguments.

This function returns the raw characters of the argument, not a string or any particular data type. When the argument doesn't exist, nothing is returned.

CCODE char

Returns the integer character code of the character char. Char must be a string that is exactly one character long.

CHAR [ccode ... ccode]

Returns the string consisting of the characters of the indicated character codes. All arguments must be integer.

CHARS [arg1 ... argN]

Returns the concatenation of the string representation of all the arguments. This is returned as a raw sequence of characters, not as a string. This function can be used to "unquote" a string.

For example:

  [chars "abc" 13 'def' 27.1] --> abc13def27.10000

COS ang

Returns the cosine of the angle ang. Ang must be numeric, and is in radians.

DATE time [cmd arg ... arg] ... [cmd arg ... arg]

Creates a formatted string from the time time. The time argument is required.

The remaining arguments are a sequence of commands. Each command starts with a command name keyword, which is possibly followed by arguments to that command, depending on the command. The keywords are case-insensitive. The possible commands are:

LOCAL

Causes the time to be written in the local time zone. The default is to write coordinated universal time.

This command, if used, must appear before any command that writes a part of the time. It is not permissible, for example, to write the day in coordinated universal time, then switch to local time and write the seconds.

Note that time is always in coordinated universal time. This command changes how the time is written, not how time is interpreted.

STR string

Adds the string string to the returned string.

YEAR

Adds the 4-digit year to the returned string.

MNUM

Adds the 2-digit month number to the returned string.

MONTH

Adds the full month name to the returned string.

MON

Adds the 3-character month abbreviation to the returned string.

DAY

Adds the 2-digit day within the month to the returned string.

D

Adds the day number within the month to the returned string. Only the minimum number of necessary digits are written. No leading zeros are added to get to a particular field width.

DAYWK

Adds the full day of week name to the returned string.

DWK

Adds the day of week abbreviation to the returned string.

HOUR

Adds the 2-digit hour within the day to the returned string.

MIN

Adds the 2-digit minute within the hour to the returned string.

SEC

Adds the 2-digit second within the minute to the returned string.

SECF n

Adds the 2-digit seconds within the minute, decimal point, and n seconds fraction digits to the returned string.

When no commands are used that cause anything to be written to the return string, the default date/time string is returned:

  YYYY/MM/DD.hh:mm:ss

For example:

  [date 2017/03/08.11:17:32.59] --> "2017/03/08.11:17:32"

  [date 2017/03/08.11:17:32.59 daywk str " at " hour str ":" min] --> "Wednesday at 11:17"

  [date 2017/03/08.11:17:32.59 d str " " mon str " " year] --> "8 Mar 2017"

DEGR deg

Converts degrees to radians. Deg must be numeric. The result is always floating point.

DENT [opt]

Returns one piece of information about the current directory entry in a directory entries loop (command LOOP DIR). This function is only valid inside a directory entries loop.

Opt is a keyword specifying the piece of information to return. The valid opt keywords and the resulting function return values are:

FNAM

String. The bare directory entry name. This is the default when opt is not supplied.

TNAM

String. The full absolute pathname of the directory entry.

TYPE

String. Keyword indicating the type of file system object. The possible function values are:

FILE - Ordinary data file.

LINK - Symbolic link.

DIR - Nested directory (subdirectory).

LEN

Integer. The file length in bytes.

DTM

Time. The time the file was last modified.

DIR

String. The full pathname of the directory being listed. This is not dependent on the specific entry. This value is therefore the same every iteration of the loop.

DIR [arg ... arg]

Returns the pathname of the lowest level directory containing the file indicated by the concatenation of the string representation of all arguments.

If no arguments are supplied, then the pathname of the current working directory is returned.

DIV arg1 [arg2 ... argN]

Integer division.

Arg1 is divided by the next argument. The result of that is divided by the next argument, etc.

All arguments must be integer. Divides are performed using integer arithmetic. Only the quotient is kept. The remainder is lost.

For example:

  [div 59 7 3] --> 2
  [div 59 7 -3] --> -2
  [div -103 5] --> -20

E [arg]

Returns earg. When no argument is supplied, the function returns the value of e.

ENG val [sig [str]]

Converts the numeric value in val to its string representation in engineering notation. Val must be numeric. Sig is the minimum number of significant digits the output string must contain, and defaults to 3. It must be integer if used. Str is an optional string and will be appended to the number before the units multiplier name, if any. Str defaults to a single space.

The number will always have 1 to 3 digits left of the decimal point. A scale factor that is a multiple of 1000 will be applied to achieve this. The units multiplier name will be the standard scientific single letter abbreviation for the factor of 1000 used. If the factor of 1000 is too small or too large to have a supported name, then "e" will be written after the number followed by the exponent of 10. The exponent of 10 will always be a multiple of 3.

The supported units multiplier names are:

1015   P (Peta)
1012   T (Tera)
109   G (Giga)
106   M (Mega)
103   k (Kilo)
100   (unity, units multiplier name is empty string)
10-3   m (milli)
10-6   u (micro)
10-9   n (nano)
10-12   p (pico)
10-15   f (femto}

For example:

[eng 123456] --> "123 k"
[eng 123456 4 ""] --> "123.5k"
[eng .123456 2] --> "123 m"
[eng 12e20] --> "1.20e21 "

EVAR var

Returns the expansion of the system environment variable var. Var is a string. If the indicated environment variable does not exist, then the empty string is returned. The returned data type is always string.

EXIST name [nametype]

Tests whether the entity named by name exists. This function always returns a bool value, with TRUE indicating the named entity exists and FALSE that it does not exist.

Nametype specifies the type of the named object. The object must exist and be of the specified type for the function to return TRUE. The default name type is any ESCR system symbol, such as a variable or constant name. The choices for nametype are:

PSYM

Any ESCR system symbol. This is the default if the nametype argument is not given. Name must be a string.

EVAR

System environment variable. Name must be a string.

FNAM

File system name. The named object can be a file, directory, or any other object implemented by the file system this program is running on. Symbolic links will be followed, and the function return value reflects the existance of the final translated pathname. Name must be a string.

FNAMNL

File system name. Symbolic links are not followed. Name must be a string.

ARG

Execution block argument. Name must be integer, and is the execution block argument number. General arguments are numbered sequentially starting at 1, but there can also be special arguments with numbers less than 1. See the CALL command description for more information on arguments.

EXP a b

Returns a to the power of b (ab). A and b must be numeric. When a is negative, b must be integer.

FILE infotype name

Returns information about the file system object name. Name is a string. Infotype is a keyword selecting which information about the file system object is returned. The valid values of infotype and the resulting function values are:

TYPE

String. The string is a upper-case keyword indicating the file system object type:

FILE - Ordinary data file.

LINK - Symbolic link.

DIR - Directory.

If the object does not exist, then the function returns the empty string.

LEN

Integer. The file length in bytes.

DTM

Time. The time the file was last modified.

FP val [fmt ... fmt]

Converts the numeric value val to its floating point string representation. The optional fmt arguments specify particular formatting to be used. Multiple fmt arguments are combined with single spaces between them to form the formatting string.

The formatting string is a sequence of commands. Each command starts with the command name keyword, which may be followed by parameters specific to that command. Command name keywords are case-insensitive. The formatting commands are:

FW n

Field width. For n ≥ 1, the output string will be n characters wide. N = 0 indicates free format, meaning the minimum number or necessary output characters will be used.

FWE n

Field width of the exponent part of the number if exponential notation is used. 0 = free form.

SIG n

Minimum significant digits required. Default = 3.

MXL n

Maximum digits allowed left of decimal point. Default = SIG + 1.

RIT n

Fixed number of digits right of decimal point.

MNR n

Minimum required digits right of decimal point.

MXR n

Maximum allowed digits right of point. May force use of exponential notation.

EXP

Force use of exponential notation.

NEXP

Prohibit use of exponential notation.

ENG

Use engineering format when exponential notation is used. Causes the exponent to be a multiple of 3. Default.

SCI

Use scientific format when exponential notation is used. The exponent is not restricted to a particular multiple.

PNT

Force decimal point to always be written, even if there are no digits to its right.

NPTN

Don't write the decimal point where there are no digits to its right. Default.

ZB

Write zero before decimal if there would otherwise not be a digit there. Default.

NZB

Don't write zero as only digit before the decimal point.

TZ

Trailing zeros are allowed. Default.

NTZ

Truncate trailing zeros.

PLE

Write plus sign before the exponent if it is positive.

NPLE

Do not write a plus sign before a positive exponent. Default.

GRP

Write digits in groups (commas every three digits for English).

NGRP

Do not write digits in groups. Default.

PL

Write leading plus if number is positive.

NPL

Do not write leading plus if number is positive. Default.

LZ

Fill fixed size field with leading zeros on left.

NLZ

Do not add leading zeros. Blanks will fill fixed size field. Default.

IF condition arg1 arg2

Returns arg1 when condition is true, and arg2 when condition is false. Condition must be of type bool. The data type of the function value is whatever data type the returned argument (arg1 or arg2) is.

INT val [fmt ... fmt]

Converts the integer value val to its string representation. The optional fmt arguments specify particular formatting to be used. Multiple fmt arguments are combined with single spaces between them to form the formatting string.

The formatting string is a sequence of commands. Each command starts with the command name keyword, which may be followed by parameters specific to that command. Command name keywords are case-insensitive. The formatting commands are:

FW n

Field width. For n ≥ 1, the output string will be n characters wide. N = 0 indicates free format, meaning the minimum number of necessary output characters will be used.

PL

Write leading plus if number is positive.

NPL

Do not write leading plus if number is positive. Default.

LZ

Fill fixed size field with leading zeros on left.

NLZ

Do not add leading zeros. Leading blanks will fill fixed size field. Default.

BASE n

N is the number conversion base (radix), which must be 2 - 36. Default is 10 (decimal). The letters A-Z will be used for digit values 10 to 35.

USIN

The input integer will be interpreted as unsigned.

SIN

The input integer will be interpreted as signed. Default.

ISINT arg

Returns TRUE iff the argument can be interpreted as integer.

ISNUM arg

Returns TRUE iff the argument can be interpreted as a numeric value.

LAB namechars

Returns the full name (expansion) of a local label with the generic local name namechars. Namechars is a token, not a string. The local label name should not be enclosed in quotes, for example. Namechars must not include spaces.

Local labels are intended as an easy means to create unique symbols between different calls to a subroutine or invocations of a macro, for example. The following execution blocks have their own context for local labels:

In all other execution blocks, the context for local labels is that of the innermost execution block of one of the above types. For example, references to the local label ABC in a macro and in a block/endblock block within that macro will be to the same local label. References to ABC in the code that invoked the macro, or in a subroutine called by the macro will each be separate.

The full name of a local label is generated by starting with namechars, appending an underscore (_), then appending a unique sequence number. The sequence number will always be at least 3 digits long, even if leading digits are 0. It will be longer when more digits are required to express the sequence number.

For example:

  [lab LOOP] --> LOOP_039

LCASE arg

Returns the string representation of arg with all aphabetic characters lower case.

LNAM fnam [suff ... suff]

Returns the generic leafname of the file name fnam. Fnam is a string, and is required. The suff arguments are optional, and are suffixes removed from the file name if present. The first suff argument found in the file name is used.

For example:

[lnam "c:\mystuff\virus.exe" ".bat" ".exe"] --> "virus"
[lnam "c:\mystuff\virus.exe" ".bat" ".gif"] --> "virus.exe"

LOG arg

Returns the natural logarithm of arg.

LOG2 arg

Returns the base 2 logarithm of arg.

MAX arg1 [arg2 ... argN]

Returns the maximum value of the arguments. All arguments must be numeric. The returned data type will be integer if all arguments are integer, or floating point otherwise.

MIN arg1 [arg2 ... argN]

Returns the minimum value of the arguments. All arguments must be numeric. The returned data type will be integer if all arguments are integer, or floating point otherwise.

NOT arg

Returns the opposite of the boolean argument. The result is always boolean.

NOW

Returns the current time.

OR arg1 [arg2 ... argN]

Logical OR when all arguments are boolean.

Bitwise OR when all arguments are integer.

The arguments data types must be either all bool or all integer. Arg1 is required.

PI [val]

When val is not present, returns the value of Pi (3.141592...). When val is present, returns the value of Pi times val. Val must be numeric.

PICK [opt]

Returns information about the inner-most pick...endpic block.

The specific action is selected with the opt parameter. Opt is a keyword than can be one of the following:

VAL

The function is the value of choice passed to the pick command. It is an error if choice was not supplied. The function data type is the data type of choice.

This is the default if opt is omitted.

VALIS

Returns TRUE iff choice was supplied to the pick command. The function data type is bool.

NRUN

Returns the number of options run so far within this pick block, including the current option. The function data type is integer.

NOPT

Returns the total number of options encountered so far in the pick block, including the current option. The function data type is integer.

IN

Returns TRUE iff within a pick...endpic block. The function data type is bool.

QSTR characters

Returns a string from the sequence of characters characters. This can be thought of as "quoting" characters to make a string.

This function does not follow the normal rules for arguments. Characters are all characters starting 2 columns after qstr up to the end of the function, whether this contains blanks or not.

For example:

[qstr This is a simple test.] --> "This is a simple test."

QTK [arg ... arg]

Returns the single quoted token resulting from the concatenation of the string representation of all the arguments. The resulting string will start and end with quote (") characters. If the body of the string contains any quote characters, they will be doubled.

This function can be used, for example, to create a single command line parameter to a program. Raw strings on the command line would be interpreted incorrectly if they contained spaces or quote characters.

RDEG rad

Converts radians to degrees. Rad must be numeric. The result is always floating point.

RND arg

Returns arg rounded to the nearest integer. Arg must be numeric.

RUNEX arg ... arg

Run the command line that is the concatenation of the string representation of all the arguments.

The function returns the exit status code resulting from running the command. The variable EXITSTATUS and the script exit status code are NOT altered.

Any output from the program is discarded.

RUNSO arg ... arg

Run the command line that is the concatenation of the string representation of all the arguments.

The function returns the first standard output line emitted by the program as a string. All other output of the program is discarded.

The integer variable EXITSTATUS is set to the exit status code of the program. This variable is created if it does not already exist. The script exit status is raised to the program exit status code if it was previously lower.

RUNTF arg ... arg

Run the command line that is the concatenation of the string representation of all the arguments.

The function returns TRUE or FALSE depending on the exit status code. The exact interpretation of TRUE/FALSE from the exit status code is operating-system dependent. However, generally a exit status code of 0 is interpreted as TRUE, with anything else being FALSE. The variable EXITSTATUS and the script exit status code are NOT altered.

Any output from the program is discarded.

SEQ fnam [opt ... opt]

Get the value of a sequence number file and update it accordingly. Sequence number files are described in detail in the SEQUENCE documentation file. The returned data type is always integer.

Fnam is the name of the sequence number file. The ".seq" suffix is implied and may be omitted.

The remaining arguments are optional, and can modify the operation and return value. The possible opt arguments are:

AFT

Return the sequence number after the increment is applied (value written back to sequence number file). The default is to return the sequence number before the increment (value originally in file).

increment

The first integer opt argument is the amount to increment the value in the sequential number file by. The default is 1.

first

The second integer opt argument is the original sequence number to use if the sequence number file does not exist or is empty. The default is 1.

The sequential number file is read and updated as one atomic operation. Other concurrent attempts to access the file will result in operations wholly before or wholly after this one. This function can be useful for creating unique serial numbers, sequential build numbers, and the like.

SHIFTL val n

Return val shifted left by n bits. Both val and n must be integer. N may be negative, in which case val is logically shifted right by -n bits.

SHIFTR val n

Return val logically shifted right by n bits. Both val and n must be integer. N may be negative, in which case val is shifted left by -n bits.

SIN ang

Returns the sine of the angle ang. Ang must be numeric, and is in radians.

SINDX ind str

Returns a string of the single character at index ind in the string representation of str. Ind must be integer. The index of the first character of a string is 1.

The empty string is returned when ind indicates a character outside the input string (ind < 1, or ind > length of str).

SLEN arg

Returns the length of the string represenstation of arg. The returned value is always integer and ≥ 0.

SQRT arg

Returns the square root of arg. Arg must be numeric and ≥ 0. The return value is always floating point.

STR [arg ... arg]

Returns the concatenation of the string representation of each argument.

For example:

[str "abc" 13 'def' 27.1] --> "abc13def27.10000"

SUBSTR start len str

Returns the substring of the string representation of str that starts at character index start and extends for len characters. The first character of a string has index 1. The start and end of the substring is clipped to be within the input string. The empty string is returned if STR is empty.

For example:

[substr 2 5 "This is a test"] --> "his i"

SYM name [NL] [opt]

Returns information about a preprocessor symbol. Name is a string that is the name of the symbol inquiring about. Name may be a fully qualified symbol name (containing specific symbol type and/or version).

In all cases, if the symbol specified by name does not exist, the function returns the empty string.

The NL keyword cause name to be evaluated with local symbols ignored. Specifically, for any symbol that has a local version, the current version of that symbol will be the version previous to the local version. This effectively means symbols are evaluated in the parent context to the current block. NL has no effect if name specifies a absolute version.

Opt is a optional keyword specifying the type of information to return about the symbol. The choices for opt are:

TYPE

Symbol type. This is the default if opt is not supplied. The function value will be one of these upper case strings, indicating the type of symbol:

VAR
CONST
SUBR
MACRO
FUNC
CMD
LABEL

DTYPE

Symbol data type. The function value will be a upper case string containing the data type keyword. These are:

BOOL
INTEGER
REAL
STRING
TIME

See the Data Types section for details of data types.

The empty string is returned if name does not match the name of a preprocessor symbol that has a data type. For example, constants have data types, but subroutines do not.

VER

Returns the integer absolute version number of the symbol. Absolute versions are always ≥ 1.

NAME

Returns a string that is just the bare name of the symbol without any qualifiers.

QUAL

Returns the string containing the fully qualified name of the symbol (name:type:ver). The version is always absolute.

TAN ang

Returns the tangent of the angle ang. Ang must be numeric, and is in radians.

TNAM [arg ... arg]

Returns the full absolute treename of the file indicated by the concatentation of the string representation of all the arguments. If no arguments are supplied, the input file name is the empty string, which resolves to the current directory.

Embed Inc portable pathname rules are used to interpret the file name.

TRUNC arg

Returns the value of arg rounded to the nearest integer towards zero. This has the effect of "truncating" the fraction part of the value. Arg must be numeric. The result is always integer.

UCASE arg

Returns the string representation of arg with all aphabetic characters upper case.

UNQUOTE str

Returns the string argument with all layers of quotes removed. Double quote characters internal to the string will be interpreted as a single quote character. The valid quote characters are the double quote (") and apostrophie (').

For example:

[unquote ""'Messy string'"" ] --> "Messy string"

V arg

Returns the value of arg. This can be useful, for example, to explicitly dereference a variable.

VNL arg

Returns the value of arg. The evaluation of arg is performed with the current version of any symbols that have local versions, being the version previous to the local one. When explicit symbol versions are not used, this effectively means that local versions of symbols are ignored.

One purpose of this function is to allow interpreting references to variables in the context of the parent block. This is usually necessary when unqualified variable names are passed to a subroutine, for example. Well-written subroutines function regardless of the choice of variable name passed to them. However, if a passed-in variable name happens to match the name of a variable created in the subroutine, then a simple reference to that variable name will refer to the internal version, not the caller's version.

The solution is to evaluate the caller's variable with the VNL function, before any new global variables are created. In practise, this usually means to save the caller's value in a local variable early in the subroutine. If only local variables are created in the subroutine when the caller's variable is evaluated with the VNL function, then the variable will be evaluated in the caller's context.

NOTE: Functions are evaluated in the order from innermost to outermost. If the VNL argument is a result of other functions, local variables are disabled for the interpretation of the VNL argument, and NOT during the construction of the VNL argument. For example, suppose that ii is a global variable with value 3, then subroutine xxx is called:


  var new ii integer = 3

  ...

  Subroutine xxx
    var local ii integer = 7
    show ii                 //references local var, writes 7
    show [vnl ii]           //references parent var, writes 3
    show [vnl [+ ii 2]]     //the VNL arg is 9, writes 9
    show [+ [vnl ii] 2]     //writes 5
    endsub
    

The above means that the values of local variables can be used, for example, to build the name of a variable for the VNL function to dereference.

XOR arg1 [arg2 ... argN]

Logical exclusive OR when all arguments are boolean.

Bitwise exclusive OR when all arguments are integer.

The arguments data types must be either all bool or all integer. Arg1 is required.