Skip to main content

10.6.2. String Function

10.6.2. String Function

 

Returned value of string function is string.

 

Table 1034 String functions of the robot language

Function name

Explanation

Example

Returned value

CHR$(a)

Character whose ASCII code is ‘a’ is returned.

CHR$(65)

“A”

STR$(a)

Decimal digit string of numeral ‘a’ is returned.

STR$(13.25)

“13.25”

BIN$(a)

Binary digit string of numeral ‘a’ is returned.

BIN$(&B0010)

“10”

HEX$(a)

Hexadecimal digit string of numeral ‘a’ is returned.

HEX$(&H7A2F)

“7A2F”

MIRROR$(a)

Reversed string of string ‘a’ is returned.

MIRROR$("HELLO")

“OLLEH”

LEFT$(a,b)

String with first ‘b’ character(s) of string ‘a’ is returned.

LEFT$("HELLO",2)

“HE”

MID$(a,b,c)

String with ‘c’ character(s) from ‘b’ character of string ‘a’ is returned.

MID$("HELLO",2,3)

“ELL”

RIGHT$(a,b)

String with last ‘b’ character(s) of string ‘a’ is returned.

RIGHT$("HELLO",2)

“LO”

DATE$

Current date converted into string is returned. (YYYY/MM/DD)

DATE$

“2001/02/18”

TIME$

Current time converted into string is returned. (HH:MM:SS)

TIME$

“08:48:14”

FULLBIN$(a,b)

Convert a decimal number to a binary, and insert zeros in front of the binary digit until the total digits are as many as the b digits.

a: Decimal number to convert

b: Binary digit (Operation after the V40.23-04_20200730 version)

FULLBIN$(17,8)

00010001