[Gambas-user] Script vs Command Line Application
Patrik Karlström
patrik at trixon.se
Sun Mar 22 17:06:13 CET 2020
Den lör 21 mars 2020 kl 13:38 skrev Tobias Boege <taboege at gmail.com>:
> On Sat, 21 Mar 2020, Patrik Karlström wrote:
> > I was about to do some bash scripts in order to
> >
> > - Create 3 Java run times environment, one for each major os, with
> jlink
> > - From one NetBeans application platform.zip
> > - edit a text file
> > - insert a JRE
> > - Create an AppImage
> > - Produce checksums
> >
> > I'm already doing this semi-manual today and looking for a more automated
> > version.
> >
> > Then Gambas came to my mind, but it was a couple of years since I used
> it,
> > and I've never touched scripts before
> >
> > The question now is, should I go with a Script or a Command Line
> > Application?
> >
>
> Of the two types, Command Line Application is the one that is "native" to
> Gambas. When you create a script and run it through gbs3, it takes your
> source file and builds a command line project around it and then has gbc3
> compile and gbx3 execute that temporary project. These projects are cached
> in /tmp and a new one is created when your script source changes.
>
> That is, scripts are mini-projects that get automatically recompiled when
> needed. If your source doesn't change, they start up just as fast as pre-
> compiled projects. The disadvantage of a script is that you are restricted
> to a single source file. Note that you can still use components by writing
> USE statements [1] at the top of your script. In particular gb.args can be
> useful for utility scripts.
>
> I tend to use scripts when the single-file restriction doesn't bother me
> and when I may need to quickly edit them on a host which doesn't have the
> Gambas IDE installed.
>
> Regards,
> Tobi
>
> [1] http://gambaswiki.org/wiki/lang/use
>
>
Thank you Tobi, the single-file restriction makes me go for a Command Line
Application.
After one more day of thinking I might slap a gui on it later on, so that
confirms my decision for a CLA.
Thanks again,
/Patrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200322/d24adea8/attachment.html>
More information about the User
mailing list