|
Post by jarychk on Jul 1, 2022 6:51:50 GMT
I try to say, I am unable to properly use 'origin' code lines for text window or textedit control.
I took some sample code from Liberty BASIC helpfile, made some modifications, but the results are not working. I hoped to both find the cursor location, and also put the cursor into a specific location. Not working.
open "Example" for text as #1 print #1, "!trapclose [quit]" 'carriage return suppressed by semicolon: print #1, "Hello"; 'this line will have a carriage return: #1 " World" 'this command omits the word 'print' #1 "!font courier_new 12" 'print some more text into the window, no carriage return: print #1, "This is a font called "; 'print text with carriage returns: print #1, "courier_new." 'blank line: print #1, "" print #1, "!origin? v1 v2" print v1,v2 #1 "Done!" print #1, "!origin ";70;" ";70 print v1,v2 wait [quit] close #1 end Sample program tells me that cursor is at 1 1; but why not cursor assigned to 70 70 as in the 'origin' code line just above? And cursor appears to be flashing at about 1 2, so I have no idea why the two origin lines not give what I want.
|
|
|
Post by honkytonk on Jul 1, 2022 7:20:04 GMT
|
|
|
Post by Rod on Jul 1, 2022 7:31:01 GMT
Origin does not set the cursor it sets the origin, or top left starting position of the text. If you set the origin to the middle of the text you would see on screen only the text starting from the middle but displayed top left. Half the text would be off screen.
To set the cursor play with The insert command.
|
|
|
Post by jarychk on Jul 1, 2022 8:02:36 GMT
Origin does not set the cursor it sets the origin, or top left starting position of the text. If you set the origin to the middle of the text you would see on screen only the text starting from the middle but displayed top left. Half the text would be off screen. To set the cursor play with The insert command. I followed the link which honkytonk suggested, then read about select and selection in the helpfile, but now with you you said, maybe I should choose text box control instead of textedit control. I am unsure and still confused. Clearly, trying origin was the wrong choice. I may see what can be done trying selection or select. Maybe change from there if they don't do well.
|
|
|
Post by tsh73 on Jul 1, 2022 8:13:47 GMT
but what exactly you are trying to do?
|
|
|
Post by jarychk on Jul 1, 2022 8:45:54 GMT
Currently I am trying to learn how to put display of two-dimensional array elements in vertical and horizontal alignment displayed on a textedit control.
|
|