edpat
New Member
Posts: 4
|
Post by edpat on Apr 7, 2022 1:55:18 GMT -5
Hello all, Just new to LB and fumbling but learning and enjoying. I'd like to be able to save data stored on a string while a program was running, to be specific the MouseX and MouseY locations when mouse button is clicked, onto a file outside the program so that I can view it when the program is ended, Is this possible? Is it easy enough for a novice to manage? Thanks for any advice.
|
|
|
Post by Rod on Apr 7, 2022 2:36:00 GMT -5
|
|
|
Post by tenochtitlanuk on Apr 7, 2022 6:09:29 GMT -5
This sort of thing?? It saves a csv file you can read back in LB or as text or into a spreadsheet..
nomainwin
WindowWidth =860 WindowHeight =600
open "Save mouse-click positions" for graphics_nsb_nf as #wg
#wg "trapclose quit"
#wg "down ; size 5" #wg "when leftButtonDown saveMousePosn"
open "Positions.csv" for output as #fOut
wait
sub saveMousePosn h$, x, y #wg "set "; x; " "; y #fOut x; ","; y end sub
sub quit h$ close #fOut close #h$ end end sub
|
|
bplus
Full Member
Posts: 127
|
Post by bplus on Apr 7, 2022 7:57:51 GMT -5
Yes very doable, I have recreated writing /drawing with mouse that way. Do you know how to poll mouse, usually when left button down, and compare to last poll for differences eg using variables like lastMouseX, lastMouseY (globals). Oh wait, you said clicks, even easier!
|
|
edpat
New Member
Posts: 4
|
Post by edpat on Apr 7, 2022 19:20:09 GMT -5
Thanks all for these thoughtful and considerate replies. I will have to slowly, a step at a time, follow the suggestions and try to work it out. I greatly appreciate it.
|
|