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 › Can't Use Classes Written in a New Tab
Page Index Toggle Pages: 1
Can't Use Classes Written in a New Tab (Read 1181 times)
Can't Use Classes Written in a New Tab
Sep 5th, 2009, 7:35pm
 
For some reason, when I create a class in a new tab, it is not recognized when the sketch is run. I get this error:

Cannot find a class or type named "Cube"

It's an utterly simple sketch. Just a call to create a Cube object. I've copied and pasted the code fromt the Cube class in the 3D>Form>BrickTower example.

Help me understand.  Cheesy
Re: Can't Use Classes Written in a New Tab
Reply #1 - Sep 5th, 2009, 7:43pm
 
cutting and pasting from here:

http://processing.org/learning/3d/bricktower.html

worked fine for me.  Does it work if you do that, instead of using multiple tabs

Oh...and are you using the right constructor syntax  E.g.:
Cube brick;
brick = new Cube(brickWidth, brickHeight, brickDepth);

if this still doesn't troubleshoot it, can you paste the code at http://nopaste.com, please

--Ben
Re: Can't Use Classes Written in a New Tab
Reply #2 - Sep 6th, 2009, 12:41pm
 
Ah! It was my own human error. The preprocessor never made it to the class definition. Wink  Thank you for your help!
Re: Can't Use Classes Written in a New Tab
Reply #3 - Sep 6th, 2009, 1:26pm
 
Oh yeah, that's happened to me too -- a { } miscount or missing ; on the previous tab, and the preprocessor misses the next one.  Should have thought of that, glad you nabbed it.
Page Index Toggle Pages: 1