Closing a file accessor object

new BookmarkLockedFalling
richardbaggett
New Member
*

richardbaggett Avatar

Posts: 4

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
Last Edit: Feb 12, 2013 16:35:05 GMT -5 by StefanPendl
StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
richardbaggett
New Member
*

richardbaggett Avatar

Posts: 4