Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Exit_statement

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> VFScript
View previous topic :: View next topic  
Author Message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 729

PostPosted: Jan 15th, 2012, 9:06pm    Post subject: Exit_statement Reply with quote

Code:
***** 14-Jan-2012
Remarks
An Exit Do statement may appear inside a Do/Loop loop.
An Exit For statement may appear inside a For/Next loop.
Back to simple statements
***** 15-Jan-2012
Remarks
An Exit Do statement may appear inside a Do/Loop loop. This causes execution to
jump to the line following Loop.
An Exit For statement may appear inside a For/Next loop. This causes execution
to jump to the line following Next.
Unlike Liberty BASIC, Exit may be used to exit out of multiple nested loops. For
example two For/Next loops nested within a Do/Loop loop can be exited with a
single Exit Do.
Examples
Example 1: Validating user input
Do
  Prompt "Enter an integer in the range 1 to 10", n
  If n=Int(n) And n>=1 And n<=10 Then
    Exit Do
  End If
Loop While TrueExample 2: Exiting nested loops
Do
  For i=1 To 10
    For j=1 To 10
      If Int(10*Rnd(0))=5 Then
        Exit Do
      End If
    Next j
  Next i
Loop While True
Notice "i=";i;CrLf;"j=";jSee also
  Do/Loop statement
  For/Next statement
Back to simple statements
*****

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 729

PostPosted: Jan 31st, 2012, 8:49pm    Post subject: Re: Exit_statement Reply with quote

Code:
***** 21-Jan-2012

Exit {Do|For}

***** 31-Jan-2012

Exit {Do|For|Loop|Sub}

*****

***** 21-Jan-2012

An Exit Do statement may appear inside a Do/Loop <#Do_Loop_statement>
loop. This causes execution to jump to the line following Loop.

***** 31-Jan-2012

An Exit Do or Exit Loop statement may appear inside a Do/Loop
<#Do_Loop_statement> loop. This causes execution to jump to the line
following Loop.

*****

***** 21-Jan-2012

Unlike Liberty BASIC, Exit may be used to exit out of multiple nested
***** 31-Jan-2012

An Exit Sub statement works identically to the Stop <#Stop_statement>
statement.

Unlike Liberty BASIC, Exit may be used to exit out of multiple nested
*****

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> VFScript All times are GMT
Page 1 of 1
Jump to:  
Quick Reply
Username:
Message:
   Shortcut keys: Alt+Q to activate, Alt+P to preview, Alt+S to submit
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group