Reply to Mars Saxman <[EMAIL PROTECTED]> 06-08-22 12:26:

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

I would like to store variables in a hash, I would then like to be able to save
and restore values from a file, I would also like to be able to "serve" values
from this hash in a type safe way.

Perhaps I'm missing something (if so, please tell me what) but if I understand
things correct I can store a int32 in an hash:

Sub set(name as String, value as Int32)
  pStorage.value( name ) = value
End Sub

and then return the same value now as an uint8

Sub get(name as String, byref value as UInt8)
  value = pStorage.value( name ).uInt32Value
End Sub

It doesn't seem like there is something to prevent this from happening and no
way for me to detect this:

  dim p as new TestStorage
  
  dim v as uInt8
  
  p.set( "testing", 2837223 )
  p.get( "testing", v )
  
  msgBox str(v)

this works and results in 231, I had hoped that I would be able to prevent this.

                    jem
_______________________________________________
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