On Fri, 03 Jun 2011 17:05:55 -0400, Peter Bratton <> wrote:
|---Quote (Originally by vefatica)---
||Is there a simple way to populate an array with the contents of the environment *without* using a file or the Windows clipboard for temporary storage?
|
|
|Code:
|---------
|v:\> setarray env[50]
|v:\> echo %@execarray[env,set] > NUL
|---------
|An _ENVSIZE variable would be useful.
|---End Quote---
|Thanks Vince. You're right, of course, but without _ENVSIZE, I have to use a file or CLIP: to determine the number of lines in my environment. I could over-estimate its length, but that's a workaround, not a solution.
Here's another workaround.
Code:
v:\> set /a envsize=1 + %@execstr[set /x | echo %@lines[con]]
42
Even an internal/plugin _ENVSIZE would have to plow through the environment and
count the strings.