I just started to learn BBC BASIC. It's fun but how do I make data that I calculate usable? I mean, when I run my program a new window opens and the result is displayed. But the text there cannot be copied. So. how can I copy the results? Thanks
Do I need to write the results to a file? If so is this how it is done:
I mean, when I run my program a new window opens and the result is displayed. But the text there cannot be copied. So, how can I copy the results?
There are several ways to save the results, here are a few:
You can copy the (textual) contents of the output window to the clipboard using the hotkey combination Ctrl+Tab. See Capturing the screen contentshere.
You can spool the output to a file as well as to the screen:
INSTALL @lib$ + "dlglib"
PROC_setdialogpalette
dlg% = FN_newdialog("", 0, 0)
text$ = "The quick brown fox jumps over the lazy dog"
PROC_textbox(dlg%, text$, 101, 0, 0, 1000, 48, 0)
dummy% = FN_showdialog(dlg%, 100, 800)
If you are unhappy with any aspect of this post, please report it to the forum administrator (click on the exclamation mark icon in the top-right corner) rather than complaining on the open forum or by private email.
(Use OSCLI if the destination path/file includes a variable)
I did not understand this. I read the OSCLI definition in the manual, how does it relate here? I put the output.txt here: ~/Library/Application Support/BBCBasic/, and it worked fine with *spool.
I read the OSCLI definition in the manual, how does it relate here?
'Star' commands are literal strings, they cannot include variables. Since it is bad practice to 'hard code' a file path into a program, this typically means that commands like *spool need to be issued using OSCLI so that they can contain variables:
This feature of BBC BASIC commonly confuses beginners, albeit that it has been like that from the very beginning, 40 years ago.
If you are unhappy with any aspect of this post, please report it to the forum administrator (click on the exclamation mark icon in the top-right corner) rather than complaining on the open forum or by private email.
It closes the file, so it's quite important otherwise it will keep on spooling indefinitely.
The Help manual is your friend: all BBC BASIC statements, functions and commands are (or should be) documented there. This is what it says in the relevant section about *SPOOL:
"If the filename is omitted, any current spool file is closed and spooling is terminated."
If you do ever find something that you think should be in the Help manual but isn't, please let me know.
If you are unhappy with any aspect of this post, please report it to the forum administrator (click on the exclamation mark icon in the top-right corner) rather than complaining on the open forum or by private email.