Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    7

    Unanswered: How to set the env variable from the 4gl program.

    Hi All,

    LET hT = FGL_GETENV("HOSTNAME")
    Using above statement we can able to get env variable into 4gl prgs.
    I need to set the env variable through the 4gl prg.

    I tried the following, it does n't work.
    CALL FGL_SETENV("HOSTNAME",ht)

    Thanks
    Sarwan.

  2. #2
    Join Date
    Jan 2011
    Posts
    2
    Hi sarwan,
    i've the same problem with you.
    i know from another forum that we can use fgl_setenv() to set environment
    inside 4gl file. but while trying to use it, it's error while compiling the
    program.
    do you have any suggestion to solve it?
    thank you

  3. #3
    Join Date
    Jun 2009
    Location
    Lisboa, Portugal
    Posts
    78
    Hi there,

    I presume you are using Linux or Unix environment. So you should set one environment variable like this:

    ->MACHINE=`hostname`

    it is better to export the variable for using in sub-shells:

    ->export MACHINE

    Then, on your 4GL program you should define a variable like:

    define maq char(20)

    On your function use code:

    LET maq = FGL_GETENV("MACHINE")

    Your variable maq will have the name of your machine, that you can use in the program.

    Hope it helps, bye,

    Luís.
    LS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •