Thank you Przemek. It also works with MSVC and BCC.

I'd like to use this to enable support in hbmk2 to use more
embedded compilers (all other free ones need envvars to
setup their locations, like djgpp, watcom, pocc), and hbmk2
uses hb_process*() API on non-dos platforms to call these
tool.
I can of course revert to use hb_run() in such cases, but
this means readding command line limitations implied by
shell.

Is there any way to use similar technique with hb_process*() API?

Brgds,
Viktor

On Tue, Jun 16, 2009 at 8:35 AM, Przemyslaw Czerpak<dru...@acn.waw.pl> wrote:
> 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
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
>
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to