HP3000-L Archives

October 2001, 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:
Ric Merz <[log in to unmask]>
Reply To:
Date:
Thu, 18 Oct 2001 14:50:33 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (71 lines)
Wouldn't it be easier to just have a parameter on the command as:

PARM FILEIN
setvar cntr 0
while setvar(cntr,cntr+1) <= finfo('!FILEIN','eof')
  input var!cntr <!FILEIN
endwhile
showvar var@

Also, this code only reads the first record of the input file, over and
over again.  You could add code to copy the input file into a message file,
then set your variables from the message file.

Ric


At 12:51 PM 10/18/2001 -0700, you wrote:
>I just hit upon a neat trick.  This maybe old-hat but it's new to me.
>
>I built a command file, we'll call it cmd1.  This command file reads an
>input file to set variables.
>I discovered that I can make this command file very generic for multiple
>uses by setting a file  equate before issueing the command file.
>
>If I set a file equate:  FILE XYZ = MYFILE
>
>When I issue the command file I include the back reference:   CMD1 < * XYZ
>
>The ability for FINFO to read the back-reference is what makes this command
>usefull for many applications, limited only by ones imagination.
>
>Has anyone else out there use a back reference within FINFO before?
>
>here's the command file (CMD1)
>
>setvar cntr 0
>while setvar(cntr,cntr+1) <= finfo('*xyz','eof')
>   input var!cntr < *xyz
>endwhile
>showvar var@
>
>This input file (myfile) contains the following (you can have as many
>records or as few as you need)
>
>011018
>DATA1.MYGROUP.ACCOUNT
>OUTFILE
>USER1
>USER2
>USER3
>.
>.
>.
>.
>
>
>Larry A. Barnes
>Systems Administrator - HP3000
>Coldwater Creek Inc.
>751 W. Hanley Ave.
>Coeur d'Alene, ID  83815-3213
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
Ric
[log in to unmask]

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2