[fpc-pascal] Scoped enums and inferred types

russeld russeld.lists at gmail.com
Wed Feb 21 14:41:32 CET 2018


Pascal allows type declarations at the procedure level, so you could use type
aliases to reduce your typing and still have code completion:

procedure foo();
type 
  SVK = NSSomeLongNameOfSomethingValueKey;
var
  a: SVK;
begin
  a := SVK.some_key_value;
end;

If you tried to use SVK elsewhere an error would be raised

Regards
Russ

   



--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/


More information about the fpc-pascal mailing list