On MouseUp with a parameter question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
On MouseUp with a parameter question
When I use the following code, what actually happens?
This is the code for a button object:
on MouseUp pBtnNum
--answer pBtnNum
if pBtnNum = 3 then answer "ok"
end MouseUp
I am assuming that by adding the parameter pBtn to the “on MouseUp” command that this allows me to access the pBtn in the script.
This parameter is different for buttons vs. fields.
The results were:
Left Click :nothing
Right Click : Message box
This is the script for a field object:
on mouseUp pBtn
answer pBtn
end mouseUp
The results were:
Left Click : nothing
Right Click : message box with the number 3
I am just trying to understand this and I can’t seem to find documentation about this.
This is the code for a button object:
on MouseUp pBtnNum
--answer pBtnNum
if pBtnNum = 3 then answer "ok"
end MouseUp
I am assuming that by adding the parameter pBtn to the “on MouseUp” command that this allows me to access the pBtn in the script.
This parameter is different for buttons vs. fields.
The results were:
Left Click :nothing
Right Click : Message box
This is the script for a field object:
on mouseUp pBtn
answer pBtn
end mouseUp
The results were:
Left Click : nothing
Right Click : message box with the number 3
I am just trying to understand this and I can’t seem to find documentation about this.
Clarence Martin
chipsm@themartinz.com
chipsm@themartinz.com
Re: On MouseUp with a parameter question
Hi Chips,
other than buttons and other LC objects, un-locked fields only receive RIGHT-clicks -> pBtn = 3
and no "normal" (left) mouse-messages.
Best
Klaus
other than buttons and other LC objects, un-locked fields only receive RIGHT-clicks -> pBtn = 3
and no "normal" (left) mouse-messages.
Best
Klaus
Re: On MouseUp with a parameter question
Thanks Klaus.
When I add a parameter to an object, does this initiate a change in the message path that allows the detection of the parameter?
When I add a parameter to an object, does this initiate a change in the message path that allows the detection of the parameter?
Clarence Martin
chipsm@themartinz.com
chipsm@themartinz.com
Re: On MouseUp with a parameter question
Sorry, no capisce, can you give an example?
Re: On MouseUp with a parameter question
Adding parameters to a message does not change the message path. Parameters only carry additional information. The are read by the receiving handler in the order they are passed, usually named (or renamed) at the first line of the handler itself, and used inside that handler from that point on.
So, in the simplest possible case:
Craig Newman
So, in the simplest possible case:
Code: Select all
on mouseUp
double 44
end mouseUp
on double tNumber
answer tNumber * 2
end double