Topic: DMD0171 STRSUB - Get Sub-String |
|
The Get Sub-String (STRSUB) instruction will copy the specified characters from the Input String to the Output String.
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
Input String - this can be any user-defined or system-defined String.
Starting Offset - the offset of the first character to extract from the Input String. This can be any readable numeric location or any constant value between 0 and the maximum size of the Input String.
Offset From - specifies which end of the Input String is 'Offset 0'. The value for Offset From can be programmatically derived by the Find Within String (STRFIND) instruction.
Length - specifies the number of characters to copy:
Output String - specifies a String to store the extracted characters. This can be any writable user-defined or system-defined String. If the resulting contents of the STRSUB exceeds the maximum length of the output string, the output string will contain only the number of characters it can store (the remaining characters are lost) and a 'Buffer overflow' Warning will be generated.
Input Leg selects which of the following power-flow conditions will cause this instruction to run:
|
|
Status Display:
The Status display will only show as many of the characters of the Input String and Output String as will fit within the borders of the instruction, typically this is about 50 characters.
|
|
See Also:STR2REAL - Convert String to Real
STR2INT - Convert String to Integer
STRCASE - Convert String to UPPER / lower Case
STRCOPYR - Copy a Range of Strings
|
|
Related Topics:
String Scripting Language Reference
|
|
Rung Example:
|
|