Hello,
there seems to be a problem at using a random file access and LoadPicture on the same file:
fn(0) = "C:\Tmp\Holz.jpg"
fn(1) = "C:\Tmp\Kies.jpg"
fn(2) = "C:\Tmp\Holz.jpg" ' fn(2) equals fn(0)!
For k = 0 To 2
FileOpen (c1,fn(k),cRandom)
b = FileGetByte (c1,0)
FileClose (c1)
Image1.LoadPicture (fn(k))
Image1.Refresh
Sleep(1000)
Next k
At k = 2 (fn(0) = fn(2) !) the error "Can not access file because of usage by another process" occurs.
There is no error if you delete the either the FileOpen or the LoadPicture part.
How to solve this problem?
Horst
View attachment Test.sbp
View attachment 6289
View attachment 6290
there seems to be a problem at using a random file access and LoadPicture on the same file:
fn(0) = "C:\Tmp\Holz.jpg"
fn(1) = "C:\Tmp\Kies.jpg"
fn(2) = "C:\Tmp\Holz.jpg" ' fn(2) equals fn(0)!
For k = 0 To 2
FileOpen (c1,fn(k),cRandom)
b = FileGetByte (c1,0)
FileClose (c1)
Image1.LoadPicture (fn(k))
Image1.Refresh
Sleep(1000)
Next k
At k = 2 (fn(0) = fn(2) !) the error "Can not access file because of usage by another process" occurs.
There is no error if you delete the either the FileOpen or the LoadPicture part.
How to solve this problem?
Horst
View attachment Test.sbp
View attachment 6289
View attachment 6290