ex15.pp 608 B

12345678910111213141516171819202122232425
  1. program example15;
  2. { This program demonstrates the GetInt64Prop function }
  3. {$mode objfpc}
  4. uses rttiobj,typinfo;
  5. Var
  6. O : TMyTestObject;
  7. PI : PPropInfo;
  8. begin
  9. O:=TMyTestObject.Create;
  10. Writeln('Int64 property : ');
  11. PI:=GetPropInfo(O,'Int64Field');
  12. Writeln('Value : ',O.Int64Field);
  13. Writeln('Get (name) : ',GetInt64Prop(O,'Int64Field'));
  14. Writeln('Get (propinfo) : ',GetInt64Prop(O,PI));
  15. SetInt64Prop(O,'Int64Field',12345);
  16. Writeln('Set (name,12345) : ',O.Int64Field);
  17. SetInt64Prop(O,PI,54321);
  18. Writeln('Set (propinfo,54321) : ',O.Int64Field);
  19. O.Free;
  20. end.