|
Post by devilyn on Jul 30, 2007 2:23:15 GMT -5
Hi, Can anyone make sence of this line of code and help fix it?
3340 FORT=0TO2:POKE763+T,ASC(MID$(M$,T+1,1)):NEXT:IFH>12 THEN A$="P":H=H-12:GOTO 3340
WHEN RUN I GET ERROR:
?ILLEGAL QUANTITY ERROR IN 3340
|
|
|
Post by Robin Harbron on Jul 30, 2007 14:22:18 GMT -5
3340 FORT=0TO2:POKE763+T,ASC(MID$(M$,T+1,1)):NEXT:IFH>12THEN A$="P":H=H-12:GOTO 3340 First thing is to double check that when you LIST 3340 you get exactly this line back. It's longer than 80 characters (the maximum number of characters that can be entered as a single line of BASIC code on the 64) so you'll have to "crunch" it a bit, such as do a P(shift)O for POKE, and get rid of the space after the GOTO. If that's fine, the problem seems to be that M$ doesn't have any value. It needs to be at least 3 characters long, so a line like this should fix it: 3335 M$="123" If this is actually a single line of a longer program, check to see what M$ is defined as.
|
|
|
Post by iamdenteddisk on May 7, 2008 16:23:01 GMT -5
"3340 FORT=0TO2:POKE763+T,ASC(MID$(M$,T+1,1)):NEXT:IFH>12 THEN A$="P":H=H-12:GOTO 3340 WHEN RUN I GET ERROR:"
3340 FOR T=0 to 2 POKE763+T,ASC(MID$(M$,T+1,1)) NEXT IF H > 12 THEN A$="P" H=H-12 GOTO 3340
'I see an optomized codeline in basic "compounding many lines into one line to compact code space" I would list the prog see if there are any free line numbers in there from 3340-upto the next existing line number and ifso just renumber this code to fit your done. sometimes this kind of optomization dont work unless it is the correct interpreter and why we try to prototype in incremental line numbers.
|
|
|
Post by MadModder on May 25, 2008 6:40:26 GMT -5
I don't believe you can break the IF and THEN in basic 2.0? I have never tried it though...  3340 FOR T=0 to 2 3341 POKE763+T,ASC(MID$(M$,T+1,1)) 3342 NEXT 3343 IF H>12 THEN A$="P":H=H-12:GOTO 3340 But what is H, M$ and A$? What are their values before coming to this piece of code?
|
|
|
Post by Pinacolada on May 29, 2008 23:53:27 GMT -5
I don't believe you can break the IF and THEN in basic 2.0? I have never tried it though...  3340 FOR T=0 to 2 3341 POKE763+T,ASC(MID$(M$,T+1,1)) 3342 NEXT 3343 IF H>12 THEN A$="P":H=H-12:GOTO 3340 But what is H, M$ and A$? What are their values before coming to this piece of code? It must be code for a clock. 679-767 are memory locations unused by BASIC. A$ must have been set to "A" before the call; it's being set to "P" here, there seem to be mathematics dealing with converting (possibly) 24-hour time into 12-hour time. Perhaps M$ was a copy of TI$ (why only half, though... unless using BCD arithmetic?). Where did the OP get the code from?
|
|