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 (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Input String - this can be any String element

 

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 String.

 

Offset From - designates which end of the String is 'Offset 0':

 

  • Beginning - select this option if Offset From is relative to the first character in the Input String
     

  • End - select this option if Offset From is relative to the last character in the Input String

 

Note: the value for Offset From can be programmatically derived by the Find Within String (STRFIND) instruction.

 

Length - specifies the number of characters to copy

 

  • Number of characters - select this option to specify the number of characters to extract. This can be any readable numeric location or a constant value from 1 to the maximum number of characters in the string.
     

  • Remainder of Input String - select this option to extract all of the characters from the Offset to the end of the Input String

 

Output String - designates a String to store the extracted characters. This can be any writable String element.

 


Status Display:

The gray triangle at the right end of an input leg indicates the input is edge triggered.

 

The Status display of the Get Sub-String instruction will only display 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:

 


Related Topics:

String Functions Overview

 

String Scripting Language Reference

 


Rung Example: