On Tue, 16 Jun 2009, Szak�ts Viktor wrote:

Hi,

> How to set an envvar so that it's recognized by
> a subprocess run either by hb_run() or via the
> hb_process*() API?

hb_setenv() but some OS-es may not support such functionality.
Try this code to test it:

   request HB_GT_CGI_DEFAULT
   proc main(x)
      local sName := "ABC", cFile := "./_out_"
      if pcount()==0
         ? "GETENV():", GETENV( sName )
         ? "HB_SETENV():", HB_SETENV( sName, "<newVal>" )
         ? "GETENV():", GETENV( sName )
         ? "============================================="
         hb_run( hb_progname() + " 1" )
         ? "============================================="
         type ( cFile )
         ? "============================================="
         ?
         ferase(cFile)
      else
         ? "GETENV():", GETENV( sName )
         memowrit( cFile, "GETENV(): " + GETENV( sName ) )
      endif
   return

It works in Linux (native), DJGPP (DOSEMU) and MinGW (WINE) builds.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to