[comp.sys.mac.hypercard] Problems converting to HC2

anne@tasis.eecs.utas.edu.au (Anne Zanotti) (10/30/90)

After converting Mews (a mail & news reader) from HC 1.2.5 to 2.0, I encountered the following error message, when using the forward arrow button (or key):
	"Can't understand arguments to this keyword"
So I looked at the script for the offending button :

	on mouseup
		send Next to this card
	end mouseup

I tried putting quotes around 'Next', brackets around 'this card', but still the same error message.

The script for the back arrow is:
	
	on mouseup
		send Prev to this card
	end mouseup

and this works.

So, why does 'send Next to this card' no longer work in HyperCard 2?


 I tried replacing the call by simply 
	Prev
and 	Next
and the former still worked, but the latter didn't.

Has anyone else had similar problems? 
Any suggestions and help gratefully received.

Anne.


***********************************************************************

--
Anne Zanotti					anne@tasis.eecs.utas.edu.au
Computer Science				Phone:  +61 02-20-2918
University of Tasmania				Fax:    +61 02-20-2913
Australia

jkc@Apple.COM (John Kevin Calhoun) (10/31/90)

In article <anne.657265297@tasis> anne@tasis.eecs.utas.edu.au (Anne Zanotti)
writes:
>
>After converting Mews (a mail & news reader) from HC 1.2.5 to 2.0, I 
>encounter:
>       "Can't understand arguments to this keyword"
>So I looked at the script for the offending button :
>
>       on mouseup
>               send Next to this card
>       end mouseup
>
>[description of some experiments deleted]
>
>So, why does 'send Next to this card' no longer work in HyperCard 2?

'send Next to this card' no longer works because the word 'next' is a
keyword in HyperTalk, and keywords can no longer be sent as messages.
(I'll leave it to Dan Winkler to provide an explanation of why this
is so, perhaps in his next book.)

Here's the complete list of keywords:  do, else, end, exit, function,
global, if, next, on, pass, repeat, return, send, then.  If you have
handlers with any of these words as names, you won't able to invoke
them in 2.0.

Your stack will run fine under 2.0 if you change the name of the handler
from 'next' to something that's not a keyword, such as 'doNext'.

We're working on a complete list of the incompatibilities between
1.x HyperTalk and 2.0 HyperTalk and will post it widely when it's
ready.

Kevin Calhoun
HyperCard Engineer
Apple Computer, Inc.

jamesth@microsoft.UUCP (James THIELE) (11/01/90)

In article <anne.657265297@tasis> anne@tasis.eecs.utas.edu.au (Anne Zanotti) writes:
|
|After converting Mews (a mail & news reader) from HC 1.2.5 to 2.0, I encountered the following error message, when using the forward arrow button (or key):
|	"Can't understand arguments to this keyword"
|So I looked at the script for the offending button :
|
|	on mouseup
|		send Next to this card
|	end mouseup
|
|I tried putting quotes around 'Next', brackets around 'this card', but still the same error message.
|

This is going to be a very common problem for HC 1->2 conversions.  "Next" is
a keyword in HyperTalk, and HT 2.0 is not as lenient as HT 1.x.x about
allowing keywords to be used as names for messages and variables.  So
when you use message/variable names such as "next", "div", "me", etc. they
will probably have to be changed.

I ran into this converting an important stack for a friend.  I told him
a year ago not to use "me" as a variable name, but would he listen?  Nooo.

Hope this helps,
James Thiele -- microsoft!jamesth

jamesth@microsoft.UUCP (James THIELE) (11/06/90)

In article <46144@apple.Apple.COM> jkc@Apple.COM (John Kevin Calhoun) writes:
|In article <anne.657265297@tasis| anne@tasis.eecs.utas.edu.au (Anne Zanotti)
|writes:
||
||After converting Mews (a mail & news reader) from HC 1.2.5 to 2.0, I 
||encounter:
||       "Can't understand arguments to this keyword"
||So I looked at the script for the offending button :
||
||       on mouseup
||               send Next to this card
||       end mouseup
||
||[description of some experiments deleted]
||
||So, why does 'send Next to this card' no longer work in HyperCard 2?
|
|'send Next to this card' no longer works because the word 'next' is a
|keyword in HyperTalk, and keywords can no longer be sent as messages.
|(I'll leave it to Dan Winkler to provide an explanation of why this
|is so, perhaps in his next book.)
|
|Here's the complete list of keywords:  do, else, end, exit, function,
|global, if, next, on, pass, repeat, return, send, then.  If you have
|handlers with any of these words as names, you won't able to invoke
|them in 2.0.


I think the list of words you can't use as messages is a little longer.
For example, my buddy and I had trouble with an 'on div' handler
and a variable named 'me', both of which came from a working 1.2.x
stack.  My suggestion is to avoid *all* HyperTalk words to avoid
hassles.

"Let's be careful out there."

James Thiele -- microsoft!jamesth

Barry.Chern@p4.f200.n226.z1.FIDONET.ORG (Barry Chern) (11/08/90)

James Thiele opines in a missive of 05 Nov 90 to John Kevin Calhoun

JT> IHere's the complete list of keywords: do, else, end, exit, function, 
JT> Iglobal, if, next, on, pass, repeat, return, send, then. If you 
JT> have Ihandlers with any of these words as names, you won't able 
JT> to invoke Ithem in 2.0. 
JT>  I think the list of words you can't use as messages is a little 
JT> longer. For example, my buddy and I had trouble with an 'on div' 
JT> handler and a variable named 'me', both of which came from a 
JT> working 1.2.x stack

I had trouble with a previously working stack because it had a variable named
"this". I know, it's lazy, put so-and-so into this, thus-and-such into that...
But they still use them as examples in the Winkler/Kamins book, without ever
saying, "don't try this at home, these are stunt doubles."

--Barry

 
--  
Barry Chern via cmhGate - Net 226 fido<=>uucp gateway Col, OH
UUCP: ...!osu-cis!n8emr!cmhgate!200.4!Barry.Chern
INET: Barry.Chern@p4.f200.n226.z1.FIDONET.ORG