Getting a String from a Bank

Blitz3D Forums/Blitz3D Programming/Getting a String from a Bank

verfum(Posted 2004) [#1]
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?


Rob Farley(Posted 2004) [#2]
not really, you'll have to just though until you find your terminator my_str=mystr+chr(peekbyte(my_bank,offest))


verfum(Posted 2004) [#3]
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.


Spinduluz(Posted 2004) [#4]
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


verfum(Posted 2004) [#5]
Thx Spindeln.


Spinduluz(Posted 2004) [#6]
np , good luck!