realbasic-nug
[Top] [All Lists]

Re: Format, Double, Str, CDbl and data exchange

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Format, Double, Str, CDbl and data exchange
From: Joe Strout <joe at inspiringapps dot com>
Date: Thu, 29 Nov 2007 16:49:04 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <C374FDE2 dot 45938%markus_winter at blueyonder dot co dot uk>
On Nov 29, 2007, at 4:38 PM, Markus Winter wrote:

> I’m saving a tab delimited list UTF-8 encoded with double values
> (representing movie positions) and text like this
>
> 1.345   text1
> 3.534   text 2

What's the point of this text file?  Is it to be read by humans, or  
only by computers?

> On a german system 1.345 is understood as 1345

Not with Val(), it's not.  With CDbl it is, as it should be.  You  
just need to decide which is appropriate.

> How do I read this as “1 point 345” on all systems???
> It seems an easy problem but I’m flumoxed.

Use Str() and Val() everywhere, and the computer will always know  
what it means (it uses "." as a decimal point and doesn't use "," at  
all).  If you want this to be human-readable, then use CStr and CDbl,  
and be careful not to move files from one system to another.

Best,
- Joe

--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com



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