Donna,
I think the problem is that line " setvar x!i xword(xx,' .,/')" never has
a different value for the variable "xx". I also think you want to use the
"word" function to extract a single word rather than the string minus the
word.....
setvar x 'remote :node hello sesname,mgr/pass.account,group'
setvar i 0
setvar xx x
while xx > ' ' and i < 10
setvar i i +1
setvar x!i word(xx,' .,/',i)
endwhile
showvar x@
Hope this helps,
David N. Lukenbill
Computer Sciences Corporation
|---------+--------------------------->
| | Donna Garverick |
| | <dgarverick |
| | @longs.com> |
| | Sent by: HP-3000|
| | Systems |
| | Discussion |
| | <HP3000-L |
| | |
| | |
| | 03/05/30 03:59 |
| | PM |
| | Please respond |
| | to Donna |
| | Garverick |
| | |
|---------+--------------------------->
>---------------------------------------------------------------------------------------------------------------|
| |
| To: [log in to unmask] |
| cc: |
| Subject: [HP3000-L] help with word function |
>---------------------------------------------------------------------------------------------------------------|
hi all!
i'm wondering how to change the default delimiters for
word/xword. here's the (rather un-)help(-ful) text
regarding delimiters:
The default delims are a space, a comma,
a semicolon, an equals sign, left and right
parentheses,
left and right brackets, single quote, double
quote,
and tab.
that's lovely....but how do you change the defaults? with a
quoted string? if you change the defaults, do your changes
override/replace the defaults? or add to the defaults?
use the following string and code snippet as an example:
setvar x 'remote :node hello sesname,mgr/pass.account,group'
setvar i 0
setvar xx x
while xx > ' ' and i < 10
setvar i i +1
setvar x!i xword(xx,' .,/')
endwhile
showvar x@
(the i<10 is there to keep the code from going into an
endless loop <sigh>)
i want to extract each 'word' from the string contained in x
(or xx). if my delimiters are a space, period, comma and
slash -- you'd think that code should work. i should get
x1 = 'remote'
x2 = ':node'
x3 = 'hello'
...and so on.... but i don't :-( any thoughts? -
d
ps -- extra credit for finding the communicator that talks
about word or xword....
--
Donna Garverick Sr. System Programmer
925-210-6631 [log in to unmask]
Come, my friends, 'Tis not too late to seek a newer world.
Tho' much is taken, much abides; and tho'
We are not now that strength which in old days
Moved earth and heaven, that which we are, we are.
"Ulysses", A. Tennyson
>>>MY opinions, not Longs Drug Stores'<<<
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|