Browse Source

* PChar -> PAnsiChar

Michaël Van Canneyt 2 years ago
parent
commit
239fe6806b
2 changed files with 11 additions and 11 deletions
  1. 9 9
      packages/pxlib/examples/ppxview.pp
  2. 2 2
      packages/pxlib/src/pxlib.pp

+ 9 - 9
packages/pxlib/examples/ppxview.pp

@@ -9,7 +9,7 @@ procedure DumpInfo (Doc : PPX_Doc);
 
 
 Var
 Var
   I : Integer;
   I : Integer;
-  S : String;
+  S : AnsiString;
   pxf : Ppxfield_t;
   pxf : Ppxfield_t;
   
   
 begin
 begin
@@ -20,7 +20,7 @@ begin
     Write('Field ',I:3,': ',strpas(pxf^.px_fname):18,' : ');
     Write('Field ',I:3,': ',strpas(pxf^.px_fname):18,' : ');
     S:='';
     S:='';
     Case (pxf^.px_ftype) of
     Case (pxf^.px_ftype) of
-      pxfAlpha:    S:=Format('char(%d)',[pxf^.px_flen]);
+      pxfAlpha:    S:=Format('AnsiChar(%d)',[pxf^.px_flen]);
       pxfDate:     S:=Format('date(%d)',[pxf^.px_flen]);
       pxfDate:     S:=Format('date(%d)',[pxf^.px_flen]);
       pxfShort:    S:=Format('int(%d)',[pxf^.px_flen]);
       pxfShort:    S:=Format('int(%d)',[pxf^.px_flen]);
       pxfLong:     S:=Format('int(%d)',[pxf^.px_flen]);
       pxfLong:     S:=Format('int(%d)',[pxf^.px_flen]);
@@ -51,13 +51,13 @@ Procedure DumpRecords(Doc : PPX_Doc);
 var
 var
   I,J,K,flen : Integer;
   I,J,K,flen : Integer;
   pxf : Ppxfield_t;
   pxf : Ppxfield_t;
-  s : string;          
-  buf, fbuf,value : Pchar;
+  s : AnsiString;
+  buf, fbuf,value : PAnsiChar;
   longv : clong;
   longv : clong;
   y,m,d : cint;
   y,m,d : cint;
   si: shortint;
   si: shortint;
   R : Double;
   R : Double;
-  c : char;
+  c : AnsiChar;
   
   
 begin
 begin
   I:=0;
   I:=0;
@@ -164,7 +164,7 @@ end;
 
 
 Var
 Var
   Doc : PPX_Doc;
   Doc : PPX_Doc;
-  FN,BFN : String;
+  FN,BFN : AnsiString;
 
 
 begin
 begin
   LoadPXlib(pxlibraryname);
   LoadPXlib(pxlibraryname);
@@ -174,10 +174,10 @@ begin
     Try
     Try
       FN:=ParamStr(1);
       FN:=ParamStr(1);
       BFN:=ChangeFileExt(FN,'.mb');
       BFN:=ChangeFileExt(FN,'.mb');
-      px_open_file(Doc,Pchar(FN));
+      px_open_file(Doc,PAnsiChar(FN));
       try
       try
         if FileExists(BFN) then
         if FileExists(BFN) then
-          PX_set_blob_file(Doc,PChar(BFN));
+          PX_set_blob_file(Doc,PAnsiChar(BFN));
         DumpInfo(Doc);
         DumpInfo(Doc);
         DumpRecords(Doc);
         DumpRecords(Doc);
       Finally  
       Finally  
@@ -189,4 +189,4 @@ begin
   finally
   finally
     PX_Shutdown;
     PX_Shutdown;
   end;
   end;
-end.
+end.

+ 2 - 2
packages/pxlib/src/pxlib.pp

@@ -84,7 +84,7 @@ Type
   PWord     = ^Word;
   PWord     = ^Word;
   PDWord    = ^DWord;
   PDWord    = ^DWord;
   PDouble   = ^Double;
   PDouble   = ^Double;
-  Pcchar    = pchar;
+  Pcchar    = PAnsiChar;
 
 
 {$ifndef unix}
 {$ifndef unix}
   size_t    = Integer;
   size_t    = Integer;
@@ -491,7 +491,7 @@ Procedure Loadpxlib(lib : String);
 
 
 begin
 begin
   Freepxlib;
   Freepxlib;
-  hlib:=LoadLibrary(Pchar(lib));
+  hlib:=LoadLibrary(PAnsiChar(lib));
   if hlib=0 then
   if hlib=0 then
     raise Exception.Create(format('Could not load library: %s',[lib]));
     raise Exception.Create(format('Could not load library: %s',[lib]));
   pointer(PX_get_majorversion):=GetProcAddress(hlib,'PX_get_majorversion');
   pointer(PX_get_majorversion):=GetProcAddress(hlib,'PX_get_majorversion');