O$: Studio 10, getting environment variables

Debra Peters dshaberlanda at yahoo.com
Mon Jun 17 19:21:55 EDT 2019


   Good info.
   Thank you, Doug.

   Deb

   On 6/17/2019 6:16 PM, Doug Easterbrook wrote:

   hi Deb:

   to add to alex???s note???

   if you want to maintain your code the same from studio 5 forward, ?? ??
   ??we have used getenv() on studio 5 for years. ?? ??Works on both Mac
   and windows

   eg:

   for windows to get the users app data directory.

   Calculate iCurrentDirectory as getenv('LOCALAPPDATA???)

   and for mac - to get the users home directory.

   Calculate iCurrentDirectory as getenv('HOME???)

   it means you can write it/test it in studio 5 and then it will work in
   studio 8 and 10

   Doug Easterbrook
   Arts Management Systems Ltd.
   [1]mailto:doug at artsman.com
   [2]http://www.artsman.com
   Phone (403)??650-1978

   On Jun 17, 2019, at 2:39 PM, Alex Clay via omnisdev-en
   <[3]omnisdev-en at lists.omnis-dev.com> wrote:

   Hi Debra,
   Try the built-in getenv() function, which was added since Studio 5:

     Calculate varClientName as getenv("CLIENTNAME")

   Alex

     On Jun 17, 2019, at 16:06, Debra Peters via omnisdev-en
     <[4]omnisdev-en at lists.omnis-dev.com> wrote:
     We are working to migrate from Studio 5 to Studio 10. One of the
     things that does not translate directly is how we are retrieving
     environment variables.
     We use something like the following:
     Register DLL ('kernel32.dll','GetEnvironmentVariableW','JCC')
     Call DLL
     ('kernel32.dll','GetEnvironmentVariableW','CLIENTNAME',varClientName
     ) Returns %%Error
     We retrieve CLIENTNAME, COMPUTERNAME, USERDOMAIN, and a few other
     environment variables
     I've searched the archives and either my Google-foo is lousy
     (definitely a possibility), or the answer isn't there.
     Does anyone know how to get these values from within Studio 10?
     Deb Peters
     --
     KI5BES
     ???Live a good and honorable life, then when you get older and think
     back, you???ll enjoy it a second time.???
     _____________________________________________________________
     Manage your list subscriptions at [5]http://lists.omnis-dev.com
     Start a new message -> [6]mailto:omnisdev-en at lists.omnis-dev.com

   _____________________________________________________________
   Manage your list subscriptions at [7]http://lists.omnis-dev.com
   Start a new message -> [8]mailto:omnisdev-en at lists.omnis-dev.com

--
KI5BES

???Live a good and honorable life, then when you get older and think back, you??
?ll enjoy it a second time.???

References

   1. mailto:doug at artsman.com
   2. http://www.artsman.com/
   3. mailto:omnisdev-en at lists.omnis-dev.com
   4. mailto:omnisdev-en at lists.omnis-dev.com
   5. http://lists.omnis-dev.com/
   6. mailto:omnisdev-en at lists.omnis-dev.com
   7. http://lists.omnis-dev.com/
   8. mailto:omnisdev-en at lists.omnis-dev.com



More information about the omnisdev-en mailing list