this is my sub that i think takes time to read and decode the file and makes me problems
when the file is small it works well but with one of files which is 7kb it won't
i want to wait for this sub to be complete so i used (wait for) this way
i'm confused how to use wait for with this. readEncFile sub returns a string. how can i wait for sub to read and decode whole file
readEncFile:
Sub readEncFile(dirName As String,fileName As String) As String
Dim data() As Byte
Dim Dokumentdatei As RandomAccessFile
Dokumentdatei.Initialize(dirName,fileName,False)
data=Dokumentdatei.ReadB4XObject(0)
Dokumentdatei.Close
data=encr.Decrypt(data,"something")
return bc.StringFromBytes(data,"utf8")
End Sub
i want to wait for this sub to be complete so i used (wait for) this way
something:
Sub getText As ResumableSub
Dim temp As String
wait for (readEncFile(File.DirDefaultExternal,"rest.pol")) complete (temp As String)
Return temp
End Sub
i'm confused how to use wait for with this. readEncFile sub returns a string. how can i wait for sub to read and decode whole file