match not working

Sarah Reichelt sarahr at genesearch.com.au
Tue Mar 22 00:54:42 EST 2005


> on rawKeyUp
>   if the number of chars in me = the number of chars in field 
> "MyField" then JobIsDone --
> end rawKeyUp
> ------------------------------------
> on JobIsDone
>   if me = field "MyField" then
>     put field "MyField" into field "MyName"
>   else beep
>   go to card 1
>   if end
> end JobIsDone
>
The reference to "me" will work OK so long as both these handlers are 
in the field script. "me" will then refer to the contents  of that 
field.

However in the JobIsDone handler, you need to use "end if" instead of 
"if end". You also need to put the "beep" on a line by itself, 
otherwise it becomes the complete alternative command. Currently what 
you have (in pseudo code) is:

if this field is the same as MyField then put MyField (or this field) 
into MyName
if it is different beep

regardless of whether it is the same or not, go to card 1
then do nothing because there is a weird if with no then and no 
statements.

I presume that this field is a third field, nether MyField or MyName?

HTH,
Sarah



More information about the Use-livecode mailing list