Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting all environment variables
Message
From
18/03/2005 15:25:50
 
 
To
18/03/2005 11:50:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00996910
Message ID:
00997423
Views:
13
>>That would be easy to write, using ALINES and then parsing each on the = sign. But what's your real need? Is GETENV() not sufficient?
>
>The customer requested something similar to ADIR() to better manipulate the content I guess.

Maybe something like this:
LOCAL laSet[1], laLines[1], lcFile, lcCmd
lcFile = FORCEEXT(ADDBS(SYS(2023)) + SYS(2015),"TXT")
lcCmd = 'SET > "' + m.lcFile + '"'
RUN /N4 &lcCmd
* may need a slight delay here
lnLines = ALINES(laLines, FILETOSTR(m.lcFile))
ERASE (m.lcFile)
DIMENSION laSet[m.lnLines, 2]
FOR lnLine = 1 TO m.lnLines
  lcLine = laLines[m.lnLine]
  laSet[m.lnLine, 1] = GETWORDNUM(m.lcLine, 1, "=")
  laSet[m.lnLine, 2] = GETWORDNUM(m.lcLine, 2, "=")
ENDFOR
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform