Strangely enough, I found myself trying the very same thing this weekend whilst drinking a couple cold ones up at the cottage.I am trying to create a very simple array where each element contains a string of text from each line of a file. I am first running "shell "%comspec% /c dir /ad /b > d:\doit.hlp"" to spit out a list of directories from which a user can choose one. I want to load each line into one array element, display it, and allow a user to select an element (by number).
Seemingly, I am having troubles with the syntax. So far, I have:
*****************************
open(2, "d:\doit.hlp", 2)
$cntr = 0
while @error = 0
$cntr = $cntr + 1
$tmpary = readline(2)
$xxx = "$rdln" + $cntr
? "XXX equals: " + $xxx <<returns things like $rdln1>>
"$" + "rdln" + $cntr = $tmpary
? "Array variable is:" + $xxx
? "Line #" + $cntr + " contains: " + $tmpary <<returns the desired dir. names>>
loop
close(2)
*****************************
How can I create an array?!? I wanted my array to contain values such as:
$rdln1 = dir1
$rdln2 = dir2
$rdln3 = dir3
Anybody?
TIA,
../mk