[REBOL] Re: Comparing pairs
From: dada:gecko:verizon at: 23-Jun-2002 20:53
From the manual:
Do not enclose conditional expressions in a block. Conditional
expressions enclosed in blocks, always return a true result:
if [false] [print "yep"]
yep
so, if I do this:
if hero/offset == treasure/offset [
alert "You found the treasure!"
show treasure
]
everything works fine.
:)
sd
Sabin Densmore wrote:
> I read the archives, and the article from Gregg (nice :) ). And just
> have one point of clarification.
>
> I need to determine if the current coordinate of an element is at the
> same coordinate as another element on the screen.
>
> What I have for code is this:
>
> ; start code here
> ...
> if [hero/offset == treasure/offset] [
> alert "You found the treasure!"
> ]
> ...
> ; end code here
>
> of course it alerts after every move because i'm comparing datatypes and
> not values.
>
> Any hints? I'm feeling pretty dumb :\
>
> sd
>
--
---------------------------------
: sabin densmore
: www.onegecko.com
: [sabin--onegecko--com]