[Gambas-user] any way to set variable macros like C, ?

Fabien Bodard gambas.fr at gmail.com
Thu Jul 19 14:44:27 CEST 2018


You can imagine an external way to hardcode a string.

For example

Set a line like that :

Public Path as string '$PATH


Then make the compilation via a script that replace '$PATH by ="/mypath"

So the var is filled by the value

And the comment way allow you to devellop without alert

Use this var to getthepath.

Another way will be a function that return a value

PUBLIC FUNCTION GetPath ()

Return '$PATH

End

The same way

For use

Open glob.getpath () &/ file





Le jeu. 19 juil. 2018 14:27, PICCORO McKAY Lenz <mckaygerhard at gmail.com> a
écrit :

> umm interesting using environment variable. but unusefully
>
> you guys dont think about the bussines.. no all my programs are "free
> software" so i put hardcoded "things" close to the clients .. due it's
> a client request!
>
> it's a too complex concep that are only available (until now) in JAVA EE
>
> i hope that's enought to clarify the need by me!
>
> and now any way to make those that you said? maybe a inline macro
> definition may help me too!
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
>
> 2018-07-19 3:55 GMT-04:00 Fabien Bodard <gambas.fr at gmail.com>:
> > Why dont you use global variable or if you need an external definition an
> > envirronment variable ?
> >
> >
> > ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> >
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180719/64a180c8/attachment-0001.html>


More information about the User mailing list