Post by mmiscool on Sept 3, 2012 15:49:10 GMT -5
Hello,
I was writing a piece of code that I thought was going to be pretty novel and work well but I can't for the life of me figure out why it is throwing the following error message when it hits the return statement.
Any help would be appreciated.
The error message is as follows.
Runtime Error in program 'File Browser Test': return
RETURN without GOSUB
I was writing a piece of code that I thought was going to be pretty novel and work well but I can't for the life of me figure out why it is throwing the following error message when it hits the return statement.
Any help would be appreciated.
The error message is as follows.
Runtime Error in program 'File Browser Test': return
RETURN without GOSUB
api.file.browser.ini.dir$ = ""
GOSUB [API.SMBI.OS.File.Browser]
print api.file.browser.file.curent.dir$
end
[API.SMBI.OS.File.Browser]
api.file.browser.file.search.location$ = DefaultDir$;api.file.browser.ini.dir$
[api.handeler.file.selecotr.select.dir]
cls
files #f, api.file.browser.file.search.location$;api.file.browser.file.curent.dir$;"\*"
#f DATEFORMAT("mm/dd/yy")
'set format of file time to template given
#f TIMEFORMAT("hh:mm:ss")
api.file.browser.file.count = #f rowcount()
dim api.file.browser.file.list$(3, api.file.browser.file.count)
for api.file.browser.loop.no = 1 to api.file.browser.file.count
if #f hasanswer() then
bla$ = #f nextfile$(" ")
api.file.browser.file.list$(1, api.file.browser.loop.no) = #f NAME$()
api.file.browser.file.list$(2, api.file.browser.loop.no) = #f DATE$();" ";#f TIME$()
api.file.browser.file.list$(3, api.file.browser.loop.no) = str$(#f SIZE())
if #f ISDIR() = 1 then
api.file.browser.file.list$(0, api.file.browser.loop.no) = "<img src=""../../../../../../icons/Dir.png""/>"
else
api.file.browser.file.list$(0, api.file.browser.loop.no) = ""
end if
end if
next
Print api.file.browser.file.curent.dir$
Button #bu, " Up Dir ", [api.handeler.file.selecotr.up.dir]
Button #bu, " OPen ", [api.handeler.file.selecotr.open.file]
table #ta, api.file.browser.file.list$()
#ta caption("File Browser")
#ta columnnames("Icon, File Name, Date Last Modified, Size")
#ta link("File Name","[api.handeler.file.selecotr.select.item]")
render #ta
wait
[api.handeler.file.selecotr.open.file]
return
[api.handeler.file.selecotr.select.item]
if instr(upper$(api.file.browser.file.list$(0, RowIndex)), upper$("dir")) > 0 then
api.file.browser.file.curent.dir$ = api.file.browser.file.curent.dir$;"\";api.file.browser.file.list$(1, RowIndex)
api.file.browser.file.curent.dir.level = api.file.browser.file.curent.dir.level + 1
goto [api.handeler.file.selecotr.select.dir]
else
api.file.browser.file.selection$ = api.file.browser.file.search.location$;api.file.browser.file.curent.dir$;"\";api.file.browser.file.list$(1, RowIndex)
goto [api.handeler.file.selecotr.open.file]
end if
return
[api.handeler.file.selecotr.up.dir]
api.file.browser.file.curent.dir.level = api.file.browser.file.curent.dir.level -1
bla$ = ""
for fkljflkjslkjslfsj = 1 to api.file.browser.file.curent.dir.level
bla$ = bla$;"\";WORD$(api.file.browser.file.curent.dir$, fkljflkjslkjslfsj+1 , "\")
next fkljflkjslkjslfsj
api.file.browser.file.curent.dir$ = bla$
goto [api.handeler.file.selecotr.select.dir]