Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable id for fopen commands?

Status
Not open for further replies.

MicahG

Technical User
Jul 1, 2008
3
US
I need to open 16 temp files (using fopen) to later be written to a permanent file.

I need the id of the fopen command to be a variable. Here's what I have written:

for tempfile = 1 upto 16
fopen tempfile defaultpath CREATE
fputs tempfile "SLOT $tempfile"
fputs tempfile " "
call cards
call gettiming
call biterrors
fclose tempfile
endfor

The variable "tempfile" is used in the other procedures I have written (I have tempfile predefined as a global variable). In the other procs, I never change the value of "tempfile", just use it as a reference. Is there any way this can be accomplished, or do I have to revamp my code with a switch statement?
 
nevermind I figured it out, thanks anyways!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top