WinCC c-funktions

hi,
i've got a strang problem with a c-script written for wincc. well, it looks like there is a non-varying maximum for the amount of
commands in a script.
eg: for(x=0;x<1000;x++){printf("%d", x);} runs fine but the same thing coded like this,
x=0; printf("%d", x); x++; printf("%d", x); x++; printf("%d", x); x++; printf("%d", x); x++; printf("%d", x); x++; . . . (1000 times);
produces a general protection fault during runtime.
why?
cu
ibez.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I don't know WinCC, but a general software engineering solution would be to see if one script can call another, and break down your app into multiple, structured scripts. If they're really "scripts", which implies an interpreter, this may not work -- but then again it might. This would certainly be the way to go with a compiler that chokes on long files.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
It may have to do with how the code is optimized as it is translated into machine code. Sometimes the optimizer gets a bit confused. There could also be a problem with how the compiler handles the print buffering.
Michael

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.