Hello Everyone,
Often times, when I try to reduce a portion of my program down to a size that can be posted,
I figure out what the problem is in the process. This is not one of those times
Consider the following:
It seems that CallBack Function ACom0() is being called for no reason. Does anyone
have any idea what is going on with this? To really see what I mean, uncomment
MsgBox "Device A - Com 0" and run the program.
I have spent the better part of today playing around with this and have gotten no where.
During one experiment I made it so that whenever an option was clicked, that option would
disable itself. An example of what happened: (among several other weird things)
When Device A - Com1 was clicked, Device B - Com 2 would become disabled.
As always, I appreciate any and all help
Wesley
------------------
[This message has been edited by Wesley Brown (edited March 26, 2001).]
Often times, when I try to reduce a portion of my program down to a size that can be posted,
I figure out what the problem is in the process. This is not one of those times

Consider the following:
Code:
'TestProg.bas, PowerBasic/DLL 6.00 'Wesley Brown, March 26, 2001 #Compile Exe #Register None #Include "Win32Api.Inc" 'Define Constants %ACom0 = 100 : %BCom0 = 200 : %CCom0 = 300 : %LCom0 = 400 %ACom1 = 101 : %BCom1 = 201 : %CCom1 = 301 : %LCom1 = 401 %ACom2 = 102 : %BCom2 = 202 : %CCom2 = 302 : %LCom2 = 402 %ACom3 = 103 : %BCom3 = 203 : %CCom3 = 303 : %LCom3 = 403 %ACom4 = 104 : %BCom4 = 204 : %CCom4 = 304 : %LCom4 = 404 %ACom5 = 105 : %BCom5 = 205 : %CCom5 = 305 : %LCom5 = 405 %ACom6 = 106 : %BCom6 = 206 : %CCom6 = 306 : %LCom6 = 406 %ACom7 = 107 : %BCom7 = 207 : %CCom7 = 307 : %LCom7 = 407 %ACom8 = 108 : %BCom8 = 208 : %CCom8 = 308 : %LCom8 = 408 %ACom9 = 109 : %BCom9 = 209 : %CCom9 = 309 : %LCom9 = 409 %AComN = 110 : %BComN = 210 : %CComN = 310 : %LComN = 410 %DevLbl = 500 %Device1 = 510 %Device2 = 511 %Device3 = 512 %DevMag = 520 %DevEZP = 521 %DevEZC = 522 %Quit = 540 '======================================================================================== 'Define Variables (Note: All Variables Are Global) Global ACom As String 'Com Port Connected To Device A Global BCom As String 'Com Port Connected To Device B Global CCom As String 'Com Port Connected To Device C Global hDlg1 As Long Global Result As Long '======================================================================================== CallBack Function AComN() : ACom = "Null" : End Function CallBack Function ACom0() ACom = "Com0" ' MsgBox "Device A - Com 0" End Function CallBack Function ACom1() : ACom = "Com1" : End Function CallBack Function ACom2() : ACom = "Com2" : End Function CallBack Function ACom3() : ACom = "Com3" : End Function CallBack Function ACom4() : ACom = "Com4" : End Function CallBack Function ACom5() : ACom = "Com5" : End Function CallBack Function ACom6() : ACom = "Com6" : End Function CallBack Function ACom7() : ACom = "Com7" : End Function CallBack Function ACom8() : ACom = "Com8" : End Function CallBack Function ACom9() : ACom = "Com9" : End Function '============================================= CallBack Function BComN() : BCom = "Null" : End Function CallBack Function BCom0() : BCom = "Com0" : End Function CallBack Function BCom1() : BCom = "Com1" : End Function CallBack Function BCom2() : BCom = "Com2" : End Function CallBack Function BCom3() : BCom = "Com3" : End Function CallBack Function BCom4() : BCom = "Com4" : End Function CallBack Function BCom5() : BCom = "Com5" : End Function CallBack Function BCom6() : BCom = "Com6" : End Function CallBack Function BCom7() : BCom = "Com7" : End Function CallBack Function BCom8() : BCom = "Com8" : End Function CallBack Function BCom9() : BCom = "Com9" : End Function '============================================= CallBack Function CComN() : CCom = "Null" : End Function CallBack Function CCom0() : CCom = "Com0" : End Function CallBack Function CCom1() : CCom = "Com1" : End Function CallBack Function CCom2() : CCom = "Com2" : End Function CallBack Function CCom3() : CCom = "Com3" : End Function CallBack Function CCom4() : CCom = "Com4" : End Function CallBack Function CCom5() : CCom = "Com5" : End Function CallBack Function CCom6() : CCom = "Com6" : End Function CallBack Function CCom7() : CCom = "Com7" : End Function CallBack Function CCom8() : CCom = "Com8" : End Function CallBack Function CCom9() : CCom = "Com9" : End Function '======================================================================================== CallBack Function Dialog_Callback() : End Function CallBack Function ExitProg() As Long : Dialog End hDlg1, 0 : End Function Function PbMain ACom = "" : BCom = "" : CCom = "" Dialog New 0, "Test Program",,, 300, 150, %Ws_PopUp Or %Ws_Visible Or %Ws_ClipChildren _ Or %Ws_Caption Or %Ws_SysMenu Or %Ws_MinimizeBox, 0 To hDlg1 Control Add Label, hDlg1, %DevLbl, "Device", 15, 19, 25, 13 Control Add Label, hDlg1, %DevMag, "DeviceA", 5, 33, 50, 16 Control Add Label, hDlg1, %DevEZP, "DeviceB", 5, 54, 50, 16 Control Add Label, hDlg1, %DevEZC, "DeviceC", 5, 75, 50, 16 Control Add Label, hDlg1, %LComN, "N/C", 59, 19, 25, 13 Control Add Label, hDlg1, %LCom0, "Com0", 79, 19, 25, 13 Control Add Label, hDlg1, %LCom1, "Com1", 100, 19, 25, 13 Control Add Label, hDlg1, %LCom2, "Com2", 121, 19, 25, 13 Control Add Label, hDlg1, %LCom3, "Com3", 142, 19, 25, 13 Control Add Label, hDlg1, %LCom4, "Com4", 163, 19, 25, 13 Control Add Label, hDlg1, %LCom5, "Com5", 184, 19, 25, 13 Control Add Label, hDlg1, %LCom6, "Com6", 205, 19, 25, 13 Control Add Label, hDlg1, %LCom7, "Com7", 226, 19, 25, 13 Control Add Label, hDlg1, %LCom8, "Com8", 247, 19, 25, 13 Control Add Label, hDlg1, %LCom9, "Com9", 268, 19, 25, 13 Control Add Option, hDlg1, %AComN, "", 62, 32, 10, 10, %Ws_Group Call AComN Control Add Option, hDlg1, %ACom0, "", 83, 32, 10, 10 Call ACom0 Control Add Option, hDlg1, %ACom1, "", 104, 32, 10, 10 Call ACom1 Control Add Option, hDlg1, %ACom2, "", 125, 32, 10, 10 Call ACom2 Control Add Option, hDlg1, %ACom3, "", 146, 32, 10, 10 Call ACom3 Control Add Option, hDlg1, %ACom4, "", 167, 32, 10, 10 Call ACom4 Control Add Option, hDlg1, %ACom5, "", 188, 32, 10, 10 Call ACom5 Control Add Option, hDlg1, %ACom6, "", 209, 32, 10, 10 Call ACom6 Control Add Option, hDlg1, %ACom7, "", 230, 32, 10, 10 Call ACom7 Control Add Option, hDlg1, %ACom8, "", 251, 32, 10, 10 Call ACom8 Control Add Option, hDlg1, %ACom9, "", 272, 32, 10, 10 Call ACom9 Control Add Option, hDlg1, %BComN, "", 62, 53, 10, 10, %Ws_Group Call BComN Control Add Option, hDlg1, %BCom0, "", 83, 53, 10, 10 Call BCom0 Control Add Option, hDlg1, %BCom1, "", 104, 53, 10, 10 Call BCom1 Control Add Option, hDlg1, %BCom2, "", 125, 53, 10, 10 Call BCom2 Control Add Option, hDlg1, %BCom3, "", 146, 53, 10, 10 Call BCom3 Control Add Option, hDlg1, %BCom4, "", 167, 53, 10, 10 Call BCom4 Control Add Option, hDlg1, %BCom5, "", 188, 53, 10, 10 Call BCom5 Control Add Option, hDlg1, %BCom6, "", 209, 53, 10, 10 Call BCom6 Control Add Option, hDlg1, %BCom7, "", 230, 53, 10, 10 Call BCom7 Control Add Option, hDlg1, %BCom8, "", 251, 53, 10, 10 Call BCom8 Control Add Option, hDlg1, %BCom9, "", 272, 53, 10, 10 Call BCom9 Control Add Option, hDlg1, %CComN, "", 62, 74, 10, 10, %Ws_Group Call CComN Control Add Option, hDlg1, %CCom0, "", 83, 74, 10, 10 Call CCom0 Control Add Option, hDlg1, %CCom1, "", 104, 74, 10, 10 Call CCom1 Control Add Option, hDlg1, %CCom2, "", 125, 74, 10, 10 Call CCom2 Control Add Option, hDlg1, %CCom3, "", 146, 74, 10, 10 Call CCom3 Control Add Option, hDlg1, %CCom4, "", 167, 74, 10, 10 Call CCom4 Control Add Option, hDlg1, %CCom5, "", 188, 74, 10, 10 Call CCom5 Control Add Option, hDlg1, %CCom6, "", 209, 74, 10, 10 Call CCom6 Control Add Option, hDlg1, %CCom7, "", 230, 74, 10, 10 Call CCom7 Control Add Option, hDlg1, %CCom8, "", 251, 74, 10, 10 Call CCom8 Control Add Option, hDlg1, %CCom9, "", 272, 74, 10, 10 Call CCom9 Control Add Button, hDlg1, %Quit, "Exit", 125, 120, 50, 14, Call ExitProg Dialog Show Modal hDlg1, Call Dialog_Callback To Result End Function
have any idea what is going on with this? To really see what I mean, uncomment
MsgBox "Device A - Com 0" and run the program.
I have spent the better part of today playing around with this and have gotten no where.
During one experiment I made it so that whenever an option was clicked, that option would
disable itself. An example of what happened: (among several other weird things)
When Device A - Com1 was clicked, Device B - Com 2 would become disabled.
As always, I appreciate any and all help

Wesley
------------------
[This message has been edited by Wesley Brown (edited March 26, 2001).]
Comment