Re: comparing two identical strings
Re: comparing two identical strings
- Subject: Re: comparing two identical strings
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 02 Feb 2002 20:48:20 -0800
On 2/2/02 8:31 PM, "email@hidden" <email@hidden> wrote:
>
I'm a newbie with Applescript, and could use some help figuring out what
>
Applescript doesn't like about the way I'm comparing variables.
>
>
I've got 2 strings which are areacodes of a phone #:
>
>
"display dialog x" yields:
>
>
703
>
>
and "display dialog y" yields:
>
>
703
>
>
I need to compare them and see if they are equal. If I do a:
>
>
if x = y then
>
display dialog "They're equal!"
>
end if
>
>
nothing happens. Do I need to convert these variables into something else to
>
do this testing?
Nowhere have you told us what the two strings are. What is x and what is y?
Never mind the display dialogs. If x = 703, that's not actually a string,
although display dialog may coerce it to one. Is
x = 703
and
y = "703"
perhaps? Then they're not equal.
But (x as string) = (y as string)
will be true. But it could be a completely different problem.
Don't you think you'd better let us in on the secret and show us the part of
the code that defines x and y before asking us why they're not equal?
Fair's fair.
--
Paul Berkowitz