PDA

View Full Version : Run script without saving?



MrHiggins
26-02-2022, 09:37
Hi,

I am currently evaluating ThinBASIC and have come from other BASICs such as PureBASIC and BBC BASIC. Coming from those BASICs you are able to execute a script without having to save the actual script. I was wondering if this would or is possible in ThinBASIC? It's a very minor thing, but at at the early stage of experimenting I am creating random scripts on the fly for testing ideas, and it is a little annoying being forced to save them. Especially as those scripts are just experiments and for learning and nothing serious.

Thanks for considering and hearing me out.

primo
27-02-2022, 06:37
i guess you mean executing the code from the IDE on the fly without saving it first like quick basic and purebasic . no it is not possible
but if you mean executing a script from the command line it is not possible in purebasic also, there should be a file to execute it
i don't see other than Perl which can do it like this from the command line
perl -e print(2+2)
output: 4

MrHiggins
27-02-2022, 08:57
i guess you mean executing the code from the IDE on the fly without saving it first like quick basic and purebasic .

Yep this is what I mean.

Yesterday I did find a hidden context that does what I want. If you right click the script tab and then select "Execute script in temporary mode" it can achieve what I want. This is usefully bound to "shift + f5". My only criticism with it is that it gives a messagebox confirming you wish to proceed everytime you run, it would be nice to just have an option in the ide to say to ignore that message box and just run it.

Was lucky I found this menu option, surprised it does not live under the main menu bar.

primo
27-02-2022, 13:13
Thanks MrHiggins
i never know about this before. and yes disabling the messageBox is preferable

ErosOlmi
25-03-2022, 17:35
Was lucky I found this menu option, surprised it does not live under the main menu bar.
Yes, as you discovered ... executing a script on the fly without having to save it can be done by right click on its editor Tab.

I will add those hidden but useful commands in main menu and in tool bar.
There a some other also under right click in editor window,

ReneMiner
03-04-2022, 09:00
how about a button

"New Experiment" a bit equal to "new Script" but the experiment has a name and a save-location predefined:

Name "Experiment_" & Now(11) & ".tBasic"
Location User_Scriptfolder & "Experiments\"

and for shipped sample-scripts:

zip these.

Put a new tab to codetree/filebrowser :

"Samplescripts" where the zip-content is listed and in case user opens one:

unzip it to experiments-folder + add a date to its name

that will secure the shipped samples remain unchanged and intact whatever the user wants to test - he gets a fresh new sample, unchanged as shipped