If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > How to set the env variable from the 4gl program.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-13-07, 08:40
sarwan sarwan is offline
Registered User
 
Join Date: Jun 2006
Posts: 7
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.
Reply With Quote
  #2 (permalink)  
Old 01-10-11, 01:27
dsy dsy is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 01-22-11, 18:35
Luis Santos Luis Santos is offline
Registered User
 
Join Date: Jun 2009
Location: Lisboa, Portugal
Posts: 51
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On