Retrieving non-string values

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jan 14 22:43:37 CST 2004


on 1/14/04 8:38 PM, chuck hinkle at chuckbo at hinkles.us wrote:

> 
> 
> I don't know why I continue to be confused by this topic; it doesn't seem
> like it should be difficult.
> 
> 
> I have a table with a variable in it named Vsize, and it's defined as a
> vuShort. In my RB program, I'm having trouble moving it to a variable
> dimensioned as an integer.
> 
> I know that if my variable were a string, I could use
>   VSize = my_cursor.field("VSize").getstring
>> From what I read, it seems like I need to do
>   VSize = vushort(my_cursor.field("VSize"))  but that gives me a Type
> Mismatch error (perhaps because I'm trying to move a vushort to an
> integer?).
> 
> Any advice on this one?

Try this steps:

    dim fld as Vfield
    dim ushort_fld as VUShort
    

    fld = my_cursor.field("VSize")  // must be NOT nill

    ushort_fld = Vushort( fld ) // this type cast it to correct class
                                // result must be NOT nill

    now you can do 

    z = ushort_fld.value

Or 

    ushort_fld.value = z


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list