Hello, I am new to all this, I have the following problem:
I need that from a certain condition fulfilled (A) I can do an operation only once (in this case add 1 point to the counter), and then do another different operation (in this case add 10 points to the counter).
The problem is that I cannot modify a variable that is used in the IF condition.
def A=1;
def counter;
if A==1 {
counter= 1+counter[1];
A=0;
}else{
counter= 10+counter[1];
}
plot prueba= A;
Already assigned: a at 6:1
Value never assigned to a at 6:1
Already assigned: a at 6:1
Value never assigned to a at 6:1
I need that from a certain condition fulfilled (A) I can do an operation only once (in this case add 1 point to the counter), and then do another different operation (in this case add 10 points to the counter).
The problem is that I cannot modify a variable that is used in the IF condition.
def A=1;
def counter;
if A==1 {
counter= 1+counter[1];
A=0;
}else{
counter= 10+counter[1];
}
plot prueba= A;
Already assigned: a at 6:1
Value never assigned to a at 6:1
Already assigned: a at 6:1
Value never assigned to a at 6:1