HP3000-L Archives

August 1999, Week 4

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:
Barry Lake <[log in to unmask]>
Reply To:
Barry Lake <[log in to unmask]>
Date:
Tue, 24 Aug 1999 16:48:08 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
At 4:23 PM -0700 8/24/99, [log in to unmask] wrote:
>Barry Lake wrote:
>
>> How about this...
>>
>>   setvar _test "this    is a           test    string"
>>   setvar w_count wordcnt(_test)
>>
>> You can "take the 'word' route" as long as you're on an MPE release that
>> has the wordcnt function.
>
><sigh>  i can't do 'wordcnt' as i'm only on 5.5pp6 <sigh>           - d


Oops, I had sent my follow-up reply refining my original reply before I saw
this. Of course, without the wordcnt function the solution is more klunky,
but it still is possible:

  setvar _test "this    is a           test    string"
  setvar i 0
  setvar _continue true
  while _continue
     setvar i i + 1
     setvar _word word(_test, ' ', i)
     if len(_word) > 0
        if i = 1
           setvar _temp _word
        else
           setvar _temp _temp + ' ' + _word
        endif
     else
        setvar _continue false
     endif
  endwhile
  setvar _test _temp


Barry Lake                                        [log in to unmask]
Tidal Software, Inc.                              www.tidalsoft.com
(650)493-4122

ATOM RSS1 RSS2