Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2004-12

enumerating environment variables

10 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vincent Snijders

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?

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

Vincent Snijders.

Reply by email

Unknown author
to Vincent Snijders
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.

Reply by email

Vincent Snijders
to Unknown author
Show quoted text 15 lines
On Fri, 10 Dec 2004, Vincent Snijders wrote: >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)

Thanks. No need to hurry though. I won't be using them before 1.9.6. ;-)

Vincent.

Reply by email

Unknown author
to Unknown author: It is true. You currently can not. Most platforms have the envp() pointer available, but…

Release date for 2.0 ?

Show quoted text 37 lines
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. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Unknown author
to Vincent Snijders: Thanks. No need to hurry though. I won't be using them before 1.9.6. ;-) Vincent.
Vincent Snijders wrote 18 lines
wrote: > > On Fri, 10 Dec 2004, Vincent Snijders wrote: > > >>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) Thanks. No need to hurry though. I won't be using them before 1.9.6. ;-)

No, but I prefer to have them ASAP, they can be tested much longer in that case, on all platforms.

I made a small typo, it's

Function GetEnvironmentVariableCount() : Integer;

The following should compile and run:

program testep;
uses sysutils;
Var
  I : Integer;
begin
  For I:=1 to GetEnvironmentVariableCount do
    Writeln(i:3,' : ',GetEnvironmentString(i));
end.

Michael.

Reply by email

Florian Klaempfl
to Unknown author: Typical Borland statement!
Typical Borland statement!

Borland seems to have a very bad project management :)

If we'd know the time we can spent into fpc every week, I could tell you a date :)

Show quoted text 23 lines
Florian Klaempfl wrote: > wrote: > >> Release date for 2.0 ? > > > > - When it's finished > - asap > ;) > > > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel > > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email