Hi this is driving me crazy,
I have a lot of fields on a card. I put a value in a different field called employee and when I click on any of the other empty fields on the card I want the name in the fld"employee" to be copied into the field I clicked on.
I am using LC 9.5.0 Build 15503 on a Macbook Air OS Mojave Version 10.14.6
The code in all of my fields of interest is:
on mouseUp
put fld"employee" into me
end mouseUp
on the Mac, I have a 3 button mouse.
This only works when I click using the right mouse button.
It doesn't matter to me if it works that way but I also want it to work with the left button.
I tried this code:
on mouseUp pButtonNumber
put pButtonNumber into tNum
if tNum = 1 then
answer tNum
end if
If tNum = 3 then
answer tNum
end if
end mouseUp
If I click on the field with the left mouse the answer is 1 if the right mouse the answer is 3.
I change the code to:
on mouseUp pButtonNumber
put pButtonNumber into tNum
if tNum = 1 then
put fld"employee" into me
end if
If tNum = 3 then
put fld"employee" into me
end if
end mouseUp
The name in the clicked on field only changes if I use the right mouse click.
Is this a bug or am I doing something terribly wrong?
Thanks Tom
mouseUp pButtonNumber
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: mouseUp pButtonNumber
Hi Tom,
not sure I fully understand your problem, but here some hints:
There is no need to use and fill another variable with the content of the variable
which acts as the parameter to the "mouseup" handler!
HINT:
Only LOCKED ( locktext = true) fields will receive all "mouseXX" messages.
Unlocked = editable fields only the RIGHT click (tNum = 3!) message (so we can supply context menus etc.)
So if that is the case in your stack, you now know why.
If that is not what you mean, please give more info.
Best
Klaus
not sure I fully understand your problem, but here some hints:
Code: Select all
on mouseUp pButtonNumber
put pButtonNumber into tNum
if tNum = 1 then
...
which acts as the parameter to the "mouseup" handler!

Code: Select all
## You can name the parameter whatever you want to, so this will do:
on mouseUp tNum
if tNum <> 2 then
answer tNum
end if
## :-)
end mouseUp
Only LOCKED ( locktext = true) fields will receive all "mouseXX" messages.
Unlocked = editable fields only the RIGHT click (tNum = 3!) message (so we can supply context menus etc.)
So if that is the case in your stack, you now know why.

If that is not what you mean, please give more info.
Best
Klaus
Re: mouseUp pButtonNumber
Thanks Klaus,
The offending fields were unlocked.
Tom
The offending fields were unlocked.
Tom