Updated the gitHub page with first release - it allows you to download just the module or even the sources, if you want.
Link updated in the first post of this thread.
Petr
In case you need to work with environment variables, you might be interested in module named enVar.
It is provided with full source code, unit tests and binaries here:
https://github.com/petrSchreiber/thinBasic_enVar
How to use
Get the DLL from latest release.
Copy the DLL to your thinBasic/Mod directory, you should be able to reference it then like:
Example of the syntax:Uses "EnVar"
Let me know if you need anything to be added.' -- Sets value of MyVariable to MyValue enVar_Set "MyVariable", "MyValue" ' -- Retrieves the value of given variable String s = enVar_Get "MyVariable" ' -- Returns comma separated list of environment variables String s = enVar_List ' -- Returns list of environment variables, separated by user specified string String s = enVar_List(";") ' -- Erases the specified variable enVar_Remove "MyVariable" ' -- Returns non-zero value in case the variable does exist enVar_Exists "MyVariable" ' -- Set a variable with comma separated values envVar_Set "MyCars", "Tesla Model S,Ferrari 512GT" Long nCars = envVar_GetItemCount "MyCars" ' -- Presumes comma, returns 2 nCars = envVar_GetItemCount "MyCars", "," ' -- Separator specified explicitly, returns 2 String firstCar = envVar_GetItem "MyCars", ",", 1 ' -- Returns "Tesla Model S" String secondCar = envVar_GetItem "MyCars", ",", 2 ' -- Returns "Ferrari 512GT"
Petr
Last edited by Petr Schreiber; 12-03-2016 at 20:10.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Updated the gitHub page with first release - it allows you to download just the module or even the sources, if you want.
Link updated in the first post of this thread.
Petr
Last edited by Petr Schreiber; 22-08-2015 at 17:02.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Think the EnVar(iables) could be of more use if there was an Index possible (array of certain variables)
as
EnVar_SetArray "Player", 1, "Petr" EnVar_SetArray "Player", 2, "Eros" '... Long lCurrent = 1 String currentPlayerName = Envar_Get "player", lCurrent String allPlayersNames = Envar_ListArray "player", $CRLF
Last edited by ReneMiner; 23-08-2015 at 17:52.
I think there are missing some Forum-sections as beta-testing and support
Hi Rene,
nice idea. System environment variables do not support arrays, but maybe the module could provide some kind of abstraction over it.
I think the best would be via user defined item separator, what do you think?
Petr
Last edited by Petr Schreiber; 23-08-2015 at 18:14.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
New version of this library is available, download the module here:
https://github.com/petrSchreiber/thi...s/tag/1.9.16.1
I added support for storing and retrieving comma (but even other character) separated values.
Petr
Last edited by Petr Schreiber; 12-03-2016 at 20:11.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
hey thats great, unfortunately my life is not allowing me to get deeper into this. I wish i would have the time and the opportunity to concentrate more on TB- but you know- life is not always playing the cards as one wants it. Currently my place to live is burning but give me two or three months and i will be back in old strength
I think there are missing some Forum-sections as beta-testing and support
Hi Rene,
I wish you that all becomes resolved quickly and how you want it to be. You are our hero, we are looking forward impatiently to have you back!
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Bookmarks