#43103 - 2003-07-21 01:41 AM
Selecting parsed variables
|
Anonymous
Anonymous
Unregistered
|
Hi guys. My first post and I'm not a developer or programmer so please don't be too harsh.
I am looking for a way to select a certain variable from a line read from a file. In REXX variables could be parsed (space delimited) using the function PARSE VAR as in the example below.
Say a line in a file was written as follows
THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG.
And I wanted to find out what the third word in the line was. I would write the REXX procedure as follows:
PARSE VAR [line read in] #var1 #var2 #var3 #var4
Which would give me an output of
THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG
Of more succinctly I would simply select the variable in my code as follows:
SAY #var3
Which would display on the screen "BROWN".
I would like to do the same thing with Kixtart and I have looked at SPLIT but this does not seem to allow me to achieve this, e.g. choose which variable I want to work on. Am I doing something wrong? Any help or direction would be most appreciated.
Sorry for the long-winded example....
Kenno
kjmoule@mmm.com
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1044 anonymous users online.
|
|
|