WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Error Codes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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

:Quit
In 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

:Quit
Also 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
return

The 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:

  1. 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.

  2. 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.

  3. 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
    return
    
    MODIFIED 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:   W12970
    
    Filename:   Error 3353 Structure Too Complex.txt
    File Created: 2017:08:29:11:48:30
    Last Updated: 2017:08:29:11:48:30