Opened 12 years ago

Closed 12 years ago

#2102 closed Bug (Duplicate)

error using ContinueLoop

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


When using code like

For $i = 1 To 10
	If $i = 3 Then ContinueLoop

I receive an error

"ContinueLoop" statement with no matching "While", "Do" or "For" statement.:
If $i = 3 Then ContinueLoop

Full example of code.

$File = FileOpenDialog('Choose 1st file', @ScriptDir, '(*.txt;*.xml)|(*)')
If @error Then Exit
$List = FileOpenDialog('Choose 2nd file', @ScriptDir, '(*.txt;*.xml)|(*)')
If @error Then Exit

$Out = FileGetName($File) & '.fixed.' & FileGetExtension($File)
_FileReadToArray($File, $File)
_FileReadToArray($List, $List)
For $i = 1 To $File[0]
	For $j = 1 To $List[0]
		If $File[$i] = $List[$j] Then ContinueLoop 2
	FileWriteLine($Out, $File[$i])

Attachments (0)

Change History (4)

comment:1 Changed 12 years ago by anonymous

For the last example I forget to paste defined functions.

Func FileGetName($String)
	Local $a
	$String = StringTrimLeft($String, StringInStr($String, '\', '', -1))
	$a = StringInStr($String, '.', '', -1)
	If Not $a Then
		Return $String
		Return StringLeft($String, $a - 1)
EndFunc   ;==>FileGetName

Func FileGetExtension($String)
	Local $a
	$a = StringInStr($String, '.', -1, -1)
	If Not $a Then Return ''
	Return StringTrimLeft($String, $a)
EndFunc   ;==>FileGetExtension

comment:2 Changed 12 years ago by jchd

See ticket #2073 which this one duplicates.

comment:3 Changed 12 years ago by anonymous

Oh, thanks, I didn't see that ticket.

comment:4 Changed 12 years ago by Jpm

  • Resolution set to Duplicate
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.