Error 3353 - Structure too complex
Keywords: Error 3353 - Nesting of Structure too complex
Question:
I am using the following code to choose which application to run:;=========================================== ButtonPushed=Dialog("XcelleNet") if buttonpushed == 2 then goto Quit if RADIO == 1 Run ("c:\nodesys\nodecomm.exe", "") else Run ("c:\nodesys\winauto.exe", "-d 3 1") endif :Run_Session if AppExist("winauto.exe") == @TRUE timedelay(15) goto Run_Session endif :Done if RADIO == 2 WinActivate("IBM") sendkeysto("IBM","!{F4}y") Run ("c:\nodesys\nodecomm.exe", "") endif :QuitIn certain undocumented times I get the following error:3353 Nesting of structures too complex "if AppExist("winauto.exe") == @TRUE"Any ideas why?Answer:
It's those goto's. They are naughty. Read about them in the manual.Take out the "goto Run_Session" in your if/endif loop. Try...
;============================================== ButtonPushed=Dialog("XcelleNet") if buttonpushed == 2 then goto Quit if RADIO == 1 Run ("c:\nodesys\nodecomm.exe", "") else Run ("c:\nodesys\winauto.exe", "-d 3 1") endif :Run_Session while AppExist("winauto.exe") == @TRUE timedelay(15) endwhile :Done if RADIO == 2 WinActivate("IBM") sendkeysto("IBM","!{F4}y") Run ("c:\nodesys\nodecomm.exe", "") endif :QuitAlso see the following tech supt web page for more details:Nesting of Structures Too Complex or Deep
Related Question:
I have what I think to be a simple if..then statement and when I run the script I get ERROR 3353: STRUCT ERROR NESTING OF STRUCTURE IS TOO COMPLEX. Here is a sample of the code:;======================================================= :wait4child1 name = char2num("Wait (Cancel to halt)") char = wingetactive() active = char2num("%char%") if name == active then sendkey("~") else gosub wait4child1 returnThe script waits for a program to finish processing. When the program is finished it displays a message box with the title "Wait (Cancel to halt)". So I store the name of the box in a variable and then convert it to a number so that I can compare it to the real thing when the message box is displayed.Why am I getting this error??? Thanks in advance for any help.
Answer:
- The big problem is the gosub. So it works once. Then the entire loop is GOSUB'ed again, but no return. One structure level is used up. Then again, and another level is used up.
- The if/else does not have an endif. Mayhaps you are getting confused betwixt the single line if/else and the multiline if/else/endif.
- Since you posted the code, and it was real short, I re-wrote it for you. See below:
ORIGINAL CODE:
:wait4child1 name = char2num("Wait (Cancel to halt)") char = wingetactive() active = char2num("%char%") if name == active then sendkey("~") else gosub wait4child1 returnMODIFIED VERSION::wait4child1 while 1 name = char2num("Wait (Cancel to halt)") char = wingetactive() active = char2num(char) if name != active then continue sendkey("~") break return
Article ID: W12970Filename: Error 3353 Structure Too Complex.txt