Median Joe wrote: ↑Thursday 10th November 2022 2:52pm
BruceSteers wrote: ↑Thursday 10th November 2022 1:04pm
I wrote a script editor in gambas that has a few handy features like...
Hi BruceSteers,
Very impressive! If you add vim bindings I would definitely use it.
I continue to be amazed at Gambas and its capabilities. I tried FreePascal with Lazarus for a while but the Gambas IDE is easier to use and I prefer BASIC syntax to Pascal's.
ew,
, i never got on with vim and use nano
Like i say it's written in gambas and has the KeyPress event so you could probably add any vim bindings you like
And i agree about the other programming environments, i tried a few, all rather complicated, then i found gambas and was amazed at it's simplicity and nice syntax.
PS. to your original question.
There are 2 ways to launch a gambas script created from any editor.
Like Cogier said make the very first line, the "shebang" line, like this...
#!/usr/bin/env gbs3
then set the files executable flag
chmod +x /path/to/my/file.gbs
That file can now either be double clicked to launch or directly run from terminal. the shebang tells it to use gbs3 and it will run because it is executable (on most sytems).
Alternatively you can use gbs3 to run the file without a shebang or being executable.
gbs3 /path/to/my/file.gbs
You can also use various options with the gbs3 command.
gbs3 --help
Compile and execute a Gambas script.
Usage: gbs3 [options][--] [<script file> | <project directory> | - ]
gbs3 --convert-project <input project directory> [<output directory where script is created>]
gbs3 --convert-script <input script> [<output directory where project directory is created>]
gbs3 --plugin <input script> [<output plugin cache directory>]
Options:
-b --buildonly process and compile the script without executing it
-c --nocache force the script compilation (do not check cache)
-e execute the source code provided by the command line ( ':' separator )
-g --debug add debugging information to application
-f --fast use just-in-time compiler
-h --help display this help
-L --license display license
-p --plugin Compile the script, no main, define the class name as script base name entry point _Call(...)
-S --strict fail if 'Public' or 'Sub' are defined without a 'main' function
-t --trace turn on tracing option during execution
-T --terse-listing only print a very terse error report on compile errors
-u --use <components> force component loading ('comp1,comp2...')
-U --unsafe allows jit compiler to generate unsafe faster code
-v --verbose be verbose
-V --version display version
-w --warnings display warnings during compilation
--convert-project convert a simple project to a script
--convert-script convert a simple script to a project
-- stop any further option processing
- read the script from standard input