realbasic-nug
[Top] [All Lists]

Re: type-casting enumerations

To: realbasic-nug at lists dot realsoftware dot com
Subject: Re: type-casting enumerations
From: "Dr. Scott Steinman" <steinman at midsouth dot rr dot com>
Date: Sun, 28 May 2006 14:10:34 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20060528170036 dot 73D8612AD313 at lists dot realsoftware dot com>
Mars-

    access = AccessType( Val( childNodeList.Item
( 0 ).FirstChild.Value ) )

Ah. The problem here is that Val returns a Double, which is a 64-bit
float and not a 32-bit integer. You have to convert first, then cast.

I didn't think about that. I was mislead a bit by the error message, which didn't state that the typecast expected an integer and got a double; it stated that a class was expected for the typecast. For the sake of others who might run into this at some time, could the error message be made more informative?

Thank you for your help again.

-Scott

Dr. Scott Steinman
Brought to you by a grant from the Steinman Foundation (Thanks, Mom and Dad!)
Recommended by Major University Studies Over the Leading Brand
steinman at midsouth dot rr dot com

I hope I die peacefully in my sleep like my grandfather. . .not screaming in terror like his passengers. -- "Deep Thoughts", Jack Handy

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


<Prev in Thread] Current Thread [Next in Thread>