curly
Full Member
Posts: 161
|
Post by curly on Jun 23, 2021 11:04:44 GMT -5
Hi again,
Can a popupmenu be inside an if then/end if conditional block? It keeps telling me there is a syntax error and highlighting the complete popupmenu? I've run out of ideas to try?
Kind regards, David
[PrefillCircuit] ' Circuit description chosen if cctdes$ = "Main Switch" then
POPUPMENU "60947-3 100A", [60947-3-100],_ "60947-3 80A", [60947-3-80],_ "60947-3 63A", [60947-3-63],_ "5419 100A post 1990", [5419-100],_ "5419 60A pre 1990", [5419-60]
[60947-3-100] gosub [AllHyphens] print #DataIn.combobox116, "select "; "100" CCU$(pos,16) = "Main Switch" goto [FinishMainSwitch]
[60947-3-80] gosub [AllHyphens] print #DataIn.combobox116, "select "; "80" CCU$(pos,16) = "Main Switch" goto [FinishMainSwitch60947]
[60947-3-63] gosub [AllHyphens] print #DataIn.combobox116, "select "; "63" CCU$(pos,16) = "Main Switch" goto [FinishMainSwitch60947]
[5419-100] gosub [AllHyphens] print #DataIn.combobox116, "select "; "100" CCU$(pos,16) = "Main Switch" goto [FinishMainSwitch5419]
[5419-60] gosub [AllHyphens] print #DataIn.combobox116, "select "; "60" CCU$(pos,16) = "Main Switch" goto [FinishMainSwitch5419]
[FinishMainSwitch5419] print #DataIn.combobox107, "select "; "Main Switch" CCU$(pos,7) = "Main Switch" print #DataIn.combobox114, "select "; "5419" CCU$(pos,14) = "5419" return
[FinishMainSwitch60947] print #DataIn.combobox107, "select "; "Main Switch" CCU$(pos,7) = "Main Switch" print #DataIn.combobox114, "select "; "60947-3" CCU$(pos,14) = "60947-3" end if return
|
|
|
popupmenu
Jun 23, 2021 11:25:36 GMT -5
via mobile
Post by Rod on Jun 23, 2021 11:25:36 GMT -5
Not at my pc but you need a WAIT after the pop up menu is defined and an END IF then RETURN after that. That way the pop up menu should show if the condition is correct else it will return right away, in your pop up handling code lose the END IF and just return when done.
|
|
|
Post by tsh73 on Jun 23, 2021 12:00:11 GMT -5
It looks like you can't have '-' or spaces in a label name.
|
|
curly
Full Member
Posts: 161
|
Post by curly on Jun 23, 2021 14:00:23 GMT -5
Hi Rod, thank you for your very quick reply. I have attached more of the code, with proposed changes, but it still highlights the whole popupmenu with a syntax error? Combobox 107 selects the description of the way in a fuseboard or consumer unit, wand has the facility to add another if it is not in the basic list. This is just the beginning of preselecting the items that are part of a way or circuit in a fuseboard. A fuseboard or consumer unit ( I don't know what they are called in the US), normally has a 'Main Switch' that turns everything off, and often has an 'RCD Module' toprovide earth fault protection, and also normally has a couple of unused (SPARE) ways. These are just the first three items that I am looking to select. All the proper circuits will follow on when I (or someone else) fixes the current problem? Kind regards, David ps pos is the position in the grand wiring system, from first item to last!
[combobox107DoubleClick] print #DataIn.combobox107,"selection? cctdes$" 'way description CCU$(pos,7) = cctdes$ if cctdes$ = "Not on this list" then gosub [CreateNewCctDes] wait end if CCU$(pos,7) = cctdes$ confirm "Do you want to autofill this circuit?"; con$ if con$ = "yes" then if cctdes$ = "Main Switch" then gosub [PrefillCircuitMainSwitch] end if if cctdes$ = "RCD Module" then gosub [PrefillCircuitRCD] end if if cctdes$ = "SPARE WAY" then gosub [PrefillCircuitSpare] end if end if wait
[PrefillCircuitMainSwitch] ' Circuit description chosen popupmenu "60947-3 100A", [60947-3-100],_ "60947-3 80A", [60947-3-80],_ "60947-3 63A", [60947-3-63],_ "5419 100A post 1990", [5419-100],_ "5419 60A pre 1990", [5419-60] wait
[60947-3-100] gosub [AllHyphens] print #DataIn.combobox116, "select "; "100" CCU$(pos,16) = "100" goto [FinishMainSwitch]
[60947-3-80] gosub [AllHyphens] print #DataIn.combobox116, "select "; "80" CCU$(pos,16) = "80" goto [FinishMainSwitch60947]
[60947-3-63] gosub [AllHyphens] print #DataIn.combobox116, "select "; "63" CCU$(pos,16) = "63" goto [FinishMainSwitch60947]
[5419-100] gosub [AllHyphens] print #DataIn.combobox116, "select "; "100" CCU$(pos,16) = "100" goto [FinishMainSwitch5419]
[5419-60] gosub [AllHyphens] print #DataIn.combobox116, "select "; "60" CCU$(pos,16) = "60" goto [FinishMainSwitch5419]
[FinishMainSwitch5419] print #DataIn.combobox107, "select "; "Main Switch" CCU$(pos,7) = "Main Switch" print #DataIn.combobox114, "select "; "5419" CCU$(pos,14) = "5419" return
[FinishMainSwitch60947] print #DataIn.combobox107, "select "; "Main Switch" CCU$(pos,7) = "Main Switch" print #DataIn.combobox114, "select "; "60947-3" CCU$(pos,14) = "60947-3" return
[PrefillCircuitRCD] popupmenu "61008 100A", [61008-100],_ "61008 80A", [61008-80],_ "61008 63A", [61008-63],_ "4293 100A", [4293-100],_ "4293 80A", [4293-80],_ "4293 63A", [4293-63],_ "4293 60A", [4293-60] wait
[61008-100] gosub [AllHyphens] print #DataIn.combobox116, "select "; "100" CCU$(pos,16) = "100" goto [FinishRCD61008]
[61008-80] gosub [AllHyphens] print #DataIn.combobox116, "select "; "80" CCU$(pos,16) = "80" goto [FinishRCD61008]
[61008-63] gosub [AllHyphens] print #DataIn.combobox116, "select "; "63" CCU$(pos,16) = "63" goto [FinishRCD61008]
[4293-100] gosub [AllHyphens] print #DataIn.combobox116, "select "; "100" CCU$(pos,16) = "100" goto [FinishRCD4293]
[4293-80] gosub [AllHyphens] print #DataIn.combobox116, "select "; "80" CCU$(pos,16) = "80" goto [FinishRCD4293]
[4293-63] gosub [AllHyphens] print #DataIn.combobox116, "select "; "63" CCU$(pos,16) = "63" goto [FinishRCD4293]
[4293-60] gosub [AllHyphens] print #DataIn.combobox116, "select "; "60" CCU$(pos,16) = "60" goto [FinishRCD4293]
[FinishRCD61008] print #DataIn.combobox107, "select "; "RCD Module" CCU$(pos,7) = "RCD Module" print #DataIn.combobox114, "select "; "61008" CCU$(pos,14) = "61008" return
[FinishRCD4293] print #DataIn.combobox107, "select "; "RCD Module" CCU$(pos,7) = "RCD Module" print #DataIn.combobox114, "select "; "4293" CCU$(pos,14) = "4293" return
[PrefillCircuitSpare]
gosub [AllHyphens] print #DataIn.combobox107, "select "; "SPARE WAY" CCU$(pos,7) = "SPARE WAY" return notice "at current end of [PrefillCircuit]" return
|
|
|
Post by tsh73 on Jun 23, 2021 16:40:46 GMT -5
|
|
curly
Full Member
Posts: 161
|
Post by curly on Jun 24, 2021 3:20:11 GMT -5
Thank you Rod and Anatoly, the hyphen does b****r up the labels. I'll carry on now. Kind regards, David
|
|