HP3000-L Archives

October 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:
Mon, 25 Oct 1999 12:58:42 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
At 12:33 PM -0700 10/25/99, [log in to unmask] wrote:
>this seems kinda silly, but i'm stumped....  say i want to
>write a command file to process the contents of some flat
>(not message!) file.  the ci syntax would/should simply be
>":mycmd < myfile".  the problem is (to me) how to do the
>looping inside of 'mycmd'.  i can say:
>
>setvar _filename input()
>echo !_filename
>
>but that only gets me the first record in 'myfile'.  i've
>looked (some) at denkor's site.  i've looked at the command
>files i have.  what i'm consistently seeing is the looping
>is being controlled by some mechanism tied to the eof of the
>redirected file.  is that the only way to do
>it?                  - d


Just two weeks ago there was a long thread on exactly this problem. One
solution presented (by someone other than myself) was:

  setvar eof finfo(HPSTDIN,'eof')
  while setvar(eof,eof-1) > 0 do
     input record
     ...<statements to process the contents of the record variable>
  endwhile
  deletevar record,eof

I found this in a quick search of the archive at http://raven.utc.edu

HTH,
Barry

ATOM RSS1 RSS2