Why this if doesn't work as expected?

avalongits

Новичок
Регистрация
14.02.2013
Сообщения
38
Благодарностей
0
Баллы
0
Please, don't blame me! I'm sure I'm missing something. I've created this simple template:



But the if (as you can see in the log) return nothing (it equals to false)

I've tried also:
{-Variable.testvar-}=="anything"
{-Variable.testvar-}==anything
{-Variable.testvar-}="anything"
{-Variable.testvar-}=anything
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 712
Баллы
113
If variable is not numerical and contains text you should use this format:

Код:
'{-Variable.testvar-}'==''
variable is empty = true
Код:
'{-Variable.testvar-}'!=''
variable is not empty = true
 
  • Спасибо
Реакции: avalongits

avalongits

Новичок
Регистрация
14.02.2013
Сообщения
38
Благодарностей
0
Баллы
0
Thanks!

But if {-Variable.testvar-} contains a ' character, the if doesn't work.

How to solve it?
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
use Word processing->Prepare JavaScript for {-Variable.testvar-} before
 
  • Спасибо
Реакции: avalongits

muchink

Client
Регистрация
28.07.2012
Сообщения
193
Благодарностей
6
Баллы
18
I had the same problem buddy, if it returns nothing and eventually false, the variable has a hidden space/enter/tab in the end/beggining
do this on the variable:
Text Processing -> "Trim" ->(Space,Enter,Tab) beginning and end.

Hope it helps! :-)
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)