Hi there
I am trying the code below, discussed in this article: https://www.cloudsavvyit.com/9852/web-apps-can-interact-with-your-filesystem-now/
I am stuck here in the for await clause
The directoryHandle.values() when assigned to a BANanoObject returns and Iterator with next(), calling next returns an item, however I dont know how to loop through the rest.
Try out:
I have tried a do until loop checking the IsNull and IsUndefined of the item read by next(), also
Thanks
I am trying the code below, discussed in this article: https://www.cloudsavvyit.com/9852/web-apps-can-interact-with-your-filesystem-now/
I am stuck here in the for await clause
The directoryHandle.values() when assigned to a BANanoObject returns and Iterator with next(), calling next returns an item, however I dont know how to loop through the rest.
B4X:
const directoryHandle = window.showDirectoryPicker();
for await (let handle of directoryHandle.values()) {
if (handle.type === "file") {
// file
}
if (handle.type === "directory") {
// subdirectory
}
}
Try out:
B4X:
Dim values As BANanoObject = BANano.Await(dh.dirHandle.RunMethod("values", Null))
Log(values)
Dim item As BANanoObject = BANano.Await(values.RunMethod("next", Null))
Log(item)
I have tried a do until loop checking the IsNull and IsUndefined of the item read by next(), also
Thanks