Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting all environment variables
Message
De
18/03/2005 15:25:50
 
 
À
18/03/2005 11:50:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00996910
Message ID:
00997423
Vues:
11
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform