Forgive my LONG delay in getting to the answers both Lon and MK posted.Lon: thanks for answering this, but I phrased my original question poorly.
From my original post:
----------------------
($x$a) = Function()
($x$a)= $situation1
? "First is: " $situation1
And have it return "reallystupid"
----------------------
** but somehow keeping the value somewhere of Function(). Well I guess it's impossible.
But if anyone has ideas...
If it's any consolation, MK, I expanded a little on the code you posted, and came up with something that does produce a list that you can then present as a menu choice (so the user can choose the directory they want). If you then expand on that, perhaps you can share the code and how you used it. Thanks to all!
-Harold
---------------------------------------------
cls
break on
$workdir = C:\tester
$listfile = C:\tester\DOIT.HLP
$composite = C:\tester\dirbuild.txt
if exist("$workdir\nul") goto "SUB1" endif
shell "%comspec% /c mkdir $workdir"
:sub1
if exist($composite) del "$composite" endif
if exist($listfile) del "$listfile" endif
shell "%comspec% /c dir C:\ /ad /b > $listfile"
color Y/n
cls
? "Starting ... "
$o1 = open(1,"$composite",5)
$o2 = open(2,"$listfile")
$cntr = 0
while @error = 0
$cntr = $cntr + 1
$tmpary = readline(2)
$xxx = "$rdln" + $cntr
? "XXX equals: " + $xxx
? "Array variable is: " + $xxx
? "Line #" + $cntr + " contains: " + $tmpary
if $tmpary > 0
writeline(1, " $cntr. $tmpary" + chr(10) + chr(13))
endif
loop
close(2)
color G+/n
cls
? "-------------------------------------"
? "Choose from the list: "
? "-------------------------------------"
? "Here you would display a file and do a get..."
? "Look at the file in a shell using more<c:\tester\dirbuild.txt"
? "(notepad can't handle the extended characters)."