Re: Changing the ENV
Posted in 1995
robert, basically, the problem is in the run statement. executing RUN spawns a child process which inherits the parents environment. the ROBS_ENV=hello is then set and exported within that shell and control is returned to the parent process (the 4gl prog). the parent has no clue of what the child process did to the environment. you may want to write a custom runner that has a routine such as 4gl_putenv(variable,value). since it is part of the runner/4gl program, it gets around the parent/child environment problem. > > For all who are curious, how do you alter the environment while running > a 4gl program? I've tried this: > > MAIN > DEFINE arg_str CHAR(20) > LET arg_str = fgl_getenv("ROBS_ENV") > DISPLAY "arg_str = ", arg_str CLIPPED > RUN "ROBS_ENV=hello ; export ROBS_ENV" > LET arg_str = fgl_getenv("ROBS_ENV") > DISPLAY "arg_str = ", arg_str CLIPPED > END MAIN > > and both displays are blank. Any clues? > > Robert Minter Data Systems Support \\\\\\_/// > Senior Software Engineer A Client Technologies Company ( _ _ ) > E-Mail: rob@dssmktg.com Tel: 714.771.0454 (| ^ |) > #include <disclaimer.h> Fax: 714.771.3028 \\`-'/ > De Colores - Emmaus OC-13 SURF'S UP \\_/ > -- regards, +----------------------------------------------------------------------------+ | . . | Bob Baskett | | ... ... | Software Engineer | | ..... ..... | Business Systems Integration Group | | .. ... .. | Semiconductor Products Sector | | . . . | Mesa, AZ | | | President, Informix Users Group Of Arizona | | Motorola, Inc. | | +----------------------------------------------------------------------------+ | Sun 690MP 4.1.3, Online 5.01, 4.10.UD1 Tools, Fourgen v4.10.UC1 | +----------------------------------------------------------------------------+