Point type to memmory data.
BlitzPlus Forums/BlitzPlus Programming/Point type to memmory data.
| ||
I creacy.. you all know that ! and for those who dont. I wish to Point a variable.type - > memmory bank so i can read values widout the PeekInt etc etc.. i know this kind of pointing is dangerus.. why else whold i want to do it :) |
| ||
O_o ...uuuuuuuuuuuuuuuhhhhhm... o_O Not *quite* sure what to make of this question, but here's my guess: You have a value stored in a bank and you wish to read out that variable without using peekint|peekshort|peekfloat? If so, make wrapper functions.. like: Function GetVariableX(bank) Return PeekInt(bank,13) ; 13 being the location of your variable.. End Function |
| ||
Hmmm nope.. I was wanting to use type pointer and point the type to the memmory.. like in c++ (Cause of the speed gain for the server computing.) right now i use peekint etc.. even worse i copy strings with a$=a$+chr$(peekbyte()) thats realy low.. like glocalnet. :) |
| ||
B+ doesn't have pointers, closest thing being a pointer in B+ is poke/peek with banks. |
| ||
Types have pointer properties when it comes to passing them, but because of the way they are auto-containered by Blitz, theres no way to make a type/object pointer that points to and already allocated location. Would it be good though lol..We could have: type my_type field v% end type bank%=CreateBank(4); instance.my_type = Object.my_type(CreateBank); But that'll never happen. Your could be better off just using a global dynamic array and redimming it, but then for byte access youd have to shift and & the stuff. Though youd have to copy the data to resize the array, thats what'll happen when resizing a bank anyway. |