Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LASTKEY() and the mouse... 1

Status
Not open for further replies.

Gilesy

Programmer
Jul 2, 2002
40
GB
Does anyone know what exactly is returned by lastkey with a mouse click? It seems to fluctuate between 50 and 56 in the debug, and the help says look at inkey() for values.
50 to 56 are numbers and you can't put "M" in lastkey()!

[bigears]
 
Gilesy,
why not use simply inkey("M") instead lastkey() ?
(good return 151...)
Tesar
 
Thanks Tesar, but unfortunately INKEY('M') doesn't work. It doesn't hold the value - as soon as you release the mouse it returns 0. My code is at the end of a validation if a browse field, so by the time it gets there INKEY is 0
I'm perplexed! [ponder]
 
Gilesy,
in fact i never use neither last nor inkey(),
and think "valid" must control value, not way to it...
To test inkey,
proc test
aa=inkey(0,"M")
? aa && i say 151, public value for you...
? lastkey() && i say 13
retu
I do not know reason why you must use lastkey,
may be better command is readkey(7)
Tesar
 
It sounds like you are entering numbers in your field, so the last key pressed, not mouse click, is 50 or 56 or whatever. If you are going to use the mouse to exit out of a read/valid, you may need to add a '0' value to your validation. Just keep in mind that the last key value will still be interpreted rather than the mouse click.
Dave S.
[cheers]
 
Thanks guys!

Readkey() did the trick in the end. (never used it before!)


[thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top