
Section 4 General Programming
4.23
560 PRINT:PRINT:PRINT"Macro Backup Completed"
570 END
580 '
590 ' get output file name
600 '
610 CLS
620 PRINT : PRINT"Send Macro Buffer data to what file? => ";
630 LINE INPUT F$
640 IF F$ = "" THEN PRINT CHR$(7) : GOTO 610 ' try again
650 ' add extension if not included
660 IF INSTR(F$,".") THEN GOTO 670 ELSE F$ = F$ + ".mcr"
670 ' check if file already exists
680 ON ERROR GOTO 800
690 OPEN F$ FOR INPUT AS #2
700 CLOSE #2
710 PRINT: PRINT CHR$(7);"Replace existing ";F$;" File?
(Y/N) ";
720 K$ = INKEY$ : PRINT K$;
730 IF K$ = "y" OR K$ = "Y" THEN GOTO 760
740 IF K$ = "n" OR K$ = "N" THEN GOTO 620
750 GOTO 720 ' try agin for valid key press
760 ' open the disk file
770 ON ERROR GOTO 0 ' turn error off
780 OPEN F$ FOR OUTPUT AS #2
790 RETURN
800 ' file does not exist error
810 RESUME 760
The following describes the functionality of the Read Macro program
on a line by line basis.
Line
170
Opens the
COM1
port on the PC for serial communications
with the Micro488/EX.
Line
180
Sends the
ID
command to the Micro488/EX to reset it to
known power-on conditions. It utilizes the time delay
provided by line
190
; get the output file name.
Line
200 GOSUB
s to Line
580
to get the output file name and open
it.
Line
210
Provides a method to include a user comment in the file.
Line
230
Removes the power-on Xon character from the PC's serial
input.
Lines
240
-
370
Sets up the file header with comments. These comments
include the
HELLO
response, the
DAY
TIME
DATE
and the
user's comment line from Line
210
.
Lines
420
-
430
Sets the
ERROR
reporting feature of the Micro488/EX to
Komentarze do niniejszej Instrukcji