Hi good afternoon.
why does this error come up in nextbasic please?
Thank you.
greeting
Error in nextbasic
Re: Error in nextbasic
I'm looking for a demo that works with bank and peek in nextbasic.
not funktion :
1050 b=b+1 : a= bank 15 peek b
thanks
greeting
not funktion :
1050 b=b+1 : a= bank 15 peek b
thanks
greeting
Re: Error in nextbasic
Has NextBasic done away with the need to use LET for variable assignment?
Re: Error in nextbasic
hello , this is ok.
now the x doesn't count in the peek.
greeting
greeting
now the x doesn't count in the peek.
greeting
Code: Select all
10 RUN AT 3
45 load "daten.map" bank 20
48 let b=0 : let a=0 : let x=0
50 for x=0 to 12
60 let a=% bank 20 peek x : print a
70 next x
90 go to 90
greeting
Re: Error in nextbasic
I am no expert but try
10 RUN AT 3
45 load "daten.map" bank 20
48 %b=0 : %a=0 : %x=0
50 for %x=0 to 12
60 let a=% bank 20 peek x : print %a
70 next %x
It is all down to the fact let a=% bank 20 peek x is declaired % so the output vairable needs the % to display correctly I think
10 RUN AT 3
45 load "daten.map" bank 20
48 %b=0 : %a=0 : %x=0
50 for %x=0 to 12
60 let a=% bank 20 peek x : print %a
70 next %x
It is all down to the fact let a=% bank 20 peek x is declaired % so the output vairable needs the % to display correctly I think
Next Launcher info: www.facebook.com/groups/nextlauncher
Re: Error in nextbasic
thanks for the information.
unfortunately that doesn't work either.
greeting
unfortunately that doesn't work either.
greeting
Re: Error in nextbasic
The suggestion fixed one error, the use of x in an integer context when %x was required, but introduced another of the same type.
60 let %a=% bank 20 peek x : print %a
Now you are assigning to %a so printing it makes sense. Alternative fix:
60 let a=% bank 20 peek x : print a
Or cut out the middle-man:
60 PRINT % bank 20 peek x
The great majority of discussion and support for NextBASIC is in the Facebook group BASIC on the ZX Spectrum Next. See you there?
60 let %a=% bank 20 peek x : print %a
Now you are assigning to %a so printing it makes sense. Alternative fix:
60 let a=% bank 20 peek x : print a
Or cut out the middle-man:
60 PRINT % bank 20 peek x
The great majority of discussion and support for NextBASIC is in the Facebook group BASIC on the ZX Spectrum Next. See you there?
Re: Error in nextbasic
Line 48 is entirely redundant and can safely be omitted, BTW.
Incidentally the title is misleading. There is no error in nextBASIC shown here, just one common beginner misunderstanding about the meaning and purpose of % there. I have explained that more fully in another reply here.
I think a lot of people are initially confused because they think the % belongs to a variable rather than the whole expression it prefixes. This may be because they’ve been exposed to the different and relatively useless use of % as a suffix in Microsoft BASIC. The performance and memory benefit of integer expressions in NextBASIC is several times greater, and grows with increasing program size.
Incidentally the title is misleading. There is no error in nextBASIC shown here, just one common beginner misunderstanding about the meaning and purpose of % there. I have explained that more fully in another reply here.
I think a lot of people are initially confused because they think the % belongs to a variable rather than the whole expression it prefixes. This may be because they’ve been exposed to the different and relatively useless use of % as a suffix in Microsoft BASIC. The performance and memory benefit of integer expressions in NextBASIC is several times greater, and grows with increasing program size.