While Barry's suggestion is very compact and straight forward, it also
requires a minimum OS release of 5.5 pp7 (I think) since 'word' is a
relatively 'new' CI evaluator function. The following works using 'older'
functions:
setvar tempvar "[log in to unmask]"
setvar p1 pos(".",tempvar,1)
setvar p2 pos(".",tempvar,2)
setvar tempvar1 lft(tempvar,p1 - 1)
setvar tempvar2 str(tempvar,p1+1,p2-p1-1)
setvar tempvar3 rht(tempvar,-(p2+1))
showvar temp@
TEMPVAR = [log in to unmask]
TEMPVAR1 = AI@J
TEMPVAR2 = GROUP1
TEMPVAR3 = ACCOUNT1
Regards
Paul Christidis
At 5:08 PM -0400 9/26/00, [log in to unmask] wrote:
>1. TEMPVAR = "[log in to unmask]"
...
>
>How do I break this up into 3 different variable TEMPVAR1, TEMPVAR2,
>TEMPVAR3 such that the results should be as follows:
>
>1. TEMPVAR1 = "AI@J", TEMPVAR2 = "GROUP1", TEMPVAR3 = "ACCOUNT1"
...
>
>Is there any option other than involving a WHILE loop with continious read
>till I reach "." in each attempt and process it accordingly. Any better,
>fast and best ideas ? Thanks in advance.
How about
:setvar tempvar "[log in to unmask]"
:setvar tempvar1 word(tempvar,'.',1)
:setvar tempvar2 word(tempvar,'.',2)
:setvar tempvar3 word(tempvar,'.',3)
:showvar temp@
TEMPVAR = [log in to unmask]
TEMPVAR1 = AI@J
TEMPVAR2 = GROUP1
TEMPVAR3 = ACCOUNT1
:
Barry Lake [log in to unmask]
Allegro Consultants, Inc. www.allegro.bogus.com
(408)252-2330
--------
Attempting to use anti-spam technique.
Remove ".bogus" to create valid address.
|