getenv - unix - fp 5.0.13

Fairlight fairlite at fairlite.com
Tue Mar 9 13:19:57 PST 2004


Confusious (Enrique Arredondo) say:
> HI List,
> 
> Why can't I get the Enviroment variable set when running this processing ?
> 
> Then: system "FLOGO=`/usr/vsifax/bin/flog -a"<2<"`;export FLOGO"
> 
> Then: aa(30,allup)=getenv("FLOGO")
> 
> Then: show"@"<aa

Because of how parent/child inheritance works.  Enviroment variables are
inherited by children from their parents.  The parents may never inherit
from the children.  Children may also never inherit from other children
at the same or lower levels (which would be sub-children in the last case).

In the above, you have the following:

  filepro
     |
     +---- Child 1:  
     |        |
     |        +---- system() setting variable.
     |
     |
  getenv() from parent that cannot see the value set in Child 1.


> When I run the same experiment in the shell and then I use this command :"
> echo $FLOGO " here's what I get:
> 
>    531384 03/09 12:01 2/0 marc chi NORMAL 1223355

When you're running in the shell, you're dealing with one process, not a
child.  You would fail to retreive your contents if you set an environment
variable in filepro and tried reading it back in the shell afterwards
though.

mark->
-- 
Bring the web-enabling power of OneGate to -your- filePro applications today!

Try the live filePro-based, OneGate-enabled demo at the following URL:
               http://www2.onnik.com/~fairlite/flfssindex.html


More information about the Filepro-list mailing list