Re: A problem with signs
Re: A problem with signs
- Subject: Re: A problem with signs
- From: Christopher Nebel <email@hidden>
- Date: Tue, 23 May 2006 12:11:36 -0700
On May 22, 2006, at 9:35 PM, Carl Anderson wrote:
I am trying to write an Applescript but am having a problem with
"-" signs.
This is a sample program that contains the problem
set x to "-0.1234"
set y to first word of x
display dialog x & " " & y
The program returns -0.1234 for x but returns a (+)0.1234 for y. I
have asked for the first character of x only to get a "0" instead
of a "-".
(I'm going to assume that "first character of x" was a typo, and you
meant "first character of y", because otherwise something is really
weird.)
A "word" in AppleScript is not simply a sequence of non-whitespace
characters -- it's defined by the local word-break rules, as set in
the International preference pane. Depending on the locale you use,
a leading hyphen may or may not be considered part of the "word". If
what you want is simply non-whitespace, use a different method.
"text items" may be of some use.
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden