[fpc-devel] enumerating environment variables

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Sat Dec 11 12:00:26 CET 2004



On Fri, 10 Dec 2004, Vincent Snijders wrote:

> Hi,
> 
> Is it true that in fpc 2.0 the dos unit will be considered obsolete, and 
> people are advised to use for example the sysutils unit?

It is true.

> If true, how can I enumerate the environment variables like I do with 
> the dos unit using EnvCount and EnvStr from the dos unit.

You currently can not. Most platforms have the envp() pointer available, but
this is of course not very user friendly. I have added the

Function EnvironmentVariableCount() : Integer;
Function GetEnvironmentString(Index : Integer) : String;

functions to sysutils. (still needs committing, should be there shortly)

Michael.




More information about the fpc-devel mailing list