[Implemented] Pointers to procedures

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] Pointers to procedures

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.

Hi,

Has pointers to procedures been planned for inclusion in a future version of PB?

No, I do not mean simply getting the address, I mean being able to do something like this:

Code: Select all

*my_function.l(foo.l, bar.w) = @TheRealThing()PrintN(Str(*my_function(1, 2)))

--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)

(Implemented with 'Prototype')
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

> *my_function.l(foo.l, bar.w) = @TheRealThing()
> PrintN(Str(*my_function(1, 2)))

Code: Select all

*my_function.l = @TheRealThing()PrintN(Str( CallFunctionFast(*my_function,1,2) ))
should be enough !?

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by Danilo

Code: Select all

*my_function.l = @TheRealThing()PrintN(Str( CallFunctionFast(*my_function,1,2) ))
should be enough !?
Yes, I guess that would be good enough, thanks :)
Sorry, I didn't even realise this was already part of the PB libraries. I really need to pay more attention.

Thanks.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)
Post Reply