Getting a String from a Bank
Blitz3D Forums/Blitz3D Programming/Getting a String from a Bank
| ||
Is there an easy way to get a String that is stored in a Bank? I am receiving a large amount of data from a dll into blitz via a Bank. I can extract integer data and float data ok, but I can't extract a string (easily). What I want to do is something like this .. my_str$ = PeekString(my_bank, offset) This would read from offset to a null-terminator. I have got around this by using PeekByte and converting it to an ascii char and then concatenating them all together. This seems a bit contrived. Any better suggestions? |
| ||
not really, you'll have to just though until you find your terminator my_str=mystr+chr(peekbyte(my_bank,offest)) |
| ||
Yeah, that's how I'm doing it. It would be really useful to be able to copy an instance of a user-defined type to a bank. Rather than having to poke each value individually. |
| ||
Check my homemade userlib for bankhandling (perhaps it might help you). Just download and check the code, it's written in C but all you have to do is to typecast it to use it in C++ (I think :)) here |
| ||
Thx Spindeln. |
| ||
np , good luck! |