label used before containing beinding
wstomv at win.tue.nl
Tue Feb 3 08:44:01 CET 2004
>Nick Ioffe wrote:
>> I've encountered the message in the subject trying to compile
>> the following:
>> program x(input, output);
>> function f:string
>> if z = 1
>> writeln('to x_label');
>> goto x_label;
>> w:= 'z:'+f;
>> Compilation fails and I get:
>> x.pas:3: label 'x_label' used before containing binding contour.
Have you tried it with numeric labels (which at least the original
Pascal definition required)?
... goto 99
An alternative is to put the code in a separate procedure, and use Exit
to leave it early. Exit is basically a jump to the end of the
procedure. You can also use Exit in the main program to terminate
execution (jump to the end). See documentation for details on Exit.
More information about the Gpc