CalcBuilder Forum

result same value string text

User bsnline 2018-03-14 17:31:55

Hi,

I have 2 string text

for example:

$mconsegna0=ABETONE # (FIELD INPUT)
$keys0=ABETONE # (VALUE IN MATRIX TABLE)

code:

if ('$mconsegna0'=='$keys0') $disa=10

why the result is 0 and not 10 ?

i want ... if "find the same value" result is = 10
suggestion please.

Moonsoft support 2018-03-15 08:55:49

Hi,
per your question we can't see clearly which is the purpouse of your code, but we see you're comparing the 2 values 'names', as you're using quotes inside the 'if' expression (so '$mconsegna0' will never be equal to '$keys0'). As you will surely want to compare the two variables/values of $mconsegna0 and $keys0 you should write instead

if ($mconsegna0==$keys0)


Also including at your output ##mconsegna0## and ##keys0## will help you to check which are the real values being used and you can find out if there's any difference between them.

We also share a link to a tutorial about using matrix, in case it may help

https://www.moonsoft.es/easyblog/entry/19-matrix

Regards

...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!