[Me...] Posted August 15, 2019 Share Posted August 15, 2019 Hello everybody, I have a question about the condition "selectCase". I would like to process the following procedure with the condition "selectCase". Unfortunately it does not work. Is this even possible with "selectCase"? The line "display ..." I would replace in the case of application, it is now only for testing. NUT=0 OFFSET=0 inquireParameterList("NUT","V_NUT messen ?","OFFSET","OFFSET messen ?") // Abfrage des gewählten Messplan if (NUT==0 and OFFSET==0) then display("MessPlan = "+0) endif if (NUT==0 and OFFSET==1) then display("MessPlan = "+1) endif if (NUT==1 and OFFSET==0) then display("MessPlan = "+2) endif if (NUT==1 and OFFSET==1) then display("MessPlan = "+3) endif Link to comment Share on other sites More sharing options...
[Br...] Posted August 15, 2019 Share Posted August 15, 2019 I have not been able to get select case to work, but with a little tweak your code works just the same. Try adding a closing bracket around each boolean test. NUT=0 OFFSET=0 inquireParameterList("NUT","V_NUT messen ?","OFFSET","OFFSET messen ?") if (NUT==0) and (OFFSET==0) display("MessPlan = "+0) endif if (NUT==0) and (OFFSET==1) then display("MessPlan = "+1) endif if (NUT==1) and (OFFSET==0) then display("MessPlan = "+2) endif if (NUT==1) and (OFFSET==1) then display("MessPlan = "+3) endif Link to comment Share on other sites More sharing options...
[Er...] Posted August 15, 2019 Share Posted August 15, 2019 selectCase works just fine, how ever, if you are making an comparison for equal, you need to add "is". selectCase list(1, 2, 3, 4, 5).shuffle.first case is == 1 Syntax case > 3 Syntax caseElse Syntax endSelect (With reservation for syntax error, sittning on a park bench and typing on my Phone.) So you could use this in your case: selectCase NUT.asString+OFFSET.asString case is == "00" display("MessPlan = "+0) case is == "01" display("MessPlan = "+1) case is == "10" display("MessPlan = "+2) caseElse display("MessPlan = "+3) endSelect Link to comment Share on other sites More sharing options...
[Me...] Posted August 16, 2019 Author Share Posted August 16, 2019 Thank you Eric. I have tested. It works, very good. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in