Re: reading status channel in ML

From: Greg King (gngking_at_erols.com)
Date: 2006-04-21 13:50:31

Think about FOR...NEXT loops in BASIC.  When you use several of them
together, they must be "nested:"

FOR X -------+
FOR Y -----+ |
FOR Z ---+ | |
  ...... | | |
NEXT Z --+ | |
NEXT Y ----+ |
NEXT X ------+

The policy is LIFO (Last-In, First-Out).
That same policy is needed for file control:

OPEN ------------+
CHKIN/CHKOUT --+ |
  ............ | |
CLRCHN --------+ |
CLOSE -----------+

---------------------------------------------------------

When we write Machine Language code for file operations, it helps to
remember how we do it in BASIC:

OPEN 15,8,15
INPUT#15,A,B$,C,D
CLOSE 15

OPEN 15,8,15 is the same as OPEN 15,8,15,"".  If FNLEN ($b7) weren't zero,
then we would have OPEN 15,8,15,"<garbage>".  If you remember that one way
to send DOS commands is:

OPEN 15,8,15,"<command>": CLOSE 15

then you can see why you got "30, SYNTAX ERROR".

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.