How can I do this...
BlitzMax Forums/BlitzMax Programming/How can I do this...
| ||
I have a global function called FlushKeys() which is deliberately named to be the same as the one in PolledInput.bmx so that my game uses my version instead. However, if I want to call the one in PolledInput.bmx, instead, how can I do this? The following code doesn't work as PolledInput is not a Type (it works in delphi and I know you can do a namespace thing in C++ so how can it be done in BMax?): PolledInput.FlushKeys() thanks in advance. |
| ||
BRL.polledinput.flushkeys() ? |
| ||
I don't want to sound to happy, but I love you. Thanks :-) |
| ||
I was gunna say just do: BRLFlushKeys()=FlushKeys FlushKeys()=MyFlushKeyFunction then BRLFlushKeys() 'use the original FlushKeys() 'use yours |
| ||
that's an interesting alternative thanks. But actually I wonder if it would work as would the compiler straight away see the FlushKeys in the same file? |
| ||
Wow, that's some cool stuff right there... it's so easy to create your own dialect of Basic on the fly! name$ = Graphics( "What's your name? " ) Cos "Hi, " + name Print Function Graphics$(a$) Return BRL.StandardIO.Input(a$) End Function Function Cos(a$) BRL.StandardIO.Print a$ End Function Function Print() End End Function |
| ||
lol, that's horrible. |
| ||
lol. Grey, it should be okay, you are modifying the function pointer at runtime not compiler time. Give it a try I guess,. |
| ||
Ah I see, thanks. Anyway I already used the BRL. method. |
| ||
rofl - good one WendellM!! |
| ||
Chris, WendellM Stole your secret code! |