[fpc-pascal] Constants in generics

Jonas Maebe jonas at freepascal.org
Tue Jan 8 18:41:18 CET 2019


On 08/01/19 17:34, Ryan Joseph wrote:
> I made a little utility function which works in most cases but I don’t think it’s correct and more importantly this function probably already exists in the compiler.
> 
>      function compare_orddef_by_range(param1,param2:torddef): boolean;
>        var
>          orddef1,orddef2:tdef;
>        begin
>           range_to_type(param1.low,param1.high,orddef1);
>           range_to_type(param2.low,param2.high,orddef2);
>           result:=compare_defs(orddef1,orddef2,nothingn)>=te_convert_l1;
>        end;
> 
> 
> Is there an existing function for this or a better way to do it?

defutils.testrange


Jonas



More information about the fpc-pascal mailing list