"active" and "static" mode on simple code

I have a student who is getting the active and static mode error screen. I retyped the same code into my own computer, and it runs fine. It’s the most basic program, but I’m at a complete loss on how to help. I had her retype it, paste the code I typed, create a new file and paste it in, and uninstall/ reinstall the software. Nothing has worked. She will try on a different computer next, but after that, I’m completely out of ideas. Am I missing something obvious here? I’ve attached my version of her code and a screenshot of her code. They look identical to me, but maybe not… Any help would be appreciated!

size(500,400);
ellipse(200,150,100,50);
rect(200,250,100,50);
rect(250,200,150,100);
rect(300,250,200,150);
rect(350,300,250,200);

1 Like

Hello,

It worked fine here with Processing 3.5.4

Code:

size(500,400);
ellipse(200,150,100,50);
rect(200,250,100,50);
rect(250,200,150,100);
rect(300,250,200,150);
rect(350,300,250,200);

image

1 Like

Interesting. I don’t know.

Parts are red underlined. How come? What does it signify.

Maybe she has a hidden special text sign. like nbsp from HTML

Did she hit ctrl-t ?

1 Like

Do you have a second tab in the project?

1 Like

I’m not sure why she has the underlining on there. I’m assuming there is some sort of spell check software running that has done this, although just hitting that line for some reason.

I thought about the hidden text, which is why I had her retype the code.

I actually didn’t know about ctrl t until reading this, but I will have her try that. Thank you for the amazing tip there.

It’s a relief to see that I’m not missing something obvious. I may try screen sharing with her and have her retype it while I’m watching just to see if I can spot something funny happening.

I can run the code on my computer obviously. Hence it’s hard to debug.

Anyway, static mode is seldom needed and you can as well go to active mode

ctrl-t wouldn’t help really

maybe copy paste her code here…?

1 Like

You may have already tried this, to experiment, but what happens when you comment out the lines with the red underlines? Does the code run?

Of course you have to make adjusts to the x, y positions for the remaining elements so you can see them in the smaller default window size:


//size (500, 400); // b/c of red underline, this line commented out to see if code runs
ellipse(50, 50, 100, 50); // adjusted x, y to be able to see in smaller sketch window
rect(50, 50, 100, 50);
rect(75, 75, 150, 100);
rect(85, 85, 200, 150);
//rect(350, 300, 250,200); // b/c of red underline, this line commented out to see if code runs

@micycle is almost certainly right.

The screenshot show two additional tabs. So the code you are showing us should work in static mode, but the second and third tab probably included something – a function like draw(), or a class definition, et cetera – that can’t be used in static mode.

Keep in mind that when Processing runs all tabs are combined into one document before transpiling.

4 Likes