address in memory of bank

BlitzMax Forums/BlitzMax Programming/address in memory of bank

hi all

is it possable to obtain the address of the bank stored in memory. also is it possable to get the address of a function in memory.

thanks for any help
kev

is this any use?

bank:TBank = CreateBank(1024)
Local pt:TBank Ptr 
Local pt2:TBank Ptr
pt = Varptr bank
Print Int(pt)
pt2 = Varptr bank
Print Int(pt2)


also is it possable to get the address of a function in memory

Use function pointers:

mydisp() = Print()

Shouldn't you use BankBuf(bank)? No need to use `TBank ptr` ??

For function pointers you just define a dummy function pointer variable like:

Local Myfunc()

and then you equate it to a real function with

Myfunc()=Function 'without the brackets

You can then convert the function pointer into a different point using:

Local MyFuncB:Byte Ptr=Byte Ptr(Myfunc)
Local MyFuncI:Int Ptr=Int Ptr(MyFuncB)

Shouldn't you use BankBuf(bank)? No need to use `TBank ptr` ??

Had I known it existed I would have :)

thanks all works fine.

kev