Re: Basic casting question
Re: Basic casting question
- Subject: Re: Basic casting question
- From: CYB <email@hidden>
- Date: Mon, 02 Mar 2009 12:58:16 -0600
- Thread-topic: Basic casting question
Title: Re: Basic casting question
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
I think that the problem is where the coercion is happening
set r to "339.700012"
r as real -->> 339.700012
But if I try
class of r as real -->> Can’t make text into type real.
If you try
class of (r as real) -->> Real
So maybe you just need some parenthesis in some place..
Carlos Ysunza B.
Director
Ysunza/Santiago
Comunicación Visual • Automatización
Tel. (52)55 5256-0336
email@hidden
http://www.ysunzasantiago.com
http://www.thesecretmexico.com
http://www.softrobot.com.mx
_______________________________________________
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