Probably the best approach is:

1.) Compare base types with the table.
1a.) If they are equal, goto 2.
1b.) If they differ, set winner according to table and go to 3.

2.) Compare aliases with the table, set winner.

3.) Use the original alias of the winner as result.

About the table:
We need one table for integer and one for floating-point types.
The integer table could look like ['int64', 'sizeint', 'integer', 'smallint'] (but with all integer types and probably a good idea to allow the user to modify and enhance it - e.g. a simple TStringList).
The winner is the one closest to the left (top - smallest index).

Ondrej

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to