Sequencer If block with text values

James Martin

Posted on 19.06.2017 17:34

I am creating a sequencer that first has a form pop up asking basic test information. One item on the form is a selection drop down with "yes" or "no" for choices. Based on this answer, I need to skip over some items in the test sequence. However, when I try and use the if block with the channel containing the text = "yes", it always gives me a false returned value. I've tried yes with single ', with ", with "', but can't get it to work. Do I have to set Yes and No as a sequencer variable value and compare to them rather than directly doing it?


DEWESoft Support
Technical support
Posted on 20.06.2017 08:48

Hi,

I wasn't sure if the sequencer had the string compare option, but after a small tests everything seems to be working correctly. I've attached the sequence file which should return a "The values are the same" statement on the top. I have the string yes stored inside a sequencer variable and then I compare it to the string literal "yes". You should use single quotes when using a variable and double quotes for a literal string.

Please try my example and see if it works. If it does, then there's something wrong with your sequence. If it still won't work, then I'd need to have your DEWESoft version to determine if there was/is a problem with that specific version.


Attached files:
James Martin

Posted on 20.06.2017 14:32

Thank you for the reply. Yes, the test sequence you attached worked. Seems my problem was trying to use global variables rather than sequencer variables. When I change the example to use one of the text global variables I have set up, it would not function properly.

I've attached a modified copy showing what I mean. You will need a global variable called 'test' that's set as text. I'm using X2 SP9


Attached files:
DEWESoft Support
Technical support
Posted on 21.06.2017 07:28

Hi,

it's no problem. After looking at your sequence file I think you're trying to incorrectly compare the value that comes out of the form. Because your form is of the "selection" type, the data that gets stored into the variable won't be the name of the selection that you've chosen but rather an index. Therefore, if you select the first option, the value that's returned to the variable will be a 0 and not "yes". This changes if you're using the input type of the form.

I've modified your example and I also think that it would be better to switch to sequencer's variables, since they are part of the sequence and you have them in the same place as the sequence, which makes them easier to work with.


Attached files:
James Martin

Posted on 21.06.2017 10:15

Ah, that makes sense. I hadn't thought about it being an index rather than string. Thank you for clearing this up for me.

DEWESoft Support
Technical support
Posted on 21.06.2017 11:03

You're welcome :)

Login to reply to this topic. If you don't have account yet, you can signup for free account .
This website uses cookies to ensure you get the best experience on our website. Learn more