Advertisement

File i/o error using file number #1

Discussions about chromatography data systems, LIMS, controllers, computer issues and related topics.

3 posts Page 1 of 1
I can not figure this out at all.

I am running a macro report offline and I am getting the error in the topic line.
The report works for some files and and not for others and it seems to also depend on the workstation being used?? Anyone have any ideas???

This is where I believe the error comes from, but I'm not sure how to fix it.

name report

tempfile$=_exepath$ + "Input.txt"

bunch of lines.....

! Print file (to Printer)
Open tempfile$ for input as #1
counter=43
i=0
While i < 2
Input #1, line$
counter = counter + 1
StrPrint "" + line$, 1, counter
If LEN(line$)= 0
i=i+1
Else
i=0
EndIf
If counter = 70 Then
EndPrint
StartPrint
StrPrint "Data file: " + _DataPath$ + _Datafile$, 1, 1
Counter = 3
EndIf
EndWhile
Close #1
EndPrint
Draw 2, R5
Delete _ExePath$ + "Input.txt", DontAsk
not sure about Chemstation macros, but from the days of yore file handles
numbered
1 - standard output
2 - standard input
3 - standard error
And that is so for nearly all platforms.
And while the program works they are already opened.

Try #7 for instance :)
Agreed. I don't like using 1, 2 or 3 for I/O. If you go read some of the macros that HP wrote you'll see that they favor using #30, #50 and #100 for file numbers.
Mark Krause
Laboratory Director
Krause Analytical
Austin, TX USA
3 posts Page 1 of 1

Who is online

In total there are 26 users online :: 1 registered, 0 hidden and 25 guests (based on users active over the past 5 minutes)
Most users ever online was 4374 on Fri Oct 03, 2025 12:41 am

Users browsing this forum: Majestic-12 [Bot] and 25 guests

Latest Blog Posts from Separation Science

Separation Science offers free learning from the experts covering methods, applications, webinars, eSeminars, videos, tutorials for users of liquid chromatography, gas chromatography, mass spectrometry, sample preparation and related analytical techniques.

Subscribe to our eNewsletter with daily, weekly or monthly updates: Food & Beverage, Environmental, (Bio)Pharmaceutical, Bioclinical, Liquid Chromatography, Gas Chromatography and Mass Spectrometry.

Liquid Chromatography

Gas Chromatography

Mass Spectrometry