Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:53 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM basic

Author Message
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1873
Posted: 06:27am 07 Jan 2012
Copy link to clipboard 
Print this post

Does anyone know if MM basic supports nested For Next Loops, I have tried to use one and keep getting error message 'for without next'.
Also have written a program using Labels instead of line nos. and when using GOSUB get an error message 'cant find label'.

Paul.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 06:32am 07 Jan 2012
Copy link to clipboard 
Print this post

Hi Paul.

Yes, MMBasic does support nested For Next. Please post a sample of your code that is getting the error and we can check for syntax issues.

As regards the Labels with MMBasic 3.0 - it should work but I know there are some minor bugs in the initial release and Geoff will be releasing 3.0A in the near future to resolve those issues. I am not certain if your problem is one of the bugs - best to go to Geoff's web site and check out the "known bugs" section.


  palcal said   Does anyone know if MM basic supports nested For Next Loops, I have tried to use one and keep getting error message 'for without next'.
Also have written a program using Labels instead of line nos. and when using GOSUB get an error message 'cant find label'.

Paul.


Regards

Gerard (vk3cg/vk3grs)
 
crackerjack

Senior Member

Joined: 11/07/2011
Location: Australia
Posts: 164
Posted: 07:01am 07 Jan 2012
Copy link to clipboard 
Print this post

Make sure you identify which NEXT relates to which FOR and that they don't overlap; e.g.:

Good ===>

FOR i = 1 to 10
FOR j = 1 to 10
? i * j
NEXT j
NEXT i


Bad ==>

FOR i = 1 to 10
FOR j = 1 to 10
? i * j
NEXT
NEXT


Worse! ==>


FOR i = 1 to 10
FOR j = 1 to 10
? i * j
NEXT i
NEXT j


Cheers....
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024