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?
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?