Text functions

<< Click to Display Table of Contents >>

Navigation:  Macros > Macro commands and parameters > Macro functions >

Text functions

Function

Purpose

Example

Result

UPPERCASE

Conversion to uppercase

Text(UPPERCASE('abc'))

ABC

LOWERCASE

Conversion to lowercase

Text(LOWERCASE('ABC'))

abc

TRIM

Deletion of leading and trailing spaces

Text(TRIM(' abc '))

abc

LEFTSTR

First characters of a string

Text(LEFTSTR('abc',2))

ab

RIGHTSTR

Last characters of a string

Text(RIGHTSTR('abc',2))

bc

MIDSTR

Middle characters of a string

Text(MIDSTR('abcde',2,3))

bcd

LENGTH

Number of characters of a string

Text(LENGT('abc'))

3

POS

Position of a text in a string

Text(POS('bc','abcde'))

2

CHR

Character corresponding to an Ascii value

Text(CHR(66))

B

ASC

Ascii value of a character

Text(ASC('A'))

65

REPLACESTR

Replaces OldPattern with NewPattern in a text string

Set(S,'abcde')

Text(REPLACESTR(S,'cd','12')

 

ab12e

REALTOSTR

Conversion of a real number to a string

Text(RealToStr(1.23))

1.23

STRTOREAL

Conversion of string to real number

 

 

SAMETEXT

Checks equality of two strings, case insensitive

Text(SameText('Vision','VISION'))

TRUE

CONCAT2STR

Concatenation of two strings

Text(Concat2Str('1','two'))

1two

CONCAT3STR

Concatenation of three strings

Text(Concat3Str('1','two','3'))

1two3

CONCAT4STR

Concatenation of four strings

Text(Concat4Str('1','two','3','four'))

1two3four