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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open and Write Two (or more) Files Simultaneously

Status
Not open for further replies.

oholloway

Technical User
Apr 20, 2005
15
0
0
US
I have two macros that use the following method to open and write files:

Code:
    outF = freefile
    open Reports_Dir & SUBDIR & OFILE for output as #outF
    print #outF, HEADER
    print #outF, chr(34) & _
       header1 & c & header2 & c & chr(34)
    close outF

They both write to different files and reference two different sessions.I want them both to run at the same time but when I start one and then try to run the other the first macro stops,fails with the error:"Bad file name or number.Line 212.Stopping macro playback."I have tried to make sure that the file number it is addressing is different by manually setting outF to a static number,even writing a routine to randomly pick a number between 1 and 99 and assigning it to outF to make sure they are not addressing the same file but it keeps erroring at the line 212 which is the "print #outF, HEADER" line.
 
I forgot to mention that each macro,runs fine on its own.It is only when I try to run them both at the same time that I run into problems.I don't understand if they reference two different files,two sessions,each explicitly named,why can't they both write to their respective files.Programs do it all the time,why not Attachmate macros?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top