handler troubles

Ben Bock benbock at msn.com
Fri Feb 3 20:01:00 EST 2006


I am going to make a standalone, that saves to a separate data stack.  Right now I have 2 sample stacks to work out the kinks, "button sample" and "data sample".  On the "button sample" stack I have a series of quiz items per card, each with yes or no responses.  I used radio buttons, grouped for each item.  

 

So item #1 has a "YES" btn and a "NO" btn, named "yes1" and "no1", & these are grouped to make "group1".

 

At the bottom of the page is a btn "Go Next Page", with the script:

 

on mouseUp

    put the value of hilitedbutton of group "group1" into field "1" of stack "data sample"

end mouseUp

 

This works alright, but it puts "YES" as 1 and "NO" as 2, apparently based on the ID.  What I want is to be able to code the correct answers "1" & the incorrect answers as "-1", with the unanswered items as "0".

 

 

So I tried scripts like this, with -1 for the incorrect buttons:

 

global dataValue1

on mouseUp

put -1 into dataValue1

end mouseUp

 

And this in the "Go Next Page " btn:

global dataValue1

on mouseUp

send dataValue1 to field "1" of stack "data sample"

end mouseUp

 

 

But get error message: 

 

Type Handler: can't find handler

Object: Next

Line: send dataValue1 to field "1" of stack "data sample"

Hint: -1



I can't figure out what is wrong.  I've tried many permutations that I have not listed.  Thanks for any help,


Ben



More information about the Use-livecode mailing list