Browse Source

* write helper comproc for variants fixed

florian 22 years ago
parent
commit
e346ebacb6
3 changed files with 22 additions and 10 deletions
  1. 6 3
      rtl/inc/compproc.inc
  2. 11 5
      rtl/inc/variant.inc
  3. 5 2
      rtl/inc/varianth.inc

+ 6 - 3
rtl/inc/compproc.inc

@@ -169,8 +169,8 @@ Procedure fpc_Write_Text_WideChar(Len : Longint;var t : Text;c : WideChar); comp
 {$endif HASWIDECHAR}
 
 {$ifdef HASVARIANT}
-// Procedure fpc_Write_Text_Variant(Len : Longint;var f : Text;const v : variant);compilerproc;
 // function fpc_variant_to_dynarray(const v : variant;typeinfo : pointer) : pointer;compilerproc;
+procedure fpc_write_text_variant(Len : Longint;var f : Text;const v : variant); compilerproc;
 {$endif HASVARIANT}
 
 Procedure fpc_Read_End(var f:Text); compilerproc;
@@ -309,7 +309,10 @@ function fpc_qword_to_double(q: qword): double; compilerproc;
 
 {
   $Log$
-  Revision 1.48  2003-09-02 13:04:08  florian
+  Revision 1.49  2003-10-04 23:40:42  florian
+    * write helper comproc for variants fixed
+
+  Revision 1.48  2003/09/02 13:04:08  florian
     * ifdef'd some helpers
 
   Revision 1.47  2003/09/01 20:47:23  peter
@@ -428,4 +431,4 @@ function fpc_qword_to_double(q: qword): double; compilerproc;
   Revision 1.13  2002/01/21 20:16:08  peter
     * updated for dynarr:=nil
 
-}
+}

+ 11 - 5
rtl/inc/variant.inc

@@ -55,13 +55,16 @@ procedure variant_clear(var v : variant);[Public,Alias:'FPC_VARIANT_CLEAR'];
      variantmanager.varclear(v);
   end;
 
-Procedure fpc_Write_Text_Variant(Len : Longint;var f : Text;const v : variant); iocheck; [Public,Alias:'FPC_WRITE_TEXT_VARIANT']; {$ifdef hascompilerproc} compilerproc; {$endif}
+Procedure fpc_write_text_variant(Len : Longint;var f : Text;const v : variant); iocheck; [Public,Alias:'FPC_WRITE_TEXT_VARIANT']; compilerproc;
 Begin
   If (InOutRes<>0) then
    exit;
   case TextRec(f).mode of
     fmOutput { fmAppend gets changed to fmOutPut in do_open (JM) }:
-      variantmanager.writevariant(f,v,len);
+      if len=-1 then
+        variantmanager.write0variant(f,v)
+      else
+        variantmanager.writevariant(f,v,len);
     fmInput: InOutRes:=105
     else InOutRes:=103;
   end;
@@ -70,7 +73,7 @@ End;
 function fpc_variant_to_dynarray(const v : variant;typeinfo : pointer) : pointer;compilerproc;
   begin
   end;
-  
+
 function fpc_dynarray_to_variant(const v : variant;typeinfo : pointer) : pointer;compilerproc;
   begin
   end;
@@ -586,7 +589,10 @@ procedure initvariantmanager;
 
 {
   $Log$
-  Revision 1.13  2003-09-03 14:09:37  florian
+  Revision 1.14  2003-10-04 23:40:42  florian
+    * write helper comproc for variants fixed
+
+  Revision 1.13  2003/09/03 14:09:37  florian
     * arm fixes to the common rtl code
     * some generic math code fixed
     * ...
@@ -615,4 +621,4 @@ procedure initvariantmanager;
   Revision 1.5  2002/09/07 15:07:46  peter
     * old logs removed and tabs fixed
 
-}
+}

+ 5 - 2
rtl/inc/varianth.inc

@@ -152,7 +152,7 @@ type
       {!!!!!!!}
 
       { operators }
-      varop : procedure(var left : variant;const right : variant;opcdoe : tvarop);
+      varop : procedure(var left : variant;const right : variant;opcode : tvarop);
       cmpop : function(const left,right : variant;const opcode : tvarop) : boolean;
       varneg : procedure(var v : variant);
       varnot : procedure(var v : variant);
@@ -282,7 +282,10 @@ operator <=(const op1,op2 : variant) dest : boolean;
 
 {
   $Log$
-  Revision 1.11  2002-10-10 19:24:28  florian
+  Revision 1.12  2003-10-04 23:40:42  florian
+    * write helper comproc for variants fixed
+
+  Revision 1.11  2002/10/10 19:24:28  florian
     + write(ln) support for variants added
 
   Revision 1.10  2002/10/09 19:08:22  florian