Author Topic: Accessing system environment variable from Slick-C  (Read 4654 times)

jkwuc89

  • Senior Community Member
  • Posts: 199
  • Hero Points: 6
Accessing system environment variable from Slick-C
« on: April 24, 2008, 02:01:51 pm »
I have a _command definition inside vusrmacs.e where I want to access the value of a system environment variable.  Below is the actual code I am using.  Unfortunately, it does not work.  dir gets set to the string "GISCLUMPDIR" instead of this environment variable's value.  How do I access a system environment variable from within Slick-C?

_command void sandbox() {
    dir = ENV_ARG( "GISCLUMPDIR" )
    messageNwait("GISCLUMPDIR = " :+ dir)
    cdd( dir );
}

hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 285
Re: Accessing system environment variable from Slick-C
« Reply #1 on: April 24, 2008, 02:05:30 pm »
Try get_env( 'GISCLUMPDIR' )
BTW: There is also a set_env( 'GISCLUMPDIR', 'NEW_DIR' );
Good luck, HS2