realbasic-nug
[Top] [All Lists]

Re: RbScript - careful with Doubles

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: RbScript - careful with Doubles
From: Joe Huber <joehuber at talasoft dot com>
Date: Fri, 30 Sep 2005 08:31:53 -0700
Cc:
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <S dot 0000672091 at mail dot tempel dot org> <p06230901bf62730bb8fc at [192 dot 168 dot 2 dot 55]> <C65F1AC6-31A4-11DA-8AA1-000393C6C4C4 at hit dot net> <p06230901bf62e2e4efe2 at [192 dot 168 dot 2 dot 55]> <p06230900bf62e498560c at [192 dot 168 dot 2 dot 55]>
Remember that STR isn't "double-safe".

I didn't follow your code in any detail, but I notice that you're using STR(x) which will inherently reduces the precision of the returned value to a Single.

Regards,
Joe Huber


At 7:55 AM -0500 9/30/05, Bob Delaney wrote:
At 7:43 AM -0500 9/30/05, Bob Delaney wrote:
Sorry, I forgot to say that x and f are declared as global doubles in Window1.

RBScript1 is an already existing control in Window1. And RBScript1 has for its Input method:

return(str(x))

and for its Print method:

f=CDbl(msg)

and for CompilerError:

msgBox(Str(errorNumber))

Bob

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