Continue statement

www.kxcad.net Home > Electronic Index > Altium(Protel) Index


Your Ad Here

The Continue statement jumps over the body of a loop, similar to the goto statement. The continue statement causes the executing script to pass to the next iteration in the current For, While or Repeat loop.

Example

var

    F: File;

    i: Integer;

Begin

    For i := 0 to (FileListBox1.Items.Count - 1) do begin

    Try

        If FileListBox1.Selected[i] Then

        Begin

            If not FileExists(FileListBox1.Items.Strings[i]) then

            Begin

                MessageDlg('File: ' + FileListBox1.Items.Strings[i] +

                   ' not found', mtError, [mbOk], 0);

                Continue;

            End;

            AssignFile(F, FileListBox1.Items.Strings[i]);

            Reset(F, 1);

            ListBox1.Items.Add(IntToStr(FileSize(F)));

            CloseFile(F);

        End;

        Finally

            { do something here }

        End;

    End;

End;

See also

Delphi Script statements

If Then statement

Case of statement

With statement

For To Do loop

Repeat Until loop

Exit statement

Break Statement

Your Ad Here