Re: Basic casting question
Re: Basic casting question
- Subject: Re: Basic casting question
- From: email@hidden
- Date: Sun, 1 Mar 2009 10:44:38 -0800
Try this:
set myResult to (myResult as text ) as real
Some applications have data classes that look just like text but are
really something else and can't be directly coerced to numbers.
Also, if that part of your script is in an tell application block
moving it out.
HTH, ES
On Mar 1, 2009, at 10:24 AM, Pinus wrote:
Hi everyone,
I'm surprisingly stuck by a cast I try to do from a string to a real.
I have a function that returns something like "339.700012"
I want this result to be casted as a real (set myResult to myResult
as real) but I always get the same error :
"can't make "339.700012" into type real"
Is there something I missed regarding casting in AS ?
Thanks.
Stéphane _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden