QB / QB64 Discussion Forum     RULES     Other Subforums, Links and Downloads    Index of Threads

 

 Return to Index  

Re: Please Respond...

December 15 2003 at 7:13 PM
  (Login Mac36)


Response to Please Respond...

 

A few observations

I looked through your post. You had posted it incorrectly such that there was no indentation, making it hard to read. I corrected that.

You have the test
OPEN "C:\Xinit.Krl" FOR INPUT AS #1
  IF LOF(1) = 0 THEN
(and similar)

This will not normally work. Usually one codes
OPEN "C:\Xinit.Krl" FOR BINARY AS #1

In your case, it will work because of a really non-recommended technique you used:

You have one
ON ERROR GOTO Handle
That applies across the board to all instructions, whether bugs coded by you or what. Thereafter, essentially, you ignore all errors. I would never do that.

I code
MyErr=0: ON ERROR GOTO GetMyError
(an instruction or two that I want to supress errors on)
ON ERROR GOTO 0 '<---- Extremely important.
(test MyErr)

And in some place code
GetMyError:
MyErr=Err
resume next

So instead of
OPEN "C:\Xinit.Krl" FOR INPUT AS #1
  IF LOF(1) = 0 THEN

I would code
MyErr=0: ON ERROR GOTO GetMyError
OPEN "C:\Xinit.Krl" FOR INPUT AS #1
ON ERROR GOTO 0
IF MyErr > 0 THEN

Mac

P.S. Check out Solitaires post on how to send binary files.

 
 Respond to this message   
Response TitleAuthorDate
 Thanks Mac Aug 15, 2004
 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement