Functions

In the following list of functions, only the textfunctions are explained. For full documentation, refer to the Realsoftware website.

Note that all string functions return a copy of the string and leave the input string unchanged.

abs(double) as double

acos(double) as double

asc(string) as integer

Returns the Ascii-value for the first character of a string.

ascb(string) as string

Returns the Ascii-value for the first byte of a string. This makes a difference for double-byte languages like japanese.

asin(double) as double

atan(double) as double

atan2(double,double) as double

bitwiseand(integer,integer) as integer

bitwiseor(integer,integer) as integer

bitwisexor(integer,integer) as integer

cdbl(string) as double

Returns the numerical value of a string

ceil(double) as double

chr(double) as string

Returns the character of a given Ascii-value.

Newline is chr(13) and tabulator is chr(9). While Windows textfiles use chr(13)+chr(10) for newline, for the filters only chr(13) is used. The parsing of the correct line separator should be done with the input and the output filters. To write platform independent code, you should better use getnewline than chr(13).

chrb(double) as string

Returns a singlebyte-character of a given Ascii-value.

closeprogress

Makes the progress bar invisible.

cos(double) as double

countfields(string1,string2) as integer

Returns the number of fields in string1, given the separator string2. The separator is not case-sensitive.

Returns 1 if the separator is not present, and 0 if the string1 is empty.

cstr(double) as string

Converts a number to a string using local conventions.

exp(double) as double

false

floor(double) as double

format(double,string) as string

Converts a number to a string using a given formatstring. The following characters are allowed:

Use the following format for integers:

format(5958020,"0") = 595820

Use the following format for timecodes:

format(5958020,"00\:00\:00:\00") = 00:59:58:20

hex(integer) as string

Formats the number using hexadecimal notation.

instr(integer,string1,string2) as integer

Looks for an occurence of string2 in string1, starting at position of integer. If it finds one, it returns the position, if it doesn't, it returns zero.

Instr is not case-sensitive.

instrb(integer,string1,string2) as integer

Looks for an occurence of string2 in string1, starting at position of integer, using raw bytes. If it finds one, it returns the position, if it doesn't, it returns zero.

left(string,integer) as string

Returns the leftmost characters of a string.

leftb(string,integer) as string

Returns the leftmost characters of a string, using bytecount.

log(double) as double)

lowercase(string) as string

Returns the string with all lowercase characters.

ltrim(string) as string

Removes the spaces at the beginning of the string

max(double,double) as double

microseconds

mid(string,integer1,integer2)

Returns a substring of string starting at position integer2 and with a length of integer2.

midb(string,integer1,integer2)

Returns a substring of string starting at position integer2 and with a length of integer2, using byte count.

min(double,double) as double

nthfield(string1,string2,integer) as string

Returns the nth field in string1, using string2 as a separator. The string2 is not case-sensitive.

oct(integer) as string

Formats the number using octal (base 8) notation.

pow(double,double) as double

print string

Prints to the console.

redim array(integer)

replace(thestring,oldstring,newstring) as string

Replaces the first occurence of oldstring in thestring with newstring. The replace is not case-sensitive.

replaceall(thestring,oldstring,newstring) as string

Replaces all occurences of oldstring in thestring with newstring. The replace is not case-sensitive.

right(string,integer) as string

Returns the rightmost characters of a string

rightb(string,integer) as string

Returns the rightmost characters of a string, suing byte count

rnd as double

round(double) as double

rtrim(string) as string

Removes spaces at the end of the string

sin(double) as double)

sqrt(double) as double

str(double) as string

Converts a number to a string, using default formats. Is fast coded, but for big numbers, format(double,"0") does a better job.

strcomp(string1,string2,integer) as integer

Compares string1 with string2, using criterium integer

It returns -1, if the string2 is later in the alphabet, +1 if it is before, and 0, if both strings are the same. This function with criterium 0 is more exact than the operator =, which is case-insensitive

tan(double) as double

ticks as integer

titlecase(string) as string

Returns the string with every first character of a word in capitals.

trim(string) as string

Removes spaces at both the beginning and the end of the character

true

ubound(array)

Returns the highest index of a single-dimensioned array.

uppercase(string) as string

Returns the string all letters in capitals

val(string) as double)

Returns the numeric value of a string, using the point as decimal separator.


www.belle-nuit.com - 11.6.4