how to detect empty %new_val?

100 views
Skip to first unread message

Nixx

unread,
Aug 17, 2012, 2:25:28 PM8/17/12
to tas...@googlegroups.com
Just ran into something I don't quite follow..

I'm messing around with a profile that gets triggered by the alarm notification, in my scene there is a text inputfield where you could specify the title for that alarm notification, but it can also be left blank.
One needs to push an 'apply' button so that the changes are only processed when people are sure.

So I have two tasks:

Task A - connected to the Text input Scene Element
a: Set Variable: %TMP_TITLE to %new_val

Task B - connected to the 'Apply' task
a: Set Variable: %TITLE to %TMP


This works great when a new title is typed in , then the %TITLE is set to the %TMP_TITLE.
But when that titles is removed and the TextElement is left empty (and thus %new_val is clear) this doesn't work anymore.
As then the result is that %TITLE is filled with "%new_val" instead of being an unset variable.

How to approach/fix this?


Wes Stacey

unread,
Aug 17, 2012, 3:35:24 PM8/17/12
to tas...@googlegroups.com
You could put in an if statement to check if %TITLE "is set" then set it to whatever you want it to be if they don't enter one. if you want it to be blank you could just set it to a space.

-Wes

Nixx

unread,
Aug 17, 2012, 5:00:58 PM8/17/12
to tas...@googlegroups.com
On Friday, August 17, 2012 9:35:24 PM UTC+2, Wes Stacey wrote:
You could put in an if statement to check if %TITLE "is set" then set it to whatever you want it to be if they don't enter one. if you want it to be blank you could just set it to a space.

I tried that, but that doesn't seem to work. As it keeps transferring %new_val
Attached the project file.

For now I'll just solve it differently, and make a on/off switch next to it.
If it's OFF then the tittle is empty, if it's ON then the tittle will be filled.
TYPE.prj.xml

Wes Stacey

unread,
Aug 20, 2012, 10:51:46 AM8/20/12
to tas...@googlegroups.com

Can you re-export it as a description instead of an .xml Makes it much easier to read that way.

easiuser

unread,
Aug 20, 2012, 12:18:38 PM8/20/12
to tas...@googlegroups.com
I have had issues with a split resulting in empty variables that fail the Isn't Set condition.  I use the Doesn't Matche Regex (below IsSet and Isn't Set) instead.
 
Try the condition %TITLE !R~ [%]TITLE.
 
This condition will be true as long as %TITLE does not specifically contain the characters "%TITLE".

Nixx

unread,
Aug 20, 2012, 8:16:56 PM8/20/12
to tas...@googlegroups.com
On Monday, August 20, 2012 4:51:46 PM UTC+2, Wes Stacey wrote:

Can you re-export it as a description instead of an .xml Makes it much easier to read that way.

Basically the description is the same as in the first post. the .xml only has it implemented with the scene in case someone wanted to test it.
 

On Monday, August 20, 2012 6:18:38 PM UTC+2, easiuser wrote:
I have had issues with a split resulting in empty variables that fail the Isn't Set condition.  I use the Doesn't Matche Regex (below IsSet and Isn't Set) instead.
 
Try the condition %TITLE !R~ [%]TITLE.
 
This condition will be true as long as %TITLE does not specifically contain the characters "%TITLE".

thanks for the suggestion, will try that one next time. For now I worked around it so that an empty title is not confirmed. (and thus reset by an other action)


 
Reply all
Reply to author
Forward
0 new messages