Hi,
We are working on verion 7.1. I have a question like - Is it not possible to set a value for a Stage Variable in another Stage Variable ?
Ok, here is my scenario. I have 2 Stage Variables. One has an 'If' condition in it and another has a 'counter' expression in it. So, I would need to increment the counter for each record. But when a particular condition occurs, I would need to reset the value of counter back to '0'. Let me show using the real case how it looks -
Stage Variable ----------> Expression
--------------------------------------------
sv1 -----------------------> If <condition> Then <expression1> Else sv2=0
sv2 -----------------------> sv2+1
This is kind of logic that I'm using. The expression after the 'Else' clause does not seem to work. Even when the given condition is untrue, the sv2 is not set to '0'. It keeps on incrementing by '1' for every record.
Is this a kind of fuctionality that is not supported by DS? Is is not possible to assign a value to a Stage Variable from another Stage Variable?
Thanks.
Possibility to set value for a StageVariable in another SV?
Moderators: chulett, rschirm, roy
No. Stage variables are assignment operations.
Simply just rewrite your stage variables to work accordingly.
Code: Select all
sv = (if <condition> then <result1> else <result2>)
Code: Select all
sv0 = <condition>
sv1 = (if sv0 then <expression1> else sv1)
sv2 = (if sv0 then sv2+1 else 1)
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
The way you are assigning the Stage variables is wrong. Seperate your Condition into a seperate Stage variable (sv0) then define
IHTH
Code: Select all
sv1 = (if sv0 then expr else sv1)
sv2= (if sv0 then sv2+1 else 0)
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)