|
Post by donnybowers on Jul 1, 2021 0:00:43 GMT -5
I can't for the life of me figure out why I keep getting this error in my [open] routine. I always get the following error message:
width=640 slash$="\" : level=1
dim thisDir$(1)
root$=DefaultDir$+slash$+"public"
thisDir$(1)=root$
cssclass "select", "{width:";str$(int(width*.89));"px; font-size:32px;}"
gosub [getFiles]
[start]
listbox #filer, fils$(),5
print
link #opn, "Open", [open]
print
wait
[open]' I CAN'T SEE ANYTHING WRONG WITH THIS CODE: fileName$ = #opn selection$() print fileName$ wait
end
[getFiles]
this$=thisDir$(level)+"\*.*"
html "<b>Look in: ";thisDir$(level);"</b>"
files #dir, this$
dim fils$(#dir rowcount())
dim d$(#dir rowcount())
dim f$(#dir rowcount())
numFiles = 0 : numDirs=0
while #dir hasAnswer()
#dir nextFile$()
if #dir isdir() then
numDirs = numDirs + 1
d$(numDirs) = "["+#dir name$()+"]"
else
if f$(numFiles+1)<>"Thumbs.db" then
numFiles = numFiles+1
f$(numFiles) = #dir name$()
end if
end if
wend
for i=1 to numDirs
fils$(i)=d$(i)
print fils$(i)
next i
x=numDirs
for i = 1 to numFiles
x=x+1
fils$(x)=f$(i)
next i
dim d$(0)
dim f$(0)
[return]
|
|
|
Post by StefanPendl on Jul 1, 2021 1:16:08 GMT -5
A link does not have any methods. Since you want to get the selected file name, you need to use the handle of the list box:
fileName$ = #filer selection$()
|
|
|
Post by donnybowers on Jul 1, 2021 8:15:15 GMT -5
A link does not have any methods. Since you want to get the selected file name, you need to use the handle of the list box: fileName$ = #filer selection$() Thank you Stefan. My mind must be getting really old. I can't believe I didn't notice that I was trying to get the link to give me the listbox data (slaps self in head).
|
|