[fpc-pascal] Can I define a custom "simple" type for my applications?

dmitry boyarintsev skalogryz.lists at gmail.com
Mon Apr 6 19:33:07 CEST 2009


> TGraemeBoolean = (gbNull, gbTrue, gbFalse);

imho, gbFalse should come before gbTrue.

how about that?

interface

TGraemeBoolean = (gbNull = -1, gbFalse = 0, gbTrue =1);

function dbBool(g: TGrameBoolean): Boolean; inline;
function dbAssigned(gTGrameBoolean): Boolean; inline;

implementation

function dbBool(g: TGrameBoolean): Boolean; inline;
begin
  Result := g <> gbFalse;
end;

function dbAssigned(gTGrameBoolean): Boolean; inline;
begin
  Result := g <> gbNil;
end;



More information about the fpc-pascal mailing list