realbasic-nug
[Top] [All Lists]

Re: Graphics.Stringwidth to integer

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Graphics.Stringwidth to integer
From: Norman Palardy <npalardy@great-white-software.com>
Date: Mon, 30 Jun 2008 22:05:17 -0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <FD67C277-83DC-4F7E-8565-43FEF80C82B7@tolisgroup.com>
References: <FD67C277-83DC-4F7E-8565-43FEF80C82B7@tolisgroup.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On 30-Jun-08, at 9:39 PM, Tim Jones wrote:


Hi Folks,

If a function returns a Double, but need I an integer, shouldn't I be able to simply cast the result of a call that returns a double to an integer?

  Me.Width = Integer(Graphics.Stringwidth(thestring))

The compiler informs me that it "Expected Int32, but got Double". Isn't that supposed to be resolved by the cast to Integer?

Why not just assign the double to the integer and it will be converted.





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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


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