Browse Source

* strlenint type implemented

florian 27 years ago
parent
commit
5e5ca61090
3 changed files with 28 additions and 13 deletions
  1. 4 5
      rtl/inc/real2str.inc
  2. 7 4
      rtl/inc/sstrings.inc
  3. 17 4
      rtl/inc/systemh.inc

+ 4 - 5
rtl/inc/real2str.inc

@@ -158,11 +158,7 @@ begin
     insert ('.',temp,3);
     str(abs(correct),power);
     if length(power)<explen-2 then
-{$ifndef USEANSISTRINGS} {!!!!!!!!! this doesn't work with ansi strings }
       power:=copy(zero,1,explen-2-length(power))+power;
-{$else USEANSISTRINGS}
-      ;  
-{$endif USEANSISTRINGS}
     if correct<0 then power:='-'+power else power:='+'+power;
     temp:=temp+'E'+power;
     end
@@ -202,7 +198,10 @@ end;
 
 {
   $Log$
-  Revision 1.5  1998-07-13 21:19:10  florian
+  Revision 1.6  1998-07-18 17:14:22  florian
+    * strlenint type implemented
+
+  Revision 1.5  1998/07/13 21:19:10  florian
     * some problems with ansi string support fixed
 
   Revision 1.4  1998/06/18 08:15:33  michael

+ 7 - 4
rtl/inc/sstrings.inc

@@ -18,7 +18,7 @@
 
 {$I real2str.inc}
 
-function copy(const s : string;index : integer;count : integer): string;
+function copy(const s : string;index : StrLenInt;count : StrLenInt): string;
 
 begin
   if count<0 then
@@ -36,7 +36,7 @@ begin
   Move(s[Index+1],Copy[1],Count);
 end;
 
-procedure delete(var s : string;index : integer;count : integer);
+procedure delete(var s : string;index : StrLenInt;count : StrLenInt);
 
 begin
   if index<=0 then
@@ -54,7 +54,7 @@ begin
    end;
 end;
 
-procedure insert(const source : string;var s : string;index : integer);
+procedure insert(const source : string;var s : string;index : StrLenInt);
 
 begin
   if index>1 then
@@ -717,7 +717,10 @@ end;
 
 {
   $Log$
-  Revision 1.8  1998-07-10 11:02:38  peter
+  Revision 1.9  1998-07-18 17:14:23  florian
+    * strlenint type implemented
+
+  Revision 1.8  1998/07/10 11:02:38  peter
     * support_fixed, becuase fixed is not 100% yet for the m68k
 
   Revision 1.7  1998/07/02 12:14:19  carl

+ 17 - 4
rtl/inc/systemh.inc

@@ -42,6 +42,16 @@ Type
   {$define SUPPORT_FIXED}
 {$endif}
 
+{$ifdef m68k}
+   StrLenInt = Integer;
+   {$ifdef USEANSISTRINGS}
+      {$error StrLenInt must be a longint if ansi strings are used}
+   {$endif}
+{$endif}
+
+{$ifdef i386}
+   StrLenInt = LongInt;
+{$endif}
 { some type aliases }
   dword    = cardinal;
   longword = cardinal;
@@ -198,9 +208,9 @@ function strpas(p:pchar):string;
 function strlen(p:pchar):longint;
 
 
-Function  copy(const s:string;index:Integer;count:Integer):string;
-Procedure Delete(Var s:string;index:Integer;count:Integer);
-Procedure Insert(const source:string;Var s:string;index:Integer);
+Function  Copy(const s:string;index:StrLenInt;count:StrLenInt):string;
+Procedure Delete(Var s:string;index:StrLenInt;count:StrLenInt);
+Procedure Insert(const source:string;Var s:string;index:StrLenInt);
 Function  Pos(const substr:string;const s:string):byte;
 Function  Pos(C:Char;const s:string):byte;
 Function  upCase(c:Char):Char;
@@ -390,7 +400,10 @@ Procedure halt;
 
 {
   $Log$
-  Revision 1.17  1998-07-10 11:02:39  peter
+  Revision 1.18  1998-07-18 17:14:24  florian
+    * strlenint type implemented
+
+  Revision 1.17  1998/07/10 11:02:39  peter
     * support_fixed, becuase fixed is not 100% yet for the m68k
 
   Revision 1.16  1998/07/02 12:13:18  carl