BASIC Programming Question?

7 replies [Last post]
Offline
Joined: Sep 6 2012
Posts: 6

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Craig MX's picture
Offline
Joined: Aug 13 2004
Posts: 44
Re: BASIC Programming Question?

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

Cheers,
Craig

__________________

My Apple II Collection

Dog Cow's picture
Offline
Joined: Dec 11 2008
Posts: 464
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  @  < ^ Z     % M [  7  4 #  =<br />
X 2 4 @  [  Q J *     B 7 -  R  8 ?  ]<br />
, R 6 ]  >  $ ' X     - K @  +  X \  F<br />
L ) D G  /  = W >     % L \  1  . ,  P<br />
Z * 6 <  @  \ 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 & H 2  \  J ! !     ! @ (  A  C 5  $<br />
, K % N  .  > ! !     @ : ]  ;  C 7  -<br />
O R A I  ]  > ! @     + T C  A  F K  $<br />
? ] / \  G  > @ \     - Q G  ,  O M  2<br />
\ J $ ?  ]  ? ( 5     ! @ [  N  ] 9  N<br />
. / 2 \  H  3 ( 5     @ ] ;  D  J &  I<br />
< % N >  &  I ( 6     ) C B  8  , M  -<br />
R A G ,  M  3 ) J     & H =  V  R 5  @<br />
] ? [ R  A  J $ ,     K @ (  6  ( 6  )<br />
H 1 ? ]  .  / - O     L : )  I  ) J  !<br />
^ X \ I  <  ! $ '     U Z #  4  $ >  &<br />
G . / -  K  # = T     J $ ]<br />
*<br />

__________________

Email me: dog_cow@m acgui.com
Mac GUI Vault: http://macgui.com/vault/
Apple II Book: http://macgui.com/newa2guide/
Inside Allerton Park book

Offline
Joined: Sep 6 2012
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
Joined: Oct 9 2011
Posts: 1057
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
Joined: Sep 6 2012
Posts: 6
Re: BASIC Programming Question?

Thank you Corey! Works now Smile

Offline
Joined: Sep 6 2012
Posts: 6
Re: BASIC Programming Question?

Thank you Corey! Works now Smile

mmphosis's picture
Offline
Joined: Aug 18 2005
Posts: 316
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