$return = GetField(string,field#[,separator])
Where:
$return | receives the field read from the string. |
string | is the string containing the field to be extracted. |
field# | is the field number to extract. |
separator | is the single character field separator. The default is a comma. If coding a comma it should be enclosed in double quotes. |
string, field# and separator may be variables.
The GetField command extracts a field from a field-separated string and copies it into a script variable.
Examples
$Field = GetField("The quick brown fox",2," ")
$Field = GetField("The,quick,brown,fox",2,",")
Sample Script
' GetField.txt
' Sample script to extract fields
'
$String = "The quick brown fox"
$FieldNumber = 1
$Fields = 4
LOOP:
$Field = GetField($String,$FieldNumber," ")
type($Field)
$FieldNumber = $FieldNumber + 1
if $FieldNumber < $Fields then GoTo LOOP:
Exit
See Also:
TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.