[Info-vax] Coding style in the VMS's
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Wed Sep 29 09:02:25 EDT 2021
On 2021-09-29, Arne Vajhøj <arne at vajhoej.dk> wrote:
>
> I posted this here a few months ago when this particular topic came up.
>
> "Pascal" code:
>
> PROGRAM GOTOFUN(INPUT,OUTPUT);
> LABEL L731,L113,L247,L588,L761,L922,L399,L601;
> VAR LBL:INTEGER;
> VAR I:INTEGER;
> BEGIN
> L731: GOTO L113;
> LBL:=399;
> L113: I:=0;
> WRITELN(I);
> L247: LBL:=601;
> IF(I<0)THEN GOTO L588 ELSE IF(I=0)THEN GOTO L922 ELSE GOTO L399;
> L588: I:=I+1;
> WRITELN(I);
> GOTO L399;
> L761: CASE(LBL)OF 399: GOTO L399; 601: GOTO L601; END;
Is that a computed goto implemented in Pascal ????????????? :-)
Wow.
I wonder if it's possible to also make assigned goto (which was even
more brain damaged IMHO) work in Pascal ?
IOW, do any Pascal variants allow you to goto a label held within
a variable ? (I hope not, but you never know.)
I have absolutely no idea BTW if you can do this - I've never tried
to do anything like that in Pascal.
> L922: I:=I+1;
> WRITELN(I);
> CASE(I)OF 1: GOTO L588; 2: GOTO L399; 3: GOTO L922; END;
> L399: GOTO L761;
> L601: END.
>
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.
More information about the Info-vax
mailing list