vipsi - the built-in words
Author: kio@little-bat.de
Keywords: vipsi shell script interpreter programming

# vipsi - shell and script language

## the built-in words

### text (string) functions

functions which return text values.

#### name

    name variable_ref

querry name of variable. e.g.: `name a[0]`

#### string

    text_value=string value

convert expression to text representation.

e.g.: `string(47+11) = "58".`

#### upperstr

    text_value = upperstr text_value

convert text to all uppercase characters conforming to utf-8 unicode.

e.g. `"HELLO WORLD!" = upperstr("Hello World!").`

#### lowerstr

    text_value = lowerstr text_value

convert text to all lowercase characters conforming to utf-8 unicode.

e.g. `"hello world!" = lowerstr("Hello World!").`

#### charstr

    text_value=charstr num_value

convert unicode character code (number) to character (text).

e.g.: `charstr 8364 = "€".`

#### hexstr

    text_value = hexstr( num_value1 [,num_value2] )

convert number 1 to hexadecimal digit string. resulting text is sized to fit or sized according to number 2, truncating or padding 0's to the left.

e.g.: `hexstr(240) = "F0"; hexstr(240,4) = "00F0"; hexstr(240,1) = "0".`

#### binstr

    text_value = binstr( num_value1 [,num_value2] )

convert number 1 to binary digit string. resulting text is sized to fit or sized according to number 2, truncating or padding 0's to the left.

e.g.: `binstr(10,8) = "00001010"; binstr(10,2) = "10".`

#### substr

    text_value = substr( text_value, num_value1, num_value2 )

calculates substring from n1 to n2 incl. of text, resulting in n2-n1+1 bytes. indexes refer to byte positions, not character positions if they are different.

#### midtsr

    text_value = midstr( text_value, num_value1, num_value2 )

get substring from n1 to n1+n2-1 from text, resulting in n2 bytes. index and count refer to byte positions, not character positions if they are different.

#### leftstr

    text_value = leftstr( text_value, num_value )

calculate substring: get number bytes from the left side of the text. count refers to byte positions, not character positions if they are different.
functional equivalent to `text[to num_value]`.

#### rightstr

    text_value = rightstr( text_value, num_value )

calculate substring: get number bytes from the right side of the text. count refers to byte positions, not character positions if they are different.

e.g.: `rightstr("anton",3) = "ton".`

#### datestr

    text_value = datestr num_value

convert numeric date format to readable text.

e.g.: `datestr 0 = 1970-01-01 01:00:00.`

#### fullpath

    text_value = fullpath text_value

get fully qualified path for partial path. expands "./" and "../", symbolic links, "~" and relative path to the absolute file or directory path.