HP3000-L Archives

June 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"VANCE,JEFF (HP-Cupertino,ex1)" <[log in to unmask]>
Reply To:
VANCE,JEFF (HP-Cupertino,ex1)
Date:
Mon, 19 Jun 2000 14:42:45 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (35 lines)
I'm not sure this is elegant, but here goes:

:setvar x '999 xxxxxxx yy y  y,y, y'
:calc len(x)
24, $18, %30
:calc word(x)
999
:calc word(x,,2)
xxxxxxx
:calc rht(x,-delimpos(x,,2)-1)
yy y  y,y, y

> I'm working on a mpe script blah blah
> blah and i have a string in the following format: # xxxxxx
> yyyyyyyyyy
> where # is a number
>  xxxxx is something but there are no spaces in it (variable
> length)
>  yyyyyy  is also something but there may or may not be
> spaces in it (variable length)
>
> obviously, using the word function to extract # and xxxxx is
> a piece o'cake.  i'm wondering though about extracting
> yyyyyy.  word isn't going to give me what i want because of
> the possibility of spaces (or other default delimiters).
> currently i'm letting word tell me where xxxxx ends,
> determining the length of the entire string and calculating
> the difference to determine the beginning position of yyyyy
> and it's length.  it certainly works, but is rather low on
> the elegance scale.  any suggestions for something more
> elegant/wonderful?               - d

HTH,
 Jeff Vance, CSY

ATOM RSS1 RSS2