Re: Impossible "If"?
Re: Impossible "If"?
- Subject: Re: Impossible "If"?
- From: Andy Wylie <email@hidden>
- Date: Sat, 12 May 2001 04:24:27 +1200
on Fri, 11 May 2001 00:06:24 -0700 Michelle Steiner wrote:
>
>
On 5/10/01 10:51 PM, Ehsan Saffari <email@hidden> wrote:
>
>
> Why don't the ifs ever come true?
>
>
>
> set x to {3, 7, 11}
>
> repeat with h in x
>
> display dialog h
>
> if h = 3 then
>
> --do this
>
> else if h = 7 then
>
> --do that
>
> else if h = 11 then
>
> --do other
>
> end if
>
> end repeat
>
>
set x to {3, 7, 11}
>
repeat with h in x
>
display dialog h
>
if contents of h = 3 then
>
beep 1
>
else if contents of h = 7 then
>
beep 2
>
else if contents of h = 11 then
>
beep 3
>
end if
>
end repeat
>
or...
>
set x to {3, 7, 11}
>
repeat with h in x
>
display dialog h & (class of h) as text
>
set h to h as integer
>
if h = 3 then
>
beep 1
>
else if h = 7 then
>
beep 2
>
else if h = 11 then
>
beep 3
>
end if
>
end repeat
Well double duh! I finally get it
set x to {3, 7, 11}
repeat with h in x
set h to h - 0
--set h to (a reference to h)
if h = 3 then
beep 1
else if h = 7 then
beep 2
else if h = 11 then
beep 3
end if
end repeat
--any more traps for young players like this?
_____________________________ Andy