Re: Invalid variant type conversion

From: Bjørge Sæther (bjorge_at_hahaha_itte.no)
Date: 01/21/04


Date: Wed, 21 Jan 2004 10:14:46 +0100

Bruce Roberts wrote:
> "Bjørge Sæther" <bjorge@hahaha_itte.no> wrote in message
> news:WMaPb.2530$hd.45619@news2.e.nsc.no...
>
>> If there was no variant type, one would probably create one for
>> oneself (not all of us, but...). They're exactly like the untyped
>> constant parameters, who definately serve a purpose when you want to
>> keep coding simple.
>
> Since TP days there has been tVarRec.

Right. TVarRec (used with 'array of const') and TVarData (used with
variants) are more or less identical, only "backwards"). The differences are
in compiler's handling (conversion, ref.counting, etc.).

[-> So, mr. French, do you also abandon the (good ?) ol' 'array of const' ?]

One may discuss the possible problem with coding with variants vs. the
benefits. Back in the pre-GHz-days, performance was an argument alone. A
simple variant assignment may include 100's of instructions. But there are
occasions where passing "data with type information" is useful. Then you
*know* you can't take anything for granted, and e.g. using strings isn't
necessarily safer or simpler.

-- 
Regards,
Bjørge Sæther
bjorge@haha_itte.no
-------------------------------------
I'll not spend any money on American Software products
until armed forces are out of Iraq.


Relevant Pages

  • Re: Comparing a variant string with char*
    ... I understand what you are saying, but the above code compiles and runs ... A VARIANT type is not a string, and is not comparable to a string; ... There is no VARIANT type that can represent a char string, for example, although there is ...
    (microsoft.public.vc.mfc)
  • Re: Increment a Variable?
    ... >> No, it does not have to be a Variant type, but you can't change data ... >> types with a redim unless the array is contained in a Variant. ... > Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.formscoding)
  • Re: one method of COM object needs a variant type variable
    ... I seen this before, but I don't know, what's mean 'compatible object'. ... I need create object who will like as an variant type. ... A variant can hold simple Python objects as integer, float, string... ... Gabriel Genellina ...
    (comp.lang.python)
  • Re: Using the $ after functions
    ... AnyString = "Hello World" ' Define string. ... I would not need to use the variant that defined how many characters from ... for query expressions - I suggest to use variant type ...
    (microsoft.public.access.modulesdaovba)
  • Re: Speed Speed Speed - Cutting down on wasted cycles
    ... result of my ignorance on how to best utilize VB6 coding techniques. ... Public Function GetWeekdays(BegDate As Variant, ... Dim DateCnt As Variant ... Dim EndDays As Long ...
    (microsoft.public.vb.general.discussion)