~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to docs/typinfex/ex4.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
program example4;
2
 
 
3
 
{ This program demonstrates the GetFloatProp function }
4
 
 
5
 
{$mode objfpc}
6
 
 
7
 
uses rttiobj,typinfo;
8
 
 
9
 
Var
10
 
  O : TMyTestObject;
11
 
  PI : PPropInfo;
12
 
 
13
 
begin
14
 
  O:=TMyTestObject.Create;
15
 
  Writeln('Real property : ');
16
 
  PI:=GetPropInfo(O,'RealField');
17
 
  Writeln('Value            : ',O.RealField);
18
 
  Writeln('Get (name)       : ',GetFloatProp(O,'RealField'));
19
 
  Writeln('Get (propinfo)   : ',GetFloatProp(O,PI));
20
 
  SetFloatProp(O,'RealField',system.Pi);
21
 
  Writeln('Set (name,pi)    : ',O.RealField);
22
 
  SetFloatProp(O,PI,exp(1));
23
 
  Writeln('Set (propinfo,e) : ',O.RealField);
24
 
  Writeln('Extended property : ');
25
 
  PI:=GetPropInfo(O,'ExtendedField');
26
 
  Writeln('Value            : ',O.ExtendedField);
27
 
  Writeln('Get (name)       : ',GetFloatProp(O,'ExtendedField'));
28
 
  Writeln('Get (propinfo)   : ',GetFloatProp(O,PI));
29
 
  SetFloatProp(O,'ExtendedField',system.Pi);
30
 
  Writeln('Set (name,pi)    : ',O.ExtendedField);
31
 
  SetFloatProp(O,PI,exp(1));
32
 
  Writeln('Set (propinfo,e) : ',O.ExtendedField);
33
 
  O.Free;
34
 
end.
 
 
b'\\ No newline at end of file'