[fpc-pascal] Selecting Records with a variable

Jean SUZINEAU jean.suzineau at wanadoo.fr
Sun Dec 20 23:08:41 CET 2020


Le 20/12/2020 à 16:02, James Richters via fpc-pascal a écrit :
> If I need a bunch of case statements, it's atcually worse than if I just have separate procedures.

No, in fact the case statement is written only once, in the 
implementation of TAxisRecord, and in procedure 
Move_It(Axis_Letter:Char); , you just use:

DoSomething(Variable1.Value_from_Letter(Axis_Letter));

This said, I think that Lucas and Stefan ideas with "AxisName = 
(X,Y,Z,A,B,C);" are better than mine,

because compilation will fail on a bad axis name, for example a typo 
with Axis[U].



More information about the fpc-pascal mailing list