BBC BASIC for Windows
« FOR NEXT loop »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:20am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: FOR NEXT loop  (Read 668 times)
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: FOR NEXT loop
« Reply #3 on: Jun 26th, 2013, 08:19am »

Thanks, that IS interesting. I'd also always assumed it went back to the FOR... statement, and had wondered, but never tested, whether the end condition was changeable.

I note that changing the control variable WILL alter the looping, though.

Best wishes,

D
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: FOR NEXT loop
« Reply #4 on: Jun 26th, 2013, 08:56am »

on Jun 26th, 2013, 08:19am, DDRM wrote:
I note that changing the control variable WILL alter the looping, though.

Since BBC BASIC is interpreted there's no way it can tell that you've changed the value of the control variable 'behind its back'. Before the advent of EXIT FOR the standard way of prematurely exiting a FOR...NEXT loop was to set the loop variable to (or past) the limit value. Setting it past the limit value provided a convenient way of being able to test, on exit, whether it was terminated prematurely or not.

Richard.
« Last Edit: Jun 26th, 2013, 08:56am by admin » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls