dkl
Full Member
Posts: 234
|
Post by dkl on Feb 2, 2021 21:23:12 GMT -5
I have an LB programme that prints out a list of code/info
Can I get LB to auto highlight the printed out section and copy it to the clipboard
I am aware that one can add a hidden listbox - put info into the listbox and copy it to the clipboard.
Are there any other ways?
|
|
|
Post by Rod on Feb 3, 2021 4:58:04 GMT -5
little bit of code would help, are you using the mainwin? It has less functionality than some controls. A textbox or texteditor offers !copy command that gets text ready for clipboard.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Feb 3, 2021 7:46:10 GMT -5
Sorry Rod I meant the text editor NOT a list box!
Re provide some code ..... the programme opens a spreadsheet asks the user a few coding questions re size and no of records and then makes the code for a GUI with text boxes to display the records.
You run the programme and after the relevant questions are answered It prints out all the code. It’s this code that I want to auto highlight and copy then open a new LB window, paste it in and run it. It all works fine, but I want to automate the last 5 parts mentioned above to speed up things.
I think the hidden text editor will work, as usual wondered if there is another way!
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Feb 3, 2021 9:19:15 GMT -5
Oh, of course.... I could either put the code straight into a GUI text editor instead of printing it out then it’s easy to auto copy OR Write the code straight to disk and then run the file from LB - no highlighting or copying needed! That sounds better But I would still be interested in way of auto highlighting a batch of text.
|
|
|
Post by Carl Gundel on Feb 3, 2021 9:45:40 GMT -5
The only code highlighting you see is only to the screen in the editor and debugger. Liberty BASIC does this on the fly as it displays the code, so there is no highlighting that can be copied to the clipboard.
If you want highlighted text, the problem is that you would need to generate RTF or something like that because Liberty BASIC does not do that.
|
|
|
Post by Brandon Parker on Feb 3, 2021 9:57:20 GMT -5
You can "select" text in a TextBox using API controls. Maybe that is something you are interested in. I have some code for that, but I might need to boil it down a little from its parent program. Let me know if you are interested.
{:0)
Brandon Parker
|
|
|
Post by Rod on Feb 3, 2021 10:06:43 GMT -5
Ok, so you are looking at a data table then creating code to run. Highlighting the text is problematic but can be done but you still have to save it and run it. You could just write straight to a file and run that. That still has problems. Look at the section on using an alternative editor. In theory you can write the text/code to a file , create a .tkn and run that all from within Liberty. But file handling gets in the way. Alternatively you can just make your display object flexible. Throw any csv table you like at this code. Its probably more complex than you need but it formats itself to the data without needing new code. Thats the bit that would work for you. libertybasiccom.proboards.com/thread/42/mini-dbf-tool-csv-files
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Feb 3, 2021 19:11:30 GMT -5
Thank you for all that info. I'll try my 'write to disk' version first and see how I go.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Feb 4, 2021 2:47:51 GMT -5
Got it all working thank you. I took my existing code and wrote the code directly to disk. Got LB to write and save a BAT file and then LB ran the BAT to open the programme. Worked really. Thank you for your help. See you next time !!
|
|