sub appstart addevent("button1","Click","ev") addevent("form1","MouseUp","ev") addevent("timer1","Tick","ev") end sub
sub ev
end sub
when "ev" called i may get name of control with keyword SENDER but how can i get what EVENT called this sub?
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
no,you dont understand me=)
for example i have 100 controls...and i must add 100 subs?
but this problem i have?when i create plugins for my program with Scripting dll
plugins can arr objects to program but now i want add events for this objects,and code of this events in plugin.
my first example shows exactly the problem
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
i think about it,but in program used all(maybe not all but many) controls and objects from any dlls and i must create very many subs includes all events...
it is not good too...
and most importantly it is unnecessary, it may be sufficient to know what event
maybe it's real with door dll and object "event"?
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
No, it is not possible. It would need a modification to Basic4ppc to save the event name as well as the sender name. Presently the event name is lost once the event sub has been identified by the Basic4ppc event code.
Surely there are not that many events you need, and surely it is better to have small individual event Subs handling each type of event rather than one huge Sub with lots of conditional tests inside it trying to handle all the possible event types!
EDIT:- Remember that you don't need a different event sub for each control or object, only different ones for each individual event name. You can hide them in a module!
thanks you agraham. it is not good but it better then nothing
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Also notice that the event sub must match the number of arguments. So the event sub of a MouseUp event should have two parameters (and you can't use the same sub for the Click event).
thanks erel, but it was example and in my app some events not been used(mouseup,mousedown,mousemove,keypress).
but what you say about add new keyword in basic in latest version? =)
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;