I am using ver. 2.1 compiled on 2/16/05
I can get it to execute in isolation, but can't get it to work in anything more elaborate than "hello world"
Here is the specific code, its really not much
function grabFhandle
if isundef(lastHandle) or lastHandle >= 512 then
lastHandle = 1
else
lastHandle += 1
end if
grabFhandle = lastHandle
end function
function fileAttribute(dname)
local fHandle
fHandle = grabFhandle()
a = execute("cmd /c attrib " + dname + " > tempattrib.txt" , -1, pid)
open "tempattrib.txt" for input as fHandle
line input #fHandle, oneline
close #fHandle
fileAttribute = left(oneline, 5)
end function
function test
local fHandle
fHandle = grabFhandle()
a = execute ("cmd /c dir /b > list.txt", -1, pid)
open "list.txt" for input as fHandle
x = 0
line input #fHandle, oneDir
do
dirArray[x, 1] = oneDir
dirArray[x, 2] = fileAttribute(oneDir)
print dirArray[x, 2], "\n"
x = x + 1
line input #fHandle, oneDir
loop until eof(1)
close #fHandle
print "lbound = ", lbound(dirArray), " ubound = ", ubound(dirArray), "\n"
for x=lbound(dirArray[]) to ubound(dirArray[])
print dirArray[x,1]
next
end function
dummy = test()
I can make run just by commenting out line 13
a = execute("cmd /c attrib " + dname + " > tempattrib.txt" , -1, pid)
I had been erroring on line 23 when it was written like this:
a = execute ("dir /b > list.txt", -1, pid)
but then I changed it to
a = execute ("cmd /c dir /b > list.txt", -1, pid)
and it started working