arrays - Correct usage of subroutine in commodore basic 4.0? -
i have subroutine fills array "."s
in main program trying call subroutine , print array; however, doesn't seem working. think incorrectly calling subroutine?
this code:
subroutine:
1070 dim a$(x,x) 1080 aa = 0 x 1090 bb = 0 x 2000 a$(x,x)="." 2010 next 2020 next
main code:
10 input "please enter number"; x 20 gosub 1070 30 = 1 x 40 j = 1 x 50 print a$(i,j); 60 next 70 print 80 next
nothing happens when run; when run in 1 program (not calling gosub) works?
any help?
in line #2000, believe want a$(aa,bb)="."
, otherwise you're hammering same location initialization.
also, , more important question, every gosub
needs return
main line of execution. in case, that's line 2030.
Comments
Post a Comment