TestIT:Programming Text

From Nolek Wiki
Jump to navigation Jump to search

5.3.7 Text

StringClear

Description:
It will set symbol value to empty string.

Code example:

Text.StringClear(_ST01)
Parameters
Parameter Type Description
Symbol String symbol Symbol to clear

StringMove

Description:
It will move text value to symbol.

Code example:

Text.StringMove(_ST01,"New text")
Parameters
Parameter Type Description
Symbol String symbol Symbol to receive result
Value String or String symbol Value or symbol to move

StringConcatenate

Description:
It will combine two symbol values to one text string.

Code example:

Text.StringConcatenate(_ST01,"New ","text")
Parameters
Parameter Type Description
Symbol String symbol Symbol to receive result
Value String or String symbol Value or symbol to move
Value String or String symbol Value or symbol to move

StringMid

Description:
It will return a part of a text value.

Code example:

Text.StringMid(_ST01,"New text", 5, 3)
Parameters
Parameter Type Description
Symbol String symbol Symbol to receive result
Value String or String symbol Value or symbol to move
Start character Int or Int symbol Start character
Number of characters Int or Int symbol Number of characters

StringRemove

Description:
It will remove part of a text value.

Code example:

Text.StringRemove(_ST01,"New text", 4, 3)
Parameters
Parameter Type Description
Symbol String symbol Symbol to receive result
Value String or String symbol Value or symbol to move
Start Index Int or Int symbol Start character
Number of characters Int or Int symbol Number of characters

StringReplace

Description:
It will replace every occurrence of a value with another.

Code example:

Text.StringReplace(_ST01,"New text", "e", "o")
Parameters
Parameter Type Description
Symbol String symbol Symbol to receive result
Value String or String symbol Value or symbol to move
From String or String symbol From character
To String or String symbol To character

StringLength

Description:
It will measure the length of the string.

Code example:

Text.StringLength(_IN01,"New text")
Parameters
Parameter Type Description
Symbol Int symbol or Double symbol Symbol to receive result
Value String or String symbol Value or symbol to move

StringToVal

Description:
It will convert a text value to a number.

Code example:

Text.StringToVal(_IN01,"9")
Parameters
Parameter Type Description
Symbol Int symbol or Double symbol Symbol to receive result
Value String or String symbol Value or symbol to use

StringValueToString

Description:
It will convert a number value to a text value.

Code example:

Text.StringValueToString(_ST01,9)
Parameters
Parameter Type Description
Symbol String symbol Symbol to receive result
Value Int, Double, Bool, Int symbol, Double symbol or Bool symbol Value or symbol to use

StringCompare

Description:
It will compare two symbol values, and return the value True if they are the same.

Code example:

Text.StringCompare(_B01,"9","8")
Parameters
Parameter Type Description
Result Bool symbol Symbol to receive result (true if the same)
Text 1 String or String symbol Text or symbol to compare
Text 2 String or String symbol Text or symbol to compare

StringArrayToString

Description:
It will combine symbol values to one text string with selected split character.

Code example:

Text.StringMove(_ST02,"Hello")
Text.StringMove(_ST03,"World")
Text.StringArrayToString(_ST01,_ST02;_ST03,Underscore)
Parameters
Parameter Type Description
Result String symbol Symbol to receive result
Array Symbol array Array of symbols
Split Split sign if any Select split sign. (Space, Underscore, Semicolon, Colon, At sign, Slash, Backslash, Plus, None)

StringCharToHex

Description:
It will convert char value to Hex value.

Code example:

Text.StringCharToHex(_ST01,"A")
Parameters
Parameter Type Description
Result String symbol Symbol to receive result
Value String or String symbol Value or symbol to use

StringHexToChar

Description:
It will convert string value to Hex value.

Code example:

Text.StringHexToChar(_ST01,"61")
Parameters
Parameter Type Description
Result String symbol Symbol to receive result
Value String or String symbol Value or symbol to use

StringDecToHex

Description:
It will convert decimal value to Hex value.

Code example:

Text.StringDecToHex(_ST01,61)
Parameters
Parameter Type Description
Result String symbol Symbol to receive result
Value Int or Int symbol Value or symbol to use

StringSplitToArray

Description:
Split a text value into a symbol array with a split character as divider.

Code example:

Text.StringMove(_ST02,"Hello_world")
Text.StringSplitToArray(_ST01,_ST02,_Msg1;_Msg2;_Msg3,Underscore)
'_ST01 = "OK"
'_ST02 = "Hello_world"
'_Msg1 = "Hello"
'_Msg2 = "world"
'_Msg3 = ""
Parameters
Parameter Type Description
Result String symbol Symbol to receive result of split and conversion (OK = success)
Input String symbol String to split
Array Symbol array Array of symbols
Split Split sign if any Select split sign. (Space, Underscore, Semicolon, Colon, At sign, Slash, Backslash, Plus)

StringDecToChar

Description:

It will return a string with the control char as string.

Code example:

Text.StringDecToChar(_ST01,72)
'_ST01 = "H"

Parameters
Parameter Type Description
Symbol String symbol Symbol to receive result
Value String or String symbol Value or symbol to use

StringToUpper

Description:
It will convert to uppercase.

Code example:

Text.StringToUpper(_ST01,"abc")
Parameters
Parameter Type Description
Result String symbol Symbol to receive result
Value String or string symbol Value or symbol to use

StringToLower

Description:
It will convert to lowercase.

Code example:

Text.StringToLower(_ST01,"ABC")
Parameters
Parameter Type Description
Result String symbol Symbol to receive result
Value String or string symbol Value or symbol to use


Back to Programming - Commands