You can use COMMON and put them into an $INSERT statement.

For example, 

COMMON /FILEVARS/ f.var1, f.var2,...  and save it as my filevars in your BP file or 
any other directory you wish.

Then, in your program,

PROGRAM myprog

$INCLUDE BP myfilevars
   .
   .
   .

OR just copy the common into each of the programs you need. For example

PROGRAM myprog

COMMON /FILEVARS/ f.var1, f.var2


This way, you are only passing in the file variable names into your 
subroutine/function.

Plus, I think using multi-valued file.vars isn't a good idea.

HTH!!

Grant W. Boice, Jr.
Systems Administrator
Benchmark Electronics, Inc.
Manassas Division
8500 Phoenix Drive
Manassas, VA  20110
 
Phone:  (703) 334-0156
Email:   [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
Web:    www.bench.com <http://www.bench.com> 
 




-----Original Message-----
From: Shawn Waldie [mailto:[EMAIL PROTECTED]
Sent: Monday, July 19, 2004 3:59 PM
To: [EMAIL PROTECTED]
Subject: [U2] [UD] READU


I'm attempting to use READU in the following fashion, but the code won't
compile.  However, all is well and runs well when I replace File.Vars<I>
with f.var1 - in the READU statement.


ERROR.RET = ""
ERROR.MSG = ""
f.var1    = ""
CALL OPEN.FILE(f.var1,"actual file name",ERROR.RET,ERROR.MSG)


File.Vars<1> = f.var1
File.Vars<2> = f.var2

FOR I = 1 TO I.END
  READU R.record FROM File.Vars<I>,rec.ID THEN
    ...load attribute vars
  END
NEXT I



The compiler returns this message:

main program: syntax error at or before
<line xxx> READU R.record FROM File.Vars<I>,rec.ID THEN
           --------------------------------^
Expecting: ELSE



Suggestions are most welcome.
************************************************
* Shawn Waldie                San Juan College *
* Programmer/Analyst         4601 College Blvd *
* Phone: (505)566-3072   Farmington, NM  87402 *
*      email: [EMAIL PROTECTED]       *
*                                              *
* HP-UX 11.11   UniData 6.0.4    Colleague R17 *
************************************************
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to