System Functions Ord and Chr

This procedure processes system function Ord. It simply converts expression type to LongInt.
Procedure Func_Ord; Far;
begin
  Expression^.ExpectOrdinalExpressionInParentheses;
  With Expression^ do
    begin
      If Location = elMemory then Include (LocationData.Flags, efReadOnly);
      TypeDefPtr := Ptr (SystemUnitSegment, LongInt_TypeOffset);
    end;
end;
This procedure processes system function Chr. It simply converts expression type to Char.
Procedure Func_Chr; Far;
begin
  Expression^.ExpectIntegerExpressionInParentheses;
  With Expression^ do
    begin
      If Location = elMemory then Include (LocationData.Flags, efSegment);
      Expression^.ExtendInteger ([itUnsigned]);
      TypeDefPtr := Ptr (SystemUnitSegment, Char_TypeOffset);
    end;
end;
 
 
 
© 2017 Turbo Pascal | Privacy Policy