Closing a file accessor object
Feb 10, 2013 18:13:46 GMT -5
Post by richardbaggett on Feb 10, 2013 18:13:46 GMT -5
I'm using the following construct to loop through some files in a directory. It works just fine, but keeps all the files matching the wildcard OPEN, so I can't run my backup routine unless I close the runbasic server. How can I close the accessor or otherwise release the files?
sub totalVends
for idx = 0 to 20
vi$(1,idx) = ""
next
files #vi, "c:\rbp101\data\*.rcp"
while #vi hasAnswer()
#vi nextFile$()
t$ = "c:\rbp101\data\" + #vi NAME$()
open t$ for input as #vdt
while not(eof(#vdt))
input#vdt, qty,ドルdes,ドルprc,ドルext,ドルvnd$
idx = 0
while idx < 21
if vi$(0,idx) = vnd$ then exit while
idx = idx + 1
wend
ttl = val(right$(ext,ドルlen(vnd$)-1))
ttl = ttl + val(right$(vi$(1,idx),len(vi$(1,idx))-1))
vi$(1,idx) = "$"+ using("####.##",ttl)
wend
wend
#vi RESET()
end sub