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 › set frameCount variable
Page Index Toggle Pages: 1
set frameCount variable (Read 945 times)
set frameCount variable
Sep 27th, 2005, 2:37pm
 
hello

i use claculations with the frameCount variable* to time events. works fine. i'm not sure if it's ok to reset this value even it works, it's not read only?

* if (frameCount%3 == 1){//do something}



thx
Re: set frameCount variable
Reply #1 - Sep 27th, 2005, 4:03pm
 
the frameCount variable should not be reset. it's used internally. we can't make it "read only" unless we hide it or make it only accessible via getFrameCount() or something silly like that.
Re: set frameCount variable
Reply #2 - Sep 28th, 2005, 12:21am
 
You could do a pseudo read-only if there was a private and public value, copy the private value to the public one every time the frame changes.  Not that I think it's necessary.
Re: set frameCount variable
Reply #3 - Sep 28th, 2005, 1:28am
 
i think i'd rather just say "don't mess with it". Wink

also, this sort of thing is often covered in the javadoc reference:
http://dev.processing.org/reference/core/javadoc/processing/core/PApplet.html#frameCount
while it's by no means complete, it actually mentions that frameCount is read-only in this case.
Re: set frameCount variable
Reply #4 - Sep 28th, 2005, 1:53pm
 
don't mess with it
expected that answer Wink
Page Index Toggle Pages: 1