On Mon, 09 Feb 2015, VonZorch wrote:
> Is it possible for a compiled program to read instructions from a text file?
> I'm trying to write a program that can have functions added without needing
> to recompile the base program.
> 

Of course you can *read* them (File.Load()). You can also execute certain
types of Gambas source code (a subset of Gambas one-liners) from a string
variable at runtime (Eval()) and you can write, rewrite and execute whole
projects and scripts (Shell "gbx3 ...", Shell "gbs3 ...").

The only difficult thing is if you want to make plugins with this, where by
"plugin" I mean external Gambas classes which interact with your classes in
a single Gambas process. You can achieve a limited form of this without own
effort using Eval() and a Collection where you store the plugin environment.
But as briefly mentioned above, you can only have certain types of one-line
code with Eval(). Suitable if you want to be able to add very simple math
functions, macro abilities or the like to your program (but beware of giving
random text files access to Eval() as it is a gate to each and every public
symbol in your process).

The definitive answer to your question depends on what you didn't tell us
about your goal.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to