BASIC Programming Question?

8 posts / 0 new
Last post
Offline
Last seen: 11 years 3 months ago
Joined: Sep 6 2012 - 11:39
Posts: 6
BASIC Programming Question?

Hi, this program keeps giving me an error err Tab in line 40. Anyone know what to do to fix it?
Here is the script:

10 DIM A$(64)
20 A$="!@#$%^&*()+{}|:<>?/.,';][\=-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
30 GOSUB 1000
40 TAB 3:GOSUB 1000
50 TAB 5:GOSUB 1000
60 TAB 7:GOSUB 1000
70 TAB 10:GOSUB 1000
80 TAB 13:GOSUB 1000
90 TAB 15:GOSUB 1000
100 TAB 17:GOSUB 1000
110 TAB 20:GOSUB 1000
110 TAB 23:GOSUB 1000
120 TAB 25:GOSUB 1000
130 TAB 27:GOSUB 1000
140 TAB 30:GOSUB 1000
150 TAB 33:GOSUB 1000
160 TAB 35:GOSUB 1000
170 TAB 38:GOSUB 1000
180 PRINT:GOTO 30
1000 A=RND(64)+1:PRINT A$(A,A);:RETURN
1010 END

Craig MX's picture
Offline
Last seen: 1 month 1 week ago
Joined: Aug 12 2004 - 22:43
Posts: 45
Re: BASIC Programming Question?

Might be an inadvertent control character typed in line 40. Try re-entering the line?

Cheers,
Craig

Dog Cow's picture
Offline
Last seen: 5 years 6 months ago
Joined: Dec 11 2008 - 16:26
Posts: 554
Re: BASIC Programming Question?

I'm assuming that this is an Integer BASIC program. Otherwise, you're using RND on line 1000 incorrectly for an Applesoft program.

Is this the expected output?
[ 6 \ 2 4 * 8 ? \ 3 ( 8 , N /<br /> \ C 9 R 0 U X [ A I + V Q J $<br /> ; J @ : ) G / 1 / 2 [ 5 $ / [<br /> 8 ? + Z @ &lt; ^ Z % M [ 7 4 # =<br /> X 2 4 @ [ Q J * B 7 - R 8 ? ]<br /> , R 6 ] &gt; $ ' X - K @ + X \ F<br /> L ) D G / = W &gt; % L \ 1 . , P<br /> Z * 6 &lt; @ \ 1 ] 0 S 0 Y [ M 4<br /> ^ T F L ( 0 T I + Y : ] ] B A<br /> F O P Y : [ M 2 3 + T D H 1 ,<br /> N / 3 + W ] 9 Q H - R 5 ^ V Q<br /> J &amp; H 2 \ J ! ! ! @ ( A C 5 $<br /> , K % N . &gt; ! ! @ : ] ; C 7 -<br /> O R A I ] &gt; ! @ + T C A F K $<br /> ? ] / \ G &gt; @ \ - Q G , O M 2<br /> \ J $ ? ] ? ( 5 ! @ [ N ] 9 N<br /> . / 2 \ H 3 ( 5 @ ] ; D J &amp; I<br /> &lt; % N &gt; &amp; I ( 6 ) C B 8 , M -<br /> R A G , M 3 ) J &amp; H = V R 5 @<br /> ] ? [ R A J $ , K @ ( 6 ( 6 )<br /> H 1 ? ] . / - O L : ) I ) J !<br /> ^ X \ I &lt; ! $ ' U Z # 4 $ &gt; &amp;<br /> G . / - K # = T J $ ]<br /> *<br />

Offline
Last seen: 11 years 3 months ago
Joined: Sep 6 2012 - 11:39
Posts: 6
Re: BASIC Programming Question?

Yes that's the intended output, still can't get it to work tho :/. Gonna try reentering it tomorrow, my replica I's at school

Offline
Last seen: 3 weeks 3 days ago
Joined: Oct 9 2011 - 12:54
Posts: 1353
Re: BASIC Programming Question?

OK, I just tried it on my Mimeo, and it works fine.

Let me tell you why.... I also verified the following code changes fixes everything....

20 A$="!@#$%^&*()+:<>?/.,';][=-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1000 A=RND(60)+1:PRINT A$(A,A);:RETURN

Ok, I'm being lazy you can also change the DIM in line 10...
Anyway,...

On the Mimeo and a real Apple-1 the terminal section ignores your invalid characters that don't exit in the Apple-1's character set.

On the Replica-1, the terminal (emulated in a propeller chip) accepts them, basic just doesn't know what to do with them so it get's a little funky. I could research more, but no real need.

Anyway, that's the answer... Verified on both Apple-1 hardware(Mimeo) and Replica-1 hardware (Rev-3)

Sorry I didn't get to test this sooner for you. Was stuck on a problem with my Altair and a processor tech card taking down the whole bus. I wanted to get some progress on that before I moved on to looking at something else.

Cheers,
Corey

Offline
Last seen: 11 years 3 months ago
Joined: Sep 6 2012 - 11:39
Posts: 6
Re: BASIC Programming Question?

Thank you Corey! Works now Smile

Offline
Last seen: 11 years 3 months ago
Joined: Sep 6 2012 - 11:39
Posts: 6
Re: BASIC Programming Question?

Thank you Corey! Works now Smile

mmphosis's picture
Offline
Last seen: 4 days 20 hours ago
Joined: Aug 18 2005 - 16:26
Posts: 442
Re: BASIC Programming Question?

90 D = 5000: GOSUB 1010:L = 1
100 T$ = "Wake up, Neo"
110 S = 216: GOSUB 1000
120 T$ = "The Matrix has you"
130 S = 10: GOSUB 1000:L = 0
140 T$ = "Follow the white"
141 T$ = T$ + " rabbit."
150 S = 128: GOSUB 1000
160 T$ = "Knock, knock, Neo."
170 S = 255: GOSUB 1000
180 POKE - 16368,0
190 WAIT - 16384,128
200 TEXT : END
1000 FOR I = 1 TO D: NEXT
1005 D = D * 2 / 3
1010 HOME : POKE 1024,96
1020 SPEED= S: PRINT T$;
1025 IF L THEN PRINT "...";
1030 SPEED= 255: RETURN
1040 RETURN
http://www.youtube.com/watch?v=Smwrw4sNCxE

Log in or register to post comments