is it possable to dump banks to text area gadget?

BlitzPlus Forums/BlitzPlus Programming/is it possable to dump banks to text area gadget?

Kev(Posted 2004) [#1]
is this possable? im thinking that it could be possable using SendMessage, with the bank as the item's structure?

anyone tryed?

thanks
kev


Kevin_(Posted 2004) [#2]
Shouldnt be too difficult to do. Just read the bank by taking each byte as its ascii value to build up a string. Then just use SetTextAreaText with this new string.

Regards


Kev(Posted 2004) [#3]
Prof, im using that methord atm. but the large amount data makes the process a little slow, im looking for ways of optimizing the adding of the string.

kev


Kevin_(Posted 2004) [#4]
The only other way I can think of is to use PeekInt instead of PeekByte. This will speed things up. You will then have to take this Integer and interpret the byte values from it. For example...

To get the value of the first byte from the Integer you read, simply use the AND operator with a mask of....

00000000 00000000 00000000 11111111

To get the second byte use...

00000000 00000000 11111111 00000000

Please bare in mind though that if you over-run the banks boundry you'll get an error. So keep a check on your PeekInt position to make sure there is always at least 4 bytes before then end. Just use PeekByte if there are 1,2 or 3 bytes left.

Thats how I would speed things up anyway. Maybe someone else has a better solution.

Regards


TeraBit(Posted 2004) [#5]
This thread should help...

http://www.blitzbasic.com/Community/posts.php?topic=28947


Kev(Posted 2004) [#6]
cheers
kev