PDA

View Full Version : Bug? e_CtrlID and e_MsgId sequence dependent?


TorbenKoch
08-25-2005, 02:56 AM
Setup Factor 7.0.3

Just wondering. This code on an Edit Fields screen On Ctrl Message event:


if (e_CtrlID == CTRL_BUTTON_01) then
Dialog.Message("Test", "CTRL_BUTTON_01", MB_OK, MB_ICONEXCLAMATION);
if (e_MsgId == MSGID_CLICKED) then
Dialog.Message("Test", "MSGID_CLICKED", MB_OK, MB_ICONEXCLAMATION);
end
end

Only shows the first Dialog box. But this code


if (e_MsgId == MSGID_CLICKED) then
Dialog.Message("Test", "MSGID_CLICKED", MB_OK, MB_ICONEXCLAMATION);
end

if (e_CtrlID == CTRL_BUTTON_01) then
Dialog.Message("Test", "CTRL_BUTTON_01", MB_OK, MB_ICONEXCLAMATION);
end

Shows both dialog boxes. Is this a bug? Or what is the reasoning behind this?

This:


if ((e_CtrlID == CTRL_BUTTON_01) and (e_MsgId == MSGID_CLICKED)) then
Dialog.Message("Test", "CTRL_BUTTON_01", MB_OK, MB_ICONEXCLAMATION);
Dialog.Message("Test", "MSGID_CLICKED", MB_OK, MB_ICONEXCLAMATION);
end

Does not show anything. Neither does this:


if (e_MsgId == MSGID_CLICKED) then
Dialog.Message("Test", "MSGID_CLICKED", MB_OK, MB_ICONEXCLAMATION);
if (e_CtrlID == CTRL_BUTTON_01) then
Dialog.Message("Test", "CTRL_BUTTON_01", MB_OK, MB_ICONEXCLAMATION);
end
end

I just don't get it :huh

And just to wrap it up:

if (e_CtrlID == CTRL_BUTTON_01) then
Dialog.Message("Test", "CTRL_BUTTON_01", MB_OK, MB_ICONEXCLAMATION);
end

if (e_MsgId == MSGID_CLICKED) then
Dialog.Message("Test", "MSGID_CLICKED", MB_OK, MB_ICONEXCLAMATION);
end


only shows the first message. That seems pretty weird to me
:huh :huh

csd214
08-25-2005, 04:00 AM
Change “e_MsgId” into “e_MsgID”.

I haven’t tried but I have learned how cumbersome the case sensitiveness in Lua might be (as a Windows user I’m not accustomed with the “details :p ).

TorbenKoch
08-25-2005, 04:38 AM
Ahhh, bloody d... :p

It was that simple, had checked it again and again.

Thank you so very much for that hint!

csd214
08-25-2005, 04:48 AM
It’s so funny when I notice the wrong case in other person’s code. But I don’t find the errors in my own code!

Have a nice day.

Corey
08-25-2005, 05:01 AM
The eternal paradox. :)