Jump to content
Sign in to follow this  
majestyx

Reading text from a file in XB

Recommended Posts

Posted (edited)

Maybe I'm overthinking this, or maybe I'm just not getting how it works.

 

I am trying to read in text data from a file which contains quote (") and comma characters in it. This causes a couple of problems.

 

I'm using a slightly modified version of a program in the User Reference Guide, from page II-130:

 

10 OPEN #1:"DSK2.SHERLOCK",INPUT
20 IF EOF(1)THEN 60
30 INPUT #1:A$
40 PRINT A$
50 GOTO 20
60 CLOSE #1
70 END

 

(text in file, stored in DISPLAY format, with a line feed at the end of each record)

Upon reaching 221B Baker Street, Mrs.
Hudson admits you with a smile, although
obviously in the midst of a busy
cleaning session. "How nice to see you
again," says Holmes' landlady. "Mr.
Holmes and Doctor Watson are in their
rooms. You know the way."

 

(what displays on screen when the program runs)

Upon reaching 221B Baker Street
Hudson admits you with a smile
obviously in the midst of a busy
cleaning session. "How nice to see you

* INPUT ERROR IN 30

 

I understand why the text is getting cut off when a comma occurs (it's considered another piece of data in that record). Not sure what's happening with the " since it gets displayed, but doesn't continue with the remaining text. Interestingly, this issue with the quote character doesn't occur in TI BASIC, only XB.

 

Regardless of this, is there a way to read in text using XB or their variants in order to include characters such as commas and quotes? I'm simply trying to display the data in the file on the screen, but don't know how to do this or know if it's possible. Maybe I'm just going about it all wrong.

 

Any assistance would be greatly appreciated, thanks!

 

EDIT: NEVERMIND! Just discovered the LINPUT command in the XB manual which takes care of this.

Edited by majestyx
  • Like 3

Share this post


Link to post
Share on other sites

Yes, the Scott Adams Adventure module just isn't going to cut the amount of text that I want to include in the game and I just don't have the time to learn ZIL and try to create an Infocom-style adventure file to use with the TI's Z-machine. Plus, this is going to be a Choose-Your-Own-Adventure type of game which helps to eliminate a parser.

 

I'm trying to make a "template" program where minimal modification is needed to the core system while the majority of the work will be the story files. Not sure just how well I'm going to do with it, but it was something I always wanted to do when I was a teen back in the 80s. The 32-column limitation has always stopped me from trying to do so, but now that I see you've added much easier access to 40-column text mode, I'm taking a shot at it thanks to being at a stand-still with my Baseball sim until I can figure out a way to utilize SAMS usefully for it.

 

Thanks for continuing to add more easy to use features for assembly-averse programmers like me!

Share this post


Link to post
Share on other sites

I uses this XB program to convert DV 80 Text files to TI Writer DV 80 files:

100 OPEN #1:"DSK2.USER-DEMO",INPUT
110 OPEN #2:"DSK2.BATCH",OUTPUT
120 LINPUT #1:Z$
130 IF LEN(Z$)=80 THEN PRINT #2:Z$ :: GOTO 120
140 IF LEN(Z$)<80 THEN PRINT #2:Z$&CHR$(13)
150 Z$="" :: GOTO 120

It crashes and I type:

CALL CLSALL

to close all files in RXB.

 

You notice the lines in XB programs can be up to 5 lines in 32 columns that is 160 characters, just under the 163 characters in Merge format.

 

You could use this to better format as it puts an enter key after each line of text.

 

By the way the reason why your XB program crashes is the Quote Marks used.

Take a look at my RXB BATCH FILE to see how you get around Quote marks:

! COPY this file to a empty
! DISK 1, under name "BATCH"
! then type:
! CALL USER("DSK1.BATCH")

! Print out a copy to follow
! along with the program

! PRESS ANY KEY
CALL KEY("",5,K,S)

! As you can see RXB KEY 
! has been modified to 
! accept empty strings

! PRESS ANY KEY
CALL KEY("",5,K,S)
NEW
CALL QUITON

! To follow along with this  
! demo print it out first

! PRESS ANY KEY TO CONTINUE

! PRESS QUIT TO EXIT USER

CALL KEY("",5,K,S)
NEW
! RXB CALL KEY UPDATED

! Normal XB
CALL KEY(1,A,X)::CALL KEY(2,B,Y)

! RXB UPDATE
CALL KEY(1,A,X,2,B,Y)

! See no double Colon needed 
! or added to RXB version

! (HINT: press space bar)
CALL KEY(" ",5,K,S)
NEW
! RXB ADDS A STRING CHECK

! (HINT: press Y N y n)

CALL KEY("YyNn",5,K,S)

! (HINT: press a number)

CALL KEY("1234567890",5,K,S)

! (HINT: press ENTER)

CALL KEY(CHR$(13),5,K,S)

! (HINT: press a symbol)

V$="`[email protected]#$%^&*()-_=+[]\{}|"

CALL KEY(V$,5,K,S)

! Much less XB code in RXB 
! than in normal XB to do
! same thing

CALL KEY("",5,K,S)

NEW
! Normal XB CALL KEY routine

100 PRINT "CHOOSE A KEY: Yes, No, Maybe, END"
110 CALL KEY(3,K,S)
120 IF K=89 THEN PRINT "YES" :: GOTO 110
130 IF K=78 THEN PRINT "NO" :: GOTO 110
140 IF K=77 THEN PRINT "MAYBE" :: GOTO 110
150 IF K=69 THEN PRINT "END" :: END
160 GOTO 110

! HINT: (press any key)
CALL KEY("",5,K,S)
RUN
! RXB  CALL ONKEY routine

100 ! RXB CALL ONKEY
110 PRINT "CHOOSE A KEY: Yes, No, Maybe, END"
120 CALL ONKEY("YNME",3,K,S) GOTO 140,150,160,170
130 GOTO 120
140 PRINT "YES!" :: GOTO 120
150 PRINT "NO!" :: GOTO 120
160 PRINT "MAYBE!" :: GOTO 120
170 PRINT "END!"

! (HINT: press any key)
CALL KEY("",5,K,S)
RUN
NEW
! RXB CALL JOYST UPDATED

! NORMAL XB

CALL JOYST(1,A,B) :: CALL JOYST(2,C,D)

! RXB UPDATE

CALL JOYST(1,A,B,2,C,D)

CALL KEY("",5,K,S)
NEW
! RXB CALL JLOCATE
! (JOYST + LOCATE + FIRE KEY)
100 CALL CLEAR
110 CALL CHAR(143,"FFFFFFFFFFFFFFFF")
120 CALL SPRITE(#1,143,2,9,190)
130 CALL JOYLOCATE(1,X,Y,8,8,#1,R,C,K)GOTO 160
140 PRINT X;Y;K;R;C
150 GOTO 130
160 PRINT X;Y;K;R;C;"FIRE"
170 GOTO 130

SAVE "DSK1.JLOCATE"
CALL KEY("",5,K,S)
NEW
100 ! RUN FOR ONE HOUR AND    COMPARE PRINT X XB VS RXB
110 ! NORMAL XB DISTANCE
120 CALL CLEAR :: X=190
130 CALL SPRITE(#1,65,2,9,X,20,0,#2,66,2,9,X,30,0,#3,67,2,9,X,-20,0)
140 CALL DISTANCE(#1,#2,D)
150 CALL DISTANCE(#1,#3,E)
160 CALL DISTANCE(#2,#3,F)
170 X=X+1 :: PRINT D;E;F
180 GOTO 140! X IS COUNTER
190 !
200 ! RXB DISTANCE
210 CALL CLEAR :: X=190
220 CALL SPRITE(#1,65,2,9,X,20,0,#2,66,2,9,X,30,0,#3,67,2,9,X,-20,0)
230 CALL DISTANCE(#1,#2,D,#1,#3,E,#2,#3,F)
240 X=X+1 :: PRINT D;E;F
250 GOTO 230! X IS COUNTER

! RUN FOR 1 HOUR TEST OF
! NORMAL DISTANCE XB VS RXB

SAVE "DSK1.DISTANCE"
CALL KEY("",5,K,S)
NEW
! RXB CALL JMOTION
! (JOYST + MOTION + FIRE KEY)
100 CALL CLEAR
110 CALL CHAR(143,"FFFFFFFFFFFFFFFF")
120 CALL SPRITE(#1,143,2,9,190,20,0)
130 CALL JOYMOTION(1,X,Y,#1,9,9,K)GOTO 160
140 PRINT X;Y,K
150 GOTO 130
160 PRINT X;Y,K;"FIRE"
170 GOTO 130

SAVE "DSK1.JMOTION"
CALL KEY("",5,K,S)
NEW
! RXB CALL COLOR UPDATED

! NORMAL XB

FOR L=0 TO 14 :: CALL COLOR(L,2,11) :: NEXT L

! RXB COLOR UPDATE

CALL COLOR(ALL,2,11)

CALL KEY("",5,K,S)
NEW

! RXB CALL GCHAR UPDATED

! NORMAL XB

CALL GCHAR(22,3,A) :: CALL GCHAR(22,4,B) :: CALL GCHAR(22,5,C)

! RXB GCHAR UPDATE

CALL GCHAR(22,3,A,22,4,B,22,5,C)

! As you can see saves bytes
! and much faster

CALL KEY("",5,K,S)

! RXB has HGET like 
! GCHAR but like 
! multiple ones in a row

CALL HGET(23,1,14,X$)
CALL VGET(21,3,4,Y$)

CALL KEY("",5,K,S)

PRINT X$:Y$

! HGET & VGET are way
! better then GCHAR
! to use

CALL KEY("",5,K,S)
NEW
! RXB CALL HCHAR UPDATED    
! ALSO VCHAR UPDATED

! NORMAL XB

CALL HCHAR(9,25,33,5) :: CALL HCHAR(10,25,33,6) :: CALL HCHAR(11,25,33,7)

! RXB UPDATE

CALL HCHAR(9,25,33,5,10,25,33,6,11,25,33,7)

! NOTICE RXB verion must    
! have number of characters
! to repeat or errors out

CALL KEY("",5,K,S)
NEW
! RXB has HPUT like 
! HCHAR & VCHAR but like 
! multiple ones in a row

CALL HPUT(4,9,"THIS IS HPUT TEST")
CALL VPUT(4,9,"THIS IS VPUT TEST")

! Better then DISPLAY AT
! as uses entire screen and
! does vertical + horizontal

CALL KEY("",5,K,S)

NEW
! RXB CALL VERSION UPDATED

CALL VERSION(A) :: PRINT A

CALL KEY("",5,K,S)
NEW

! NEW RXB SOUND SUBROUTINES

CALL BEEP

! NEW RXB SUBROUTINE

CALL HONK

CALL KEY("",5,K,S)
NEW
! Now this is a RXB line?

1PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PR
INT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT
::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::P
RINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRIN
T::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::
PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT::PRI
NT::PRINT::PRINT::PRINT::PRINT::PRINT::PRINT

! RXB Editor can accept 160 tokens per line

CALL KEY("",5,K,S)
SAVE "DSK1.LONGLINE"
LIST

! Non-tokenized line above

CALL KEY("",5,K,S)
NEW
! Create a XB program

NUM 1,2
REM Test
PRINT "THIS IS A TEST PROGRAM"
CALL BEEP
END

! SAVE THE PROGRAM

SAVE "DSK1.TEST"

CALL KEY("",5,K,S)
NEW
! HOW TO EDIT IN USER

OLD "DSK1.TEST"

RES 10,10
NUM 9,10
! REMARK HERE
! SHOW IT
! LET THEM KNOW IT
! DONE

RES 100,5

CALL KEY("",5,K,S)
LIST

SAVE "DSK1.TEST2"

CALL KEY("",5,K,S)
NEW
! RUN PROGRAMS BUT GO BACK   TO USER

CALL KEY("",5,K,S)
RUN "DSK1.TEST"
RUN "DSK1.TEST2"

CALL KEY("",5,K,S)

! MERGE PROGRAMS AND RUN

SAVE "DSK1.TESTM",MERGE

OLD "DSK1.TEST"
LIST
MERGE "DSK1.TESTM"
LIST
SAVE "DSK1.TEST4"

CALL KEY("",5,K,S)
NEW
! RXB INPROVED SIZE

SIZE
! NOW YOU SEE FREE SPACE
! AND THE FIRST FREE ADDRESS
! LOCATION

CALL KEY("",5,K,S)
CALL INIT

SIZE
! SEE THE CHANGE IN LOWER 8K?

CALL KEY("",5,K,S)
CALL CLEAR
! New RXB VDPSTACK MANAGER

CALL VDPSTACK(2392)
SIZE
! >0958 STACK
!NORMAL VDP STACK LOCATION

CALL KEY("",5,K,S)
CALL CLEAR
CALL VDPSTACK(4096)
! >1000 VDP STACK LOCATION
SIZE
! PRESS ANY KEY
CALL KEY("",5,K,S)
CALL CLEAR
CALL VDPSTACK(6176)
! >1820 VDP STACK LOCATION
SIZE
CALL KEY("",5,K,S)
CALL CLEAR
CALL VDPSTACK(2392)
! >0958 STACK
!NORMAL STACK LOCATION
CALL KEY("",5,K,S)
NEW
! New RXB RAM MANAGER
! CALL PRAM(ADDRESS)
! Normal XB RAM >A040
! 24K RAM minus 64 bytes
SIZE
CALL KEY("",5,K,S)
NEW
CALL PRAM(-24576)
! >A000 - 24K RAM"
SIZE
CALL KEY("",5,K,S)
NEW
CALL PRAM(-20480)
! >B000 - 20K RAM
SIZE
CALL KEY("",5,K,S)
NEW
CALL PRAM(-16384)
! >C000 - 16K RAM
SIZE
CALL KEY("",5,K,S)
NEW
CALL PRAM(-12288) 
! >D000 - 12K RAM
SIZE
CALL KEY("",5,K,S)
NEW
CALL PRAM(-8192)
! >E000 - 8K RAM
SIZE
CALL KEY("",5,K,S)
NEW
CALL PRAM(-322)
! >FFBE - 298 BYTES RAM
SIZE
CALL KEY("",5,K,S)
NEW
! RESET RAM TO NORMAL XB RAM
CALL PRAM(-24512)
NEW
SIZE
CALL KEY("",5,K,S)
NEW
! TRACE FROM USER

OLD "DSK1.TEST"

TRACE

RUN

UNTRACE

CALL KEY("",5,K,S)
NEW
! USER IGNORES ERRORS

NUM
! ERRORS IN USER
GOTO 1000

RUN

! SAME AS BREAK OR FCTN4    (By the way FCTN4 does not  work in USER)

CALL KEY("",5,K,S)
NEW
100 ! RXB NEW IN PROGRAM
110 CALL NEW

CALL KEY("",5,K,S)
SAVE "DSK1.NEW"
RUN
100 ! NORMAL XB CLOSE
110 OPEN #1:"DSK1.FILE1"
120 OPEN #2:"DSK1.FILE2"
130 CLOSE #1
140 CLOSE #2

200 ! RXB CLOSE ALL
210 OPEN #1:"DSK1.FILE1"
220 OPEN #2:"DSK1.FILE2"
230 CALL CLSALL

SAVE "DSK1.CLSALL"
CALL KEY("",5,K,S)
RUN
CALL KEY("",5,K,S)
NEW
100 ! NORMAL XB CHARSET
110 FOR L=0 TO 255
120 PRINT CHR$(L);" ";
130 NEXT L
140 FOR L=30 TO 159
150 CALL CHAR(L,"4567")
160 NEXT L
170 FOR D=1 TO 300::NEXT D
180 CALL CHARSET
190 FOR D=1 TO 300::NEXT D

200 ! RXB CHARSETALL
210 FOR L=30 TO 159
220 CALL CHAR(L,"4567")
230 NEXT L
240 FOR D=1 TO 300::NEXT D
250 CALL CHARSETALL
260 PRINT "CHARSET RESETS 32 TO 95": : :
270 PRINT "CHARSETALL RESETS 30 TO 159": :
280 PRINT "PRESS ANY KEY"
290 CALL KEY("",5,K,S)

SAVE "DSK1.CHARSETALL"
RUN
NEW
! RXB Binary SAVE routine
! replaced old BSAVE with
! PSAVE 

CALL KEY("",5,K,S)
NEW
100 CALL CLEAR
110 CALL MAGNIFY(2)
120 CALL SCREEN(15)
130 CALL COLOR(1,1,15)
140 FOR S=2 TO 8
150 CALL COLOR(S,2,15)
160 NEXT S
170 CALL SPRITE(#1,87,13,84,26)
180 CALL SPRITE(#2,73,13,58,58)
190 CALL SPRITE(#3,78,13,32,90)
200 CALL SPRITE(#4,68,13,58,122)
210 CALL SPRITE(#5,89,13,32,154)
220 CALL SPRITE(#6,88,13,58,186)
230 CALL SPRITE(#7,66,13,84,218)
240 CALL SPRITE(#8,51,12,128,90)
250 CALL SPRITE(#9,46,12,128,122)
260 CALL SPRITE(#10,48,12,128,154)
270 CALL SPRITE(#11,42,5,1,1,0,127)
280 CALL SPRITE(#12,42,5,1,243,127,0)
290 CALL SPRITE(#13,42,5,176,243,0,-127)
300 CALL SPRITE(#14,42,5,176,1,-127,0)
310 CALL SPRITE(#15,42,16,1,128,0,111)
320 CALL SPRITE(#16,42,16,96,243,111,0)
330 CALL SPRITE(#17,42,16,176,128,0,-111)
340 CALL SPRITE(#18,42,16,96,1,-111,0)
350 CALL SPRITE(#19,42,7,1,1,0,99)
360 CALL SPRITE(#20,42,7,1,243,99,0)
370 CALL SPRITE(#21,42,7,176,243,0,-99)
380 CALL SPRITE(#22,42,7,176,1,-99,0)
390 FOR R=3 TO 21
400 CALL HPUT(R,3,RPT$("a",28))
410 NEXT R
420 CALL CHAR(97,"00FF00FF00FF00FF")
430 ! THIS IS HOW THE TITLE SCREEN WAS CREATED AND WAS  SAVED
440 CALL HCHAR(3,3,96,28)
450 CALL VCHAR(3,3,96,20)
460 CALL HCHAR(22,3,96,28)
470 CALL VCHAR(3,30,96,20)
480 CALL HPUT(15,5,"RICHARD LYNN GILBERTSON")
490 CALL HPUT(20,9,"<<<PUSH A KEY>>>")
500 ! LOOP HERE FOR MOVEMENT
510 CALL CHAR(96,"FF818181818181FF")
520 IF RND>.5 THEN CALL COLOR(9,RND*15+1,15)
530 CALL CHAR(96,"00E7E7E7E7E7E700")
540 CALL KEY(0,K,S):: IF S=0 THEN 510
550 ! GET SPRITE MOTION IN N
560 CALL PEEK(-31878,N)
570 ! MOVE VDP TO LOW 8K RAM
580 CALL MOVES("VR",2079,0,8192)
590 ! SAVE RAM TO DISK
600 CALL PSAVE("DSK1.SCREEN")

! SET UP SCREEN AND PSAVE IT

SAVE "DSK1.PSAVESCRN"
CALL KEY("",5,K,S)
RUN

100 ! RELOAD SAVED MEMORY
110 CALL PLOAD("DSK1.SCREEN")
120 ! RESET MAGNIFICATION
130 CALL MAGNIFY(2) :: CALL SCREEN(15)
140 ! MOVE FROM RAM TO VDP
150 CALL MOVES("RV",2079,8192,0)
160 ! RESET SPRITE MOTION
170 CALL LOAD(-31878,22)
180 ! LOOP HERE FOR MOVEMENT.
190 CALL CHAR(96,"FF818181818181FF")
200 IF RND>.5 THEN CALL COLOR(9,RND*15+1,15)
210 CALL CHAR(96,"00E7E7E7E7E7E700")
220 CALL KEY(0,K,S):: IF S=0 THEN 190

SAVE "DSK1.PLOADSCRN"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE             RXB SUBPROGRAM FINDER
100 CALL CLEAR :: ADDRESS=-24538
110 RESTORE :: FOR I=1 TO 2 :: READ X$,Y$,Z$ :: PRINT X$;TAB(11);Y$;TAB(22);Z$
::NEXT I
120 CALL PEEKG(ADDRESS,B1,B2):: CALL HEX(B1,B1$,B2,B2$)::
ADDRESS$=SEG$(B1$,3,2)&SEG$(B2$,3,2)
130 CALL PEEKG(ADDRESS+2,LENGTH)
140 CALL MOVES("G$",LENGTH,ADDRESS+3,N$)
150 CALL PEEKG(ADDRESS+3+LENGTH,S1,S2):: CALL HEX(S1,S1$,S2,S2$)::
S$=SEG$(S1$,3,2)&SEG$(S2$,3,2)
160 CALL HEX(ADDRESS,A$):: PRINT A$;"-";ADDRESS$;" ";TAB(11);N$;" ";TAB(22);S$
:: PRINT
170 DATA HEADER,SUBPROGRAM,START,*******,**********,*******
180 CALL HEX(ADDRESS$,ADDRESS):: IF ADDRESS THEN 120

SAVE "DSK1.SUBPGMFNDR"
CALL KEY("",5,K,S)
RUN
CALL KEY("",5,K,S)
NEW
10 ! RXB EXAMPLE       CALL MOVES(type$,bytes,from,to)
20  PRINT "Disk controller EPROM chip"
100 CALL CHAR(31,"F0F0F0F0F0F0F0F0")
110 CALL IO(3,8,2176,255) ! TURN ON EPROM
120 FOR A=16384 TO 24576 STEP 224
130 CALL MOVES("R$",224,A,T$)
140 CALL HEX(A,H$)
150 PRINT " ADDRESSS=";A;"HEX=";H$: :T$: :
160 FOR L=1 TO 400 :: NEXT L
170 NEXT A
180 CALL CHAR(31,"00")
190 CALL IO(3,8,2176,0) ! TURN OFF EPROM

SAVE "DSK1.MOVESDSR"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL POKER(register,value)
100 CALL CLEAR :: FOR I=0 TO 764 STEP 8 :: CALL POKEV(I,161,162,163,164,165,166
,167,168):: NEXT I
110 CALL CLEAR :: FOR I=0 TO 758 STEP 16 :: CALL POKEV(I,161,162,163,164,165,
166,167,168,169,170,172,173,174,175,176) :: NEXT I
120 CALL CLEAR :: FOR I=126 TO 223 :: CALL POKEV(I,I+1,I+2,I+3,I+4,I+5,I+6,I+7)
:: NEXT I
130 PRINT : :"SCREEN COLOR CHANGES" :: FOR T=1 TO 5 :: FOR I=0 TO 15 :: CALL
 POKER(7,1):: NEXT I:: NEXT T:: CALL SCREEN(8)
140 A$=
"[email protected]#$%^&*()+1234567890=-:><,.;/~_?'|{}\`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefg
hijklmnopqrstuvwxyz" :: FOR I=1 TO 5 :: PRINT A$ :: NEXT I
150 PRINT : :"CHARACTER COLOR CHANGES" :: FOR I=30 TO 70 :: FOR T=2063 TO 2076
:: CALL POKEV(T,I):: NEXT T :: NEXT I :: CALL CHARSET :: PRINT
160 PRINT "PRESS A KEY FOR TEXT MODE": : :: CALL BEEP
170 CALL KEY("",5,K,S):: CALL POKER(7,244):: CALL POKER(1,240)
180 PRINT "       PRESS A KEY FOR MULTI COLOR MODE": : :: CALL BEEP
190 CALL KEY("",5,K,S):: CALL POKER(1,232):: GOSUB 230 :: CALL POKER(1,224)
200 PRINT "PRESS A KEY FOR BIT MAP MODE": : :: CALL BEEP
210 CALL KEY("",5,K,S):: CALL POKER(0,2):: CALL POKER(1,224)
220 GOSUB 230 :: CALL POKER(0,0):: END
230 FOR I=1 TO 800 :: NEXT I :: RETURN

SAVE "DSK1.POKER"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL MOTION(STOP,GO)
100 CALL CLEAR :: CALL CHAR(128,RPT$("F",16)):: CALL MAGNIFY(2)
110 A$="OUT" :: GOSUB 120 :: A$="" :: GOSUB 120 :: CALL QUITON :: END
120 CALL HPUT(1,3,"MOTION WITH"&A$&" RXB"):: IF A$="" THEN CALL MOTION(STOP)
130 FOR A=1 TO 11 :: CALL SPRITE(#A,128,2,A*16-7,1,0,30):: NEXT A ::
IF A$="" THEN CALL MOTION(GO)
140 CALL HPUT(24,4,"PRESS ANY KEY TO CONTINUE."):: CALL KEY("",5,K,S)::
CALL DELSPRITE(ALL):: CALL CLEAR :: RETURN

SAVE "DSK1.MOTIONGO"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL MOTION(GO,STOP)
100 A(0)=-1 :: A(1)=1 :: CALL MOTION(GO)
110 CALL CLEAR :: CALL MAGNIFY(2):: CALL SCREEN(15)
120 FOR S=1 TO 28
130 CALL SPRITE(#S,64+S,2,20+S,50+S,INT(A(RND*1))*INT(RND*127),
INT(A(RND*1))*INT(RND*127))
140 NEXT S
150 N=N+1 :: ON INT(RND*3)+1 GOSUB 160,170,180 :: IF N>50 THEN END ELSE 150
160 CALL MOTION(GO):: RETURN
170 CALL MOTION(STOP):: RETURN
180 FOR DELAY=0 TO 200 :: NEXT DELAY :: RETURN

SAVE "DSK1.MOTIONSTOP"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL CHAR(ALL,string)
20 FOR L=0 TO 256 :: PRINT CHR$(L);:: NEXT L
30 S$="0123456789ABCDEF"
40 CALL CHAR(ALL,SEG$(S$,INT(RND*15)+1,INT(RND*15)+1))
50 Z=Z+1 :: IF Z=50 THEN END ELSE 40

SAVE "DSK1.MOTIONSTOP"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL COLOR(ALL,fore,back)
20 FOR L=0 TO 256 :: PRINT CHR$(L);:: NEXT L
30 CALL COLOR(ALL,RND*15+1,RND*15+1)
40 Z=Z+1 :: IF Z=50 THEN END ELSE 30

SAVE "DSK1.COLORALL"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL MOTION(ALL,x,y)
100 A(0)=-127 :: A(1)=127 :: CALL MOTION(GO)
110 CALL CLEAR :: CALL MAGNIFY(2):: CALL SCREEN(15)
120 FOR S=1 TO 28
130 CALL SPRITE(#S,64+S,2,20+S,50+S,A(RND)*RND,A(RND)*RND)
140 NEXT S
150 CALL MOTION(ALL,A(RND)*RND,A(RND)*RND)
160 C=C+1 :: IF C<70 THEN 150

SAVE "DSK1.MOTIONALL"
CALL KEY("",5,K,S)
RUN
NEW
! RXB EXAMPLE               CALL HEX(number,string)
10 ! Decimal & Hexidecimal
11 FOR D=-32000 TO 30000 STEP 1000
12 CALL HEX(D,H$)
13 PRINT "DEC=";D,"HEX=";H$
100 ! Hexidecimal to Decimal
120 CALL HEX(H$,D)
130 PRINT "HEX=";H$,"DEC=";D
140 NEXT D

SAVE "DSK1.HEX~DEC"
CALL KEY("",5,K,S)
RUN
CALL KEY("",5,K,S)
NEW
100 ! NUMBERS VS STRINGS
110 DATA 200,124,97,249,140,77,81,173,254,78,93,12,38,65,55,6,0
120 READ N :: B$="BYTES"
130 CALL HEX(N,N$)
140 S$=S$&SEG$(N$,2,2)
150 IF N<>0 THEN 120
160 PRINT "DATA: ";8*16,B$
170 PRINT "STRING:";LEN(S$)+1,B$
180 PRINT "SAVED: ";(8*16)-(LEN(S$)+1),B$
190 ! 8 BYTES PER DATA       WHILE STRING IS 2 BYTES

SAVE "DSK1.HEXSTRING"
CALL KEY("",5,K,S)
RUN
CALL KEY"",5,K,S)
NEW
10 ! RXB EXAMPLE            CALL COLOR(D,#value,#value)CALL CHAR(D,char,char)
100 A(0)=-1 :: A(1)=1 :: CALL MOTION(GO)
110 CALL CLEAR :: CALL MAGNIFY(2):: CALL SCREEN(15)
120 FOR S=1 TO 28
130 CALL SPRITE(#S,64+S,INT(RND*16)+1,20+S,50+S,
INT(A(RND*1))*INT(RND*20),INT(A(RND*1))*INT(RND*20))
140 NEXT S
150 CALL COLOR(D,#INT(RND*28)+1,#INT(RND*28)+1)
160 CALL CHAR(D,INT(RND*28)+64,INT(RND*28)+64)
170 Z=Z+1 :: IF Z=50 THEN END ELSE 150

SAVE "DSK1.DUP"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL CHAR(S,char,char)
CALL CHAR(S,value#,value#)
100 A(0)=-1 :: A(1)=1 :: CALL MOTION(GO)
110 CALL CLEAR :: CALL MAGNIFY(2):: CALL SCREEN(15)
120 FOR S=1 TO 28
130 CALL SPRITE(#S,64+S,INT(RND*16)+1,20+S,50+S,
INT(A(RND*1))*INT(RND*20),INT(A(RND*1))*INT(RND*20))
140 NEXT S
150 CALL COLOR(S,#INT(RND*28)+1,#INT(RND*28)+1):: CALL
 CHAR(S,INT(RND*28)+64,INT(RND*28)+64)
160 Z=Z+1 :: IF Z=50 THEN END ELSE 150

SAVE "DSK1.SWAP"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL INVERSE(ALL)
100 CALL INVERSE(ALL)
110 A=A+1 :: IF A<8 THEN 100

SAVE "DSK1.INVERSEALL"
CALL KEY("",5,K,S) 
RUN
NEW
10 ! RXB EXAMPLE
100 ! This program gives the illusion of sprites that    bank 90% at a time
110 CALL MAGNIFY(2):: CALL CLEAR :: CALL SCREEN(15) :: CALL MOTION(GO)
120 CALL SPRITE(#1,65,2,100,10,0,35,#2,66,16,10,140,25,0)
130 CALL COINC(ALL,V)
140 IF V THEN CALL CHAR(S,65,66):: CALL RMOTION(#1):: CALL COLOR(S,#1,#2)::
GOSUB 160 ELSE 130
150 GOTO 130
160 FOR L=1 TO 600 :: NEXT L
170 A=A+1 :: IF A<5 THEN RETURN

SAVE "DSK1.SPRITESWAP"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL GMOTION(#sprite,x,y)
100 A(0)=-1 :: A(1)=1 :: CALL CLEAR :: CALL MAGNIFY(2):: CALL SCREEN(15)
110 FOR S=1 TO 28
120 CALL SPRITE(#S,64+S,INT(RND*16)+1,20+S,50+S,
INT(A(RND*1))*INT(RND*127),INT(A(RND*1))*INT(RND*127))
130 NEXT S
140 S=INT(RND*28)+1 :: CALL GMOTION(#S,X,Y):: CALL HPUT(24,3,
"CALL GMOTION(#"&STR$(S)&","&STR$(X)&","&STR$(Y)&")      ") ::
FOR L=1 TO 1000 :: NEXT L
150 CALL MOTION(#S,Y,X):: Z=Z+1 :: IF Z<8 THEN 140

SAVE "DSK2.GMOTION"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL GMOTION/MOTION
100 A(0)=-1 :: A(1)=1 :: CALL CLEAR :: CALL MAGNIFY(2):: CALL SCREEN(15)
110 FOR S=1 TO 28
120 CALL SPRITE(#S,64+S,INT(RND*16)+1,20+S,50+S,
INT(A(RND*1))*INT(RND*32),INT(A(RND*1))*INT(RND*32))
130 NEXT S
140 S=INT(RND*28)+1 :: CALL GMOTION(#S,X,Y):: CALL MOTION(#S,Y,X)
150 Z=Z+1 :: IF Z<300 THEN 140

SAVE "DSK1.G~MOTION"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL RMOTION(#sprite)       CALL RMOTION(ALL)
100 A(0)=-1 :: A(1)=1 :: CALL CLEAR :: CALL MAGNIFY(2):: CALL SCREEN(15)
110 FOR S=1 TO 28
120 CALL SPRITE(#S,64+S,INT(RND*16)+1,20+S,50+S,
INT(A(RND*1))*INT(RND*32),INT(A(RND*1))*INT(RND*32))
130 NEXT S
140 IF RND>.2 THEN CALL RMOTION(#INT(RND*28)+1)ELSE CALL RMOTION(ALL)
150 Z=Z+1 :: IF Z<200 THEN 140

SAVE "DSK1.MOTION"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE            CALL MOVES grom to screen
20 FOR GA=0 TO 32767 STEP 768 :: CALL MOVES("GV",768,GA,0):: NEXT GA
30 ! RXB EXAMPLE            CALL MOVES (RIPPLE EXAMPLE)
40 CALL HCHAR(1,1,32)
50 CALL MOVES("VV",767,0,1)
60 ! RXB EXAMPLE            CALL MOVES (SCAN VDP)
70 FOR V=0 TO 16384 STEP 28 :: CALL MOVES("VV",28,V,386):: NEXT V

SAVE "DSK1.MOVES"
CALL KEY("",5,K,S)
RUN
NEW
10 ! RXB EXAMPLE CALL BIAS
100 CALL MOVES("V$",255,511,X$)
110 CALL BIAS(0,X$)
120 PRINT X$

SAVE "DSK1.BIAS"
RUN
CALL KEY("",5,K,S)
NEW
10 ! RXB EXAMPLE CALL IO      (SOUND LIST)
100 A=8191
110 DATA 5,159,191,223,255,227,1
120 DATA 9,142,1,164,2,197,1,144,182,211,6
130 DATA 3,145,183,212,5
140 DATA 3,146,184,213,4
150 DATA 5,167,4,147,176,214,5
160 DATA 3,148,177,215,6
170 DATA 3,149,178,216,7
180 DATA 5,202,2,150,179,208,6
190 DATA 3,151,180,209,5
200 DATA 3,152,181,210,4
210 DATA 5,133,3,144,182,211,5
220 DATA 3,145,183,212,6
230 DATA 3,146,184,213,7
240 DATA 5,164,2,147,176,214,6
250 DATA 3,148,177,215,5
260 DATA 3,149,178,216,4
270 DATA 5,197,1,150,179,208,5
280 DATA 3,151,180,209,6
290 DATA 3,152,181,210,7
300 DATA 3,159,191,223,0
310 A=A+1 :: READ B :: CALL POKEV(A,B)
320 IF B=0 THEN 330 ELSE 310
330 CALL IO(1,8192)

SAVE "DSK1.IO~CHIMES"
RUN
CALL KEY("",5,K,S)
NEW
100 CALL CLEAR! CRASH
110 DATA 2,228,242,5
120 DATA 2,228,240,18
130 DATA 2,228,241,16
140 DATA 2,228,242,14
150 DATA 2,228,243,12
160 DATA 2,228,244,10
170 DATA 2,229,245,9
180 DATA 2,229,246,8
190 DATA 2,229,247,7
200 DATA 2,229,248,6
210 DATA 2,229,249,5
220 DATA 2,230,250,4
230 DATA 2,230,251,3
240 DATA 2,230,252,2
250 DATA 2,230,253,1
260 DATA 2,230,254,1
270 DATA 1,255,0,0
280 FOR AD=4096 TO 4160 STEP 4
290 READ V1,V2,V3,V4
300 CALL POKEV(AD,V1,V2,V3,V4)
310 NEXT AD
320 CALL IO(1,4096)
330 PRINT "CRASH": :"TYPE:":"CALL IO(1,4096)"

SAVE "DSK1.IO~CRASH"
RUN
CALL KEY("",5,K,S)
NEW
100 ! CATALOG ALL DISKS
110 N=49
120 ON ERROR 150
130 N=N+1
140 CALL CAT(N)
150 PRINT D$
160 IF N<128 THEN 120 ELSE END

SAVE "DSK1.CATALL"
RUN
CALL KEY("",5,K,S)
NEW
100 ! RUN FOR 1 HOUR AND     AND PRINT X FOR XB VS RXB
110 ! NORMAL XB COINC
120 CALL CLEAR :: X=190
130 CALL SPRITE(#1,65,2,9,X,20,0,#2,66,2,9,X,30,0,#3,67,2,9,X,-20,0)
140 CALL COINC(ALL,A)
150 CALL COINC(#1,#2,12,B)
160 CALL COINC(#1,#3,12,C)
170 CALL COINC(#2,#3,12,D)
180 X=X+1 :: PRINT A;B;C;D
190 GOTO 140
200 !
210 ! RXB COINC
220 CALL CLEAR :: X=190
230 CALL SPRITE(#1,65,2,9,X,20,0,#2,66,2,9,X,30,0,#3,67,2,9,X,-20,0)
240 CALL COINC(ALL,A,#1,#2,12,B,#1,#3,12,C,#2,#3,12,D)
250 X=X+1 :: PRINT A;B;C;D
260 GOTO 240

! 1 HOUR TEST XB VS RXB
SAVE "DSK1.CONICTEST"
NEW
! CREATE USER FILE FROM USER FILE
OPEN #1:"DSK1.TEST-USER",OUTPUT
PRINT #1:"1 CALL CLEAR ! TEST OF USER"&CHR$(13)
PRINT #1:"2 A$="&""""&" RXB USER "&""""&CHR$(13)
PRINT #1:"3 B$="&""""&"   DEMO   "&""""&CHR$(13)
PRINT #1:"4 C$="&""""&" FINISHED "&""""&CHR$(13)
PRINT #1:"5 CALL HPUT(12,11,A$,14,11,B$,16,11,C$)"&CHR$(13)
PRINT #1:"SAVE DSK1.END-DEMO"&CHR$(13)
PRINT #1:"RUN"&CHR$(13)
CLOSE #1

CALL KEY("",5,K,S)

CALL CAT("DSK1.")

CALL KEY("",5,K,S)

! USER CAN CALL USER FILES
! IF IT IS THE LAST COMMAND

FOR L=0 TO 3000 :: NEXT L

CALL USER("DSK1.TEST-USER")

As you can see Quote marks are a problem when using strings.

Also use LINPUT not INPUT as one can handle QUOTE MARKS and the other does not.

Using Quote Marks with INPUT is complicated and messy, so instead use LINPUT

 

Rich

  • Thanks 1

Share this post


Link to post
Share on other sites

Fileread was one of my old XB standbys. Here's the program in V9T9 format. Remove the ".txt" extension after downloading. Also tried the same file as a drag&drop attachment without the extension. One of these should work.

-Ed

FILEREAD.txt FILEREAD

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...