Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing environmental variable from 4gl

77 views
Skip to first unread message

Phuoc Ho

unread,
Oct 25, 1996, 3:00:00 AM10/25/96
to

I have tried to change DBDATE from within 4gl using:

run "setenv DBDATE Y2MD/"

This did not work. Does anyone know of a work-around?

Thanks in advance

Nils Myklebust

unread,
Oct 26, 1996, 3:00:00 AM10/26/96
to

Phuoc Ho <ax...@freenet.carleton.ca> wrote:

:I have tried to change DBDATE from within 4gl using:

:run "setenv DBDATE Y2MD/"

:This did not work. Does anyone know of a work-around?

:Thanks in advance

Check the FAQ or some other info on www.iiug.org. It's in there
somewhere.


Nils.My...@idg.no
NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway
My opinions are those of my company
The Informix FAQ is at http://www.iiug.org


Billy Wheeler

unread,
Oct 27, 1996, 2:00:00 AM10/27/96
to

> I have tried to change DBDATE from within 4gl using:
>
> run "setenv DBDATE Y2MD/"
>
> This did not work. Does anyone know of a work-around?

Two things:
1. RUN causes a sub-shell to execute, it doesn't set anything in your
current shell.
2. There might be a fgl_setenv() function - I know there is a fgl_getenv()
function.

Why do you want to do this - there might be a better (or different) way of
doing it.

HTH.

--
Ciao,

Billy

+------------------------------------------------------------------------------+
| I used to be indecisive, but now I'm not so sure... |
+------------------------------------------------------------------------------+

Andrej Falout

unread,
Oct 28, 1996, 3:00:00 AM10/28/96
to

Nils ,

PLEASE let me know that you receive my mail(s).

Thanks, Andrej Falout


Mark D. Stock

unread,
Oct 29, 1996, 3:00:00 AM10/29/96
to

Phuoc Ho wrote:
>
> I have tried to change DBDATE from within 4gl using:
>
> run "setenv DBDATE Y2MD/"
>
> This did not work. Does anyone know of a work-around?

True, because RUN initiates a sub-shell, and you can't pass variables back
to a parent shell.

You should not need to do this. If so, then your design is wrong. If you
simply wish to run the same program with two different values of DBDATE,
then use something like a shell script to set the variable and then call
your 4GL program.

Give us more detail on what you are trying to achieve.

Hope this helps,
--

Mark.

+-------------------------------------------------------------------------+
|Mark D. Stock - The West Solutions Group http://www.west.co.za |


| The Informix FAQ is at http://www.iiug.org |

|mailto:ma...@west.co.za +------------------------------------------------+
|Tel: +27 11 803 2151 |If it doesn't work... force it! |
|Fax: +27 11 803 2189 |If it breaks... it needed replacing anyway! |
|Cell: +27 83 250 2325 |Well, that's how I code anyway! |
+------------------------+------------------------------------------------+

Jonathan Leffler

unread,
Oct 29, 1996, 3:00:00 AM10/29/96
to

}From: "Mark D. Stock" <ma...@west.co.za>
}Date: Tue, 29 Oct 1996 14:26:58 -0800
}X-Informix-List-Id: <news.29854>

}
}Phuoc Ho wrote:
}> I have tried to change DBDATE from within 4gl using:
}> run "setenv DBDATE Y2MD/"
}> This did not work. Does anyone know of a work-around?
}
}True, because RUN initiates a sub-shell, and you can't pass variables back
}to a parent shell.
}
}You should not need to do this. If so, then your design is wrong. If you
}simply wish to run the same program with two different values of DBDATE,
}then use something like a shell script to set the variable and then call
}your 4GL program.

Further, even if you manage to get the environment set correctly (it can be
done -- I wrote some code to do that and it is in the CGI stuff that is/was
available from http://www.informix.com) you then start to run foul of the
problem that many of the environment variables used by a program are read
just once, so changes after the program first reads the value have no effect.

Yours,
Jonathan Leffler (jo...@informix.com) #include <disclaimer.h>

0 new messages