cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
533
Views
0
Helpful
2
Replies

starting value for the counter element is not counter initial ?

vincent.zheng
Level 4
Level 4

Here is the simple program

Vincent901201_1478007238564_78.png

The setting for Counter_01 are : counter initial is 0, type is increment, and step size is 1. The program just output the current counter. So I think the output should be like this:

Prompt: counter right now zero

But actually when the program run, the output is:

Prompt: counter right now one


That means on the first time the counter value is initial + 1 (or -1 if it is decrease) ? Not initial value?

1 Accepted Solution

Accepted Solutions

janinegraves
Spotlight
Spotlight

The counter initializes AND increments the first time. So it exits with

value 1. From then on, it just increments. If you need it to exit with

value 0, then set its InitialValue to -1.

View solution in original post

2 Replies 2

janinegraves
Spotlight
Spotlight

The counter initializes AND increments the first time. So it exits with

value 1. From then on, it just increments. If you need it to exit with

value 0, then set its InitialValue to -1.

Just read the source code for counter.java, it actually works like there... Thanks for the answer