feat.req: More event fields

BlitzMax Forums/BlitzMax Programming/feat.req: More event fields

CS_TBL(Posted 2006) [#1]
..and I'm not talking about a custom modified event.bmx, but about official additions that everyone has.

It would solve quite some problems if there could be more fields, like int fields, float field, double fields, long fields, and not one of each, but several.

like:

event.i1 .. event.i4
event.f1 .. event.f4
event.l1 .. event.l4
event.d1 .. event.d4

Enough purposes for them, perhaps not today because ppl work around them, but once they're there, the usage will grow.

I figure it's a matter of a spare minute for BRL to add :P


Dreamora(Posted 2006) [#2]
And what is their use?

You can simply write a type and put it into event.extra
thats exactly wherefor the extra slot is.

It would take you few seconds to write the type, even less than writting this thread.


CS_TBL(Posted 2006) [#3]
Then why are there fields like .data, .x, .y, .source etc.? They could all've been put into a type, but they aren't. Nothing wrong with just having a few extra fields, no?


Dreamora(Posted 2006) [#4]
They are there because they are used for obvious stuff like x,y for mouse position or source for the source of the event or mods /data for key data and the like.

The field "extra" isn't used internally. Its there for you and me and others if we want to attach additional data to our own types to allow us to attach ANY data we want :)

Main pro of this extra: it is a null reference unless it is used which means only 4 byte overhead. Your idea would take 96byte overhead for something that is not internally used (and thus by most users not used)