~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to rtl/os2/tests/getctry.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
program GetCountryInfo;
2
 
 
3
 
{$IFNDEF OS2}
4
 
 Sorry, this code is for OS/2 only...
5
 
{$ENDIF}
6
 
 
7
 
uses
8
 
{$IFDEF FPC}
9
 
 DosCalls;
10
 
{$ELSE}
11
 
 Os2Def,
12
 
 {$IFDEF VIRTUALPASCAL}
13
 
 Os2Base;
14
 
 {$ELSE}
15
 
  {$IFDEF SPEED}
16
 
 BseDos;
17
 
  {$ELSE}
18
 
 DosProcs, DosTypes;
19
 
  {$ENDIF}
20
 
 {$ENDIF}
21
 
{$ENDIF}
22
 
 
23
 
type
24
 
 cardinal = longint;
25
 
 
26
 
{$IFDEF FPC}
27
 
const
28
 
 NO_ERROR = 0;
29
 
{$ENDIF}
30
 
 
31
 
var
32
 
{$IFDEF VER70} (* patched Borland Pascal *)
33
 
 Country: TCountryCode;
34
 
 CtryInfo: TCountryInfo;
35
 
 Size: longint;
36
 
{$ELSE}
37
 
 Country: COUNTRYCODE;  (* Country code info (0 = current country) *)
38
 
 CtryInfo: COUNTRYINFO; (* Buffer for country-specific information *)
39
 
 Size: cardinal;        (* Real size of returned data              *)
40
 
{$ENDIF}
41
 
 W: word;
42
 
 
43
 
begin
44
 
 WriteLn;
45
 
 Size := 0;
46
 
 FillChar (Country, SizeOf (Country), 0);
47
 
 FillChar (CtryInfo, SizeOf (CtryInfo), 0);
48
 
 W :=
49
 
{$IFDEF VER70}
50
 
      DosGetCtryInfo
51
 
{$ELSE}
52
 
      DosQueryCtryInfo
53
 
{$ENDIF}
54
 
                       (SizeOf (CtryInfo), Country, CtryInfo, Size);
55
 
 if (W <> NO_ERROR) then
56
 
 begin
57
 
  WriteLn ('DosQueryCtryInfo error: return code = ', W);
58
 
  Halt (1);
59
 
 end;
60
 
 WriteLn ('Code of the country is ', CtryInfo.Country,
61
 
                                  ', current codepage is ', CtryInfo.CodePage);
62
 
end.