How to modify multiple if statements (I'm not sure if that's the right way to express it).
In the database below I have two key buttons, I will temporarily call the code in "Key1" "if1". Now I need to run the "if2" code after meeting the "if1" condition "avg(test) = 1", and this code needs to be before "table2.Table3.(Choose := 2)". It seems like after modifying like this the code does not work. How should I adjust it, thank you for your reply.
if2:
if '1' = null then
'2' := '1'
else
if '2' = null then'3' := '1'
end
(There are errors in the demo code, use this as the reference.)
if1:
if avg(test) = 1 then
table2.Table3.(Choose := 2)
else
table2.Table3.(Choose := 1)
end
6 replies
-
I need to run the "if2" code after meeting the "if1" condition "avg(test) = 1", and this code needs to be before "table2.Table3.(Choose := 2)".
I don't quite understand what you want to happen. Looking at the code for Key2 (if2), everything works:
if avg(test) = 1 then if '1' = null then '2' := '1' else if '2' = null then '3' := '1' end; table2.Table3.(Choose := 2) end else table2.Table3.(Choose := 1) end
Can you write out the flow you want? Or upload a flow chart?
-
said:
I guess it's because of the "if2" that was added. How can I adjust it to make them both work,I would agree that key2 doesn't work like key1 because of the second if statement. I asked for a flow chart or a more descriptive paragraph of the if statements on what you want to happen.
If you add text to the field "1", then key2 works like key1. Just like you wrote the code.
Content aside
- Status Answered
- 8 mths agoLast active
- 6Replies
- 82Views
-
2
Following