[fpc-devel] Case code pattern

Marco Borsari borsa77 at libero.it
Tue Aug 14 14:33:20 CEST 2018


Il 14/08/2018 12:37, Martok ha scritto:

> label label0,label1,label2,{...,}afterend;
> const table: array [lowestcaselabel..highestcaselabel] of CodePointer = (@label0, @label1, @label2{,...});
> if (x<lowestcaselabel) or (x>highestcaselabel) then
>   goto @afterend;
> goto table[x];
> label0:
>   code;
>   goto afterend;
> label1:
>   Morecode;
>   goto afterend;
> label2:
>   EvenMoreCode;
> {...}
> afterend:
>
I did not aware about CodePointer type and its use in conjunction with 
the goto, it is very useful, thank you.
But for compatibility with TP, I could need for a plain branch table, I 
am writing a new mail in the other list...
Marco



More information about the fpc-devel mailing list