We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › draw window won't open
Page Index Toggle Pages: 1
draw window won't open (Read 599 times)
draw window won't open
Apr 18th, 2008, 2:40am
 
I'm relatively new to programming and brand new to Processing but here goes. I'm not sure if this is a bug or what but simply put here is my problem:
I have this extremely simple program

Code:

void setup()
{
size(600,600);
fill(255);
background(0);
}
void draw()
{
rect(200,200,200,200);
exit();
}

As you can see it simply opened the draw window, drew a white square in the center and stopped. That's it.

My problem is, this USED to run, open the draw window, do its thing and stop. Now it just runs without opening the draw window.

I have had issues with Processing taking a while to open the draw window so I let it sit and see what happened. And nothing.

As I said I'm a new, but I try my best to solve my problems before posting so any help is greatly appreciated even if it only points me in the direction of the solution.

Thanks in advance,
AP
Re: draw window won't open
Reply #1 - Apr 18th, 2008, 5:21pm
 
I tried running this on another computer and there is no problem at all.

On the computer that has the issue I am also receiving an error:

expected IDENT, found ','

which pops up and highlights the rect() function where there is no syntax error. I realize this must be a bug with my installation. I have tried redownloading Processing with and without Java and still the same results.

Any ideas?
Re: draw window won't open
Reply #2 - Apr 18th, 2008, 5:50pm
 
Try this:

Code:


void setup()
{
size(600,600,P3D);
fill(255);
background(0);
}
void draw()
{
rect(200,200,200,200);
noLoop();
//exit();


}



Is there a reason you wanted exit() in there?
Re: draw window won't open
Reply #3 - Apr 19th, 2008, 1:55am
 
Works now. Thank you.

I was using exit() to end a loop which was not evident in my simplified version I was troubleshooting with and subsequently posted.

Thank you again. I have quite a bit of reference reading ahead of me it looks like Smiley
Re: draw window won't open
Reply #4 - Apr 19th, 2008, 10:39am
 
To end a loop early you need "break;" "exit();" makes the sketch quit.
Page Index Toggle Pages: 1