On Aug 22, 2006, at 1:26 PM, Mars Saxman wrote:


On Aug 22, 2006, at 11:57 AM, Jan Erik Moström wrote:

I must be missing something here, the LR says that VarType returns 2 for "Integer types of 32 bits or less, signed or unsigned". OK but let's say that I store a number of values in a hash and then pick out a value, how can I then tell if it's uint8, int16, uint64 ...? How can I differ between Int64 and
UInt64?

You can't. Why do you need to? What's stored in the variant is a value, not a variable.

You may need to know if the original type was a uint8, i6, etc or get some kind of value conversion when it's not expected.
A dictionary may be the best example where this could happen.

If I do

        dim d as new dictionary

        d.value("abc") = -1

        select case vartype(d.value("abc"))

                case ????
                        myUint8 = d.value("abc")

                case ????
                        myUint16 = d.value("abc")

                case ????
                        myUint32 = d.value("abc")

                case ????
                        myInt8 = d.value("abc")

                case ????
                        myInt16 = d.value("abc")

                case ????
                        myInt32 = d.value("abc")
        end select

if it's important that I be able to store key value pairs AND retrieve the exact same type of value then I need a vartype that tells me this. I cannot think of a specific case where this would be required at the moment, but it's not too hard to see this might be possible.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to