[comp.sys.mac.hypercard] a bug in the go command

abdenour@mist.cs.orst.edu (Abdennour A. MOUSSAOUI) (03/15/90)

I think their is a bug in the go command!
ver. 1.2.5

One can use the go command to move to a card by specifying either the card's
number or id or name.
if one uses:
go to card numberX     then one moves to card number numberX
go to card "nameX"     then one moves to card named nameX

Now, the bug is when one uses a number in the name field so that the name
of the card is for example "14".
so if one says:
go to card "14"    it doesn't go to card named "14" but instead it goes to card
                   number 14. (assuming their aren't the same cards)
so that (go to card "14") behaves just like (go to card 14)

this looks like a bug to me. right??

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /\   !    ~~~~Hayaa Ala-falaah  
Abdennour Moussaoui              || _~_~_      Allahu Akbar Allahu Akbar  
Oregon State University          ||(_____)     Laa Illaha Ila Allah~~~~
email=abdenour@mist.cs.orst.edu  |||_|_|_|  

dave@lsuc.on.ca (David Sherman|LSUC|Toronto) (03/16/90)

abdenour@mist.CS.ORST.EDU (Abdennour A. MOUSSAOUI) writes:
>I think there is a bug in the go command!
>
>go to card "14"    it doesn't go to card named "14" but instead it goes to card
>                   number 14. (assuming they aren't the same cards)
>so that (go to card "14") behaves just like (go to card 14)

It's not a bug.  It's a result of the totally loose typing
in Hypercard variables.  There is NO DISTINCTION between "14"
and 14; they are identical for all purposes in Hypertalk.
When you say "go to card xyz", it evaluates xyz; if it's a number,
Hypercard assumes you mean the card number; otherwise, it tries
for a card with that name.

Moral: don't give cards names which are numbers.

There are some other really strange effects of Hypercard's
"programmer-friendly" design:

"book" = "Book"  evaluates to true
"book" > "Book"  evaluates to true
"book" <= "Book" evaluates to false

That's because >, <, >= and <= all mean arithmetic
comparison, where ASCII 'b' is after ASCII 'B', while
'=' (or "is") means textual comparison, which is case-insensitive.
Beware!

David Sherman
Toronto
-- 
Moderator, mail.yiddish
{ uunet!attcan  att  utzoo }!lsuc!dave          dave@lsuc.on.ca