Cadence SKILL question

Status
Not open for further replies.

fancysky

Newbie level 4
Joined
Dec 22, 2010
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,318
shapeType = "rect"
if ( shapeType == "rect"
then
println( "Shape is a rectangle" )
++rectCount
else
println( "Shape is not a rectangle" )
++miscCount
)

What's mean of lines by red?Thanks.
 

It increments the rectCount variable every time a rect shapeType is passed to the block of code. Every time a shapeType that is not a rect is passed to the block, the variable miscCount is incremented.
 
count++ >> Increments the current value of count after count has been referenced.

++count >> Increments the current value of count before count is referenced.
 
"++rectCount" counts the number of the rect only, and it has no effect on the code,just continue to count,isn't it?
I am beginning to learn SKILL.Maybe it's a silly question,but thanks for your help very much.
 

fancysky,

Skill is very handy scripting language. Go ahead and learn it.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…