GLBasic forum

Feature request => IDE/Syntax => Topic started by: MrTAToad on 2012-Aug-03

Title: GETSUBADDRESS
Post by: MrTAToad on 2012-Aug-03
I notice there is a GETSUBADDRESS function in the header file - but at the moment it isn't recognised by the compiler.  Any chance of making it available, especially if it can be used for assigning PROTOTYPE variables as that way I can simplify getting function addresses...

Would be good if it works with FUNCTIONS and SUBS...
Title: GETSUBADDRESS
Post by: Kitty Hello on 2012-Aug-07
That returns a pointer. It's not really designed for BASIC use. A function "doessubexist" might be useful. For calling subs callbyname can be used. Functions by string is a totally different beast in compiled languages.
Title: Re: GETSUBADDRESS
Post by: MrTAToad on 2012-Aug-07
Thats a shame as it could have saved a lot of code...
Title: Re: GETSUBADDRESS
Post by: bigsofty on 2012-Aug-07
Quote from: MrTAToad on 2012-Aug-03
I notice there is a GETSUBADDRESS function in the header file - but at the moment it isn't recognised by the compiler.  Any chance of making it available, especially if it can be used for assigning PROTOTYPE variables as that way I can simplify getting function addresses...

Would be good if it works with FUNCTIONS and SUBS...

Might have been handy for external C-GLB callbacks too, maybe?
Title: Re: GETSUBADDRESS
Post by: MrTAToad on 2012-Aug-08
Quite possible!
Title: GETSUBADDRESS
Post by: Kitty Hello on 2012-Aug-08
With inline you can use it. Its in the glb.h header.