Page 1 of 1 1
Topic Options
#155339 - 2006-01-15 04:30 AM ReadLine
tmclean Offline
Fresh Scripter

Registered: 2001-01-26
Posts: 18
Loc: Sault Ste. Marie Ontario
Using the example right out of the manual to readline in a file. When I run the script, the "0" error code is echoed in the display. How do you suppress that? Here's the sample right out of manual, modified slightly.thx

If Open(10, "C:\testlog.txt") = 0
;$x = ReadLine(10)
;WHILE @ERROR = 0
; ? $x
; $x = ReadLine(10)
; LOOP
Close (10)
ELSE
BEEP
? "Config file not opened, error code: [" + @ERROR + "]"
Endif

Top
#155340 - 2006-01-15 04:39 AM Re: ReadLine
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Trap (silence) your Close function return code, like this:

$Null = Close (10)

-Shawn

Top
#155341 - 2006-01-15 04:45 AM Re: ReadLine
tmclean Offline
Fresh Scripter

Registered: 2001-01-26
Posts: 18
Loc: Sault Ste. Marie Ontario
Thank-you very much. I love this forum!
Top
#155342 - 2006-01-15 02:40 PM Re: ReadLine
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
BTW, there are ready-made UDFs in the UDF Forum to read a complete text file into an array for further processing, e.g. ReadFile() - Read a file into an array .
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.06 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org