Re: [fpc-devel] enumerating environment variables

2004-12-11 Thread Vincent Snijders
[EMAIL PROTECTED] 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. ;-)
Vincent.
___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] enumerating environment variables

2004-12-11 Thread Florian Klaempfl
[EMAIL PROTECTED] wrote:
Release date for 2.0 ?
- When it's finished
- asap
;)
___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] enumerating environment variables

2004-12-11 Thread rstar
Typical Borland statement!
Florian Klaempfl wrote:
[EMAIL PROTECTED] wrote:
Release date for 2.0 ?

- When it's finished
- asap
;)
___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] enumerating environment variables

2004-12-11 Thread Michael . VanCanneyt


On Sat, 11 Dec 2004, Vincent Snijders wrote:

 [EMAIL PROTECTED] 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.

___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Video.CursorX/Y 1-based under UNIX

2004-12-11 Thread Michalis Kamburelis
Hi.
I'm just playing with unit Video and I found some strange thing. It 
looks like a bug in my opinion, but it's so obviously implemented in 
Video unit that I fear that it's some feature :

Under UNIXes CursorX / CursorY are 1-based. While SetCursorPos takes 
0-based parameters on all OSes, and CursorX / CursorY are 0-based on Win32.

Although docs never explicitly say that CursorX and CursorY should be 
0-based, I think that they should be, because
- SetCursorPos takes 0-based params, so obviously CursorX and CursorY 
should follow the same convention,
- under Win32 CursorX and CursorY are 0-based, and rtl/win32/video.pp is 
clearly implemented to keep this assumption.

What's strange is that looking at sources rtl/unix/video.pp, it looks 
like someone intended that behavior, i.e. that CursorX and CursorY are 
1-based.

--
Michalis
___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel