databuffer help

Monkey Forums/Monkey Programming/databuffer help

pantson(Posted 2013) [#1]
Hi

Having a few issues with databuffer in HTML5 and chrome/firefox
I've not compiled in anything else yet.

Error:
d:/dev/bin/monkeypro/modules/brl/databuffer.monkey<126>
d:/dev/test/test.monkey<45>


Line 45 of my code:
buf = DataBuffer.Load("monkey://data/test.bin")

The file exists in the data folder, but the error suggests it doenst
Has anyone else managed to load binary data using databuffers?
I've also tried using a datastream and databuffer, but i get the same error.

i have loaded the binary data using LoadString and then reading the string array, but the data seems corrupted. Is this because its trying to convert it to a readable string?

The next question is.. can I do the above command in the OnCreate method?


AdamRedwoods(Posted 2013) [#2]
You cant load binary data with LoadString.

As for your error, what kind of error is it? Which monkey version are you using? In monkey v66 the native html5 dataview class is used, which isnt available on all browsers. In v67 i thnk it reverts back to a more compatible class so i would use that.

Also check that the .bin is copied into the compiled build folder.


MikeHart(Posted 2013) [#3]
as your path prefix suggested that you want to load it from the data folder, why don't you try this?
buf = DataBuffer.Load("test.bin")



pantson(Posted 2013) [#4]
Good questions..
1) I'm using v66 on chrome and Firefox. I will upgrade to v66 and try
2) the file is there in my data folder in the html5 dir
3) If I remove the path part then buf is null as the file cannot be found

I'll upgrade and let you know

Many thanks


pantson(Posted 2013) [#5]
V67 fixes the issue... Many thanks.