MontyHall 1 Posted October 25, 2020 I thought this would be legal code 100 for b% = 0 to 10 110 print b% 120 next b But I get a syntax error at line 100. Is this not possible? Or how to do it correctly. Quote Share this post Link to post Share on other sites
0 JimmyDansbo 65 Posted October 25, 2020 I don't think you can create Integer variables. They will always be floating point or strings. Your example would be Quote 100 FOR B = 0 TO 10 110 PRINT B 120 NEXT B String variable names are followd by a dollar sign. Quote A$ = "HELLO, WORLD" Of course you can not do counting on strings Quote Share this post Link to post Share on other sites
0 SlithyMatt 416 Posted October 25, 2020 You can't use integer variables for FOR loops, you have to use regular real variables. Keep in mind: integer variables are still stored as floating point and actually introduce a performance hit by having to do rounding all the time. That's why you don't want to bother with one for a loop variable. Only use them when you absolutely need arithmetic results to be automatically rounded. 3 Quote Share this post Link to post Share on other sites
I thought this would be legal code
100 for b% = 0 to 10
110 print b%
120 next b
But I get a syntax error at line 100. Is this not possible? Or how to do it correctly.
Share this post
Link to post
Share on other sites