Commodore Computer Commodore 64 Uživatelský manuál Strana 26

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 65
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 25
70 GET# 5, A$
80 IF ST< > 0 THENPRINT ST: STOP
90 PRINT ASC(A$+CHR$.l0) );
100 GOTO 70
200 INPUT# 15, A$, B$, C$, 0$
210 IF VAL (A$) > 0 THEN PRINT A$,B$,C$;O$:STOP
220 RETURN
In CaseOf Null
Character Being
Read In
- Causes
Error With ASC
Function Otherwise!
Reading the Directory
The directory of the diskette may be read just like a sequential file. lust
use $ for the file name, and OPEN 5, 8, 5, "$". Now the GET# statement works
to examine the directory. The format here is identical to the format of a
program file: the file sizes are the line numbers, and names are stored as
characters within quote marks.
Here's a program that lets you read the directory of the diskette:
100PENl,8,2,"S
20 GET#I,A$,A$,A$,A$
30 T$(O) ="Del":T$(1) ="SEQ":T$(2) ="PRG":T$(3) ="USR":T$(4) ="REL"
401=17:GOSUBSOO ~~
50N$=B$ @) ~
601=2 ( ID
70 GOSUB500
801$=B$
901=2
( ( OPERATINGSYSTEM
100 GOSUB500
1100$=B$
120FORL=IT073( (GETRESTOFBLOCK
130GET#I,A$,A$,A$
140NEXT
150GET#I,A$,A$,A$,A$,A$
160PRINTCHR$(147)
"Diskname:"N$,"ID:"I$,"OS: "0$
161 PRINT"Length" ,"Type" ,"Name"
165 FORP=IT08
170 GET#l ,T$,A$,A$
175IFSTTHENCLOSEl:END
180IFT$=""THENT$=CHR$(128)
1901=15
( ~
200 GOSUB500 ~
210N$=B$ ~
220GET#1,A$,A$,A$,A$,A$,A$,A$,A$,A$,A$,U,H$
225 L=ASC(U+CHR$(0))+25 6*ASC(H$+CHR$(0):IFL=OTHEN250
230 PRINTL,T$(ASC(T$)-128),N$
250 IFP < 8THENGET#1 ,A$,A$
260NEXTP:GOTOI65
23
Zobrazit stránku 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 64 65

Komentáře k této Příručce

Žádné komentáře