Re: shortcut function calls in bgt

Going to derail the topic and say that C/C++ make this much easier. C:

void func() {
}
// call function
call_callback(&func);

Literally that's all you do. You can store functions in arrays, but you should use a typedef (otherwise your code looks ugly). So something like

typedef (void *function)();

Can then be made into a function pointer like this

void call_callback(function fnc) {
fnc();
}

Looks ugly, but its used all around the world for things like callbacks. .And you can store them in arrays too.
Like BGT though, you can't store a function name in a C string and then call it (I don't think). I've never seen it done, IMO, so it may not be possible. If its possible then its probably incredibly disgusting.
I think its possible in Python, not sure how though.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Liam via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Liam via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Liam via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : thggamer via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : thggamer via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : thggamer via Audiogames-reflector

Reply via email to