home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 8984 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  2.3 KB

  1. Path: sparky!uunet!wupost!gumby!yale!news.wesleyan.edu!albatross.wcc.wesleyan.edu!hdtodd
  2. Newsgroups: comp.os.msdos.programmer
  3. Subject: Re: Environment variables when using system(...) command
  4. Message-ID: <hdtodd.5.715438861@wccnet.wcc.wesleyan.edu>
  5. From: hdtodd@wccnet.wcc.wesleyan.edu (H. D. Todd)
  6. Date: Wed, 2 Sep 1992 13:01:01 GMT
  7. References: <1992Sep1.194508.10559@sactoh0.sac.ca.us>
  8. Organization: Wesleyan University, Middletown, CT USA
  9. Nntp-Posting-Host: albatross.wcc.wesleyan.edu
  10. Lines: 37
  11.  
  12. In article <1992Sep1.194508.10559@sactoh0.sac.ca.us> sap@sactoh0.sac.ca.us (Stephan A. Puga) writes:
  13. >Subject: Environment variables when using system(...) command
  14. >From: sap@sactoh0.sac.ca.us (Stephan A. Puga)
  15. >Date: Tue, 1 Sep 92 19:45:08 GMT
  16.  
  17. >If an environment variable is set before a program is run and the
  18. >program makes use of the system(...) command, how can I use the
  19. >environment variable in the system command?  I am writing a program
  20. >to be used on a network and there is a variable "username" set
  21. >before the program is run (this variable by the way is very
  22. >important to how WordPerfect 5.1 runs on the network), my program
  23. >invokes WP51 and tries to pass it the username variable, but it
  24. >doesn't work!  Is there no way I can get the new "local" command
  25. >shell to use the same "old" command shell's variables?
  26.  
  27. >-- 
  28. >#############################################################
  29. ># "Its been surreal!"         #     sap@sactoh0.SAC.CA.US   #  
  30. >#     -- Gogo Dodo            # UUCP=..ames!pacbell!sactoh0 #
  31. >#############################################################
  32.  
  33.      You need to set variables in the parent-process environment, but there 
  34. are no DOS int calls to let you do that.  You can trace back through the 
  35. PSP's to find the parent-process environment block, though.
  36.  
  37.      We had the same problem, motivated by WP 5.1 in exactly the same way.
  38. I wrote a program called "envtrim" to trim environment variable names for 
  39. Netware use (specifically for WP).  I have uploaded envtrim.zip to
  40. wsmr-simtel20.army.mil (just yesterday, actually, so it may not be available 
  41. yet).  The distribution package contains the Turbo C source and makefile, 
  42. the .exe file, and a user man page.  I think it'll solve exactly the problem 
  43. you're trying to solve.
  44.  
  45.  
  46.                                            David Tod
  47.                        Wesleyan University
  48.  
  49.