Recent

Author Topic: aprocess.environment  (Read 3350 times)

toby

  • Sr. Member
  • ****
  • Posts: 252
Re: aprocess.environment
« Reply #15 on: July 29, 2019, 12:36:51 am »
dude you are being dishonest here

the discussion has alway been about the child process and not about the parent process that is what aprocess.environment does lol

where are you apolgy for you code comment and for the

for i := -100 to (getenvironmentvariablecount - 1) do writeln('getenvironmentstring(', i, ') : ', getenvironmentstring(i));

simplistic use of env?   lol   you are to dishonest to deal with     i was the one saying what you are now saying  and you said it wasn't true


« Last Edit: July 29, 2019, 12:48:44 am by toby »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: aprocess.environment
« Reply #16 on: July 29, 2019, 01:10:42 am »
You get one apology (and a correction) because DOS.EnvStr() effectively starts form one, despite what the documentation says.

For some reason my previous test was giving correct results even for EnvStr(0). In a new even simpler one it just returns an empty string (as do anything other than [1..EnvCount]).

As for this:

the discussion has alway been about the child process and not about the parent process that is what aprocess.environment does lol

That has been exactly my contention all along! It's now clear that we have been talking at cross-purposes. If you had started by saying: "I am running env with a TProcess to check what the passed environment looks like and ..." we would not have wasted so many electrons.

So let's just leave it here, forget the hot words caused by temper and close the discussion, shall we?
« Last Edit: July 29, 2019, 01:12:32 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

toby

  • Sr. Member
  • ****
  • Posts: 252
Re: aprocess.environment
« Reply #17 on: July 29, 2019, 01:18:07 am »
okay you have been very very helpful - so thanks  even the 'misunderstanding' has been greatly helpful in exploring things and understanding what is capable with the fpc coding :)


but the only way you can use env is in a tprocess ;)


dsiders

  • Hero Member
  • *****
  • Posts: 1084
Re: aprocess.environment
« Reply #18 on: July 29, 2019, 01:20:33 am »
okay you have been very very helpful - so thanks  even the 'misunderstanding' has been greatly helpful in exploring things and understanding what is capable with the fpc coding :)


but the only way you can use env is in a tprocess ;)

Try decaf.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: aprocess.environment
« Reply #19 on: July 29, 2019, 02:02:25 am »
but the only way you can use env is in a tprocess ;)

Or on a terminal. ;D
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

toby

  • Sr. Member
  • ****
  • Posts: 252
Re: aprocess.environment
« Reply #20 on: July 29, 2019, 02:31:33 am »

yea but won't help much in working with aprocess.environment

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: aprocess.environment
« Reply #21 on: July 29, 2019, 09:17:06 am »
You get one apology (and a correction) because DOS.EnvStr() effectively starts form one, despite what the documentation says.
That should probably be reported then... (especially as the example in the documentation starts at 1 ;) )

 

TinyPortal © 2005-2018