Author Topic: GETSUBADDRESS  (Read 3395 times)

MrTAToad

  • Guest
GETSUBADDRESS
« 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...
« Last Edit: 2012-Aug-05 by MrTAToad »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10839
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
GETSUBADDRESS
« Reply #1 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.

MrTAToad

  • Guest
Re: GETSUBADDRESS
« Reply #2 on: 2012-Aug-07 »
Thats a shame as it could have saved a lot of code...

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2788
    • View Profile
Re: GETSUBADDRESS
« Reply #3 on: 2012-Aug-07 »
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?
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

MrTAToad

  • Guest
Re: GETSUBADDRESS
« Reply #4 on: 2012-Aug-08 »
Quite possible!

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10839
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
GETSUBADDRESS
« Reply #5 on: 2012-Aug-08 »
With inline you can use it. Its in the glb.h header.