HiLMAs reference
Back

String Handling

Next

WORD

WORD number,string,start,length

 

Description

WORD statement scans input string; word in position denoted by number ordinal is searched and position is returned in start and length variables.

If number is zero, number is also an output parameter and returns the total number of words of string and in start and length there are the position of the last word found in string (just the number word).

If the specified number exceed the number of words contained in string, number is also an output parameter and return the total number of words of string and in start and length there are the position of the last word found in string.

If number is a negative number, the scan is done starting from the last character of the string; so, -1 is the last word, -2 is the next to last and so on. If the negative number exceed the number of words contained in string, again number is also an output parameter and return the total number of word (again negative) of string and in start and length there are the position of the first word found in string.

Note that here length is mandatory variable and has a different mean from the other string management instructions.

 

Parameter specifications

Parameter Name Mode Type coding Remark
1 number Input/Output String F or H Word number to search
2 string Input  String C or X String to be scanned; max length 255 char.
3 start Output Integer F or H Start of the required word
4 length Output Integer F or H Length of the required word

 

Examples

 


Back Start Next
CENTER Top BITAND