Use vars in Strlen or ArrayIndexOf


Walter Hiller

Hello,

happy Easter to all! I just fight with a interesting problem. Please have a look at the examples below. Version 1 works as it should, Version 2 returns a -1 although [searchme] has the value "11_HILLER".

Same behavior i.e with StrLen.is it not possible to use a var as input?

Thanks,
Walter


decsoft

Hello,

Maybe you found a bug in certain scenario, or maybe the problem is related with some "case sensitive" mistake. The below code works for me, then, try to investigate a little more, for example, assert "[searchme]" must be as is and not "[SearchMe]".



Walter Hiller

Hello David, thanks for your answer.
Do you think it could be a problem, because I define var [searchme] in the click of the Select1.SelItems? Means I SetVar "searchme" "[Select1.SelItems]" "String" ? Thanks, Walter


decsoft

Hello Walter,

Yes; certainly could be the problem, maybe SelItems contains more than one item, and, on the other hand, what happend if no items are selected? Anyway may you can test it by place an "Alert" in your code, something like this:

This can be a quick way to look into the "[searchme]" variable contents...



Walter Hiller

Hello David,

I did the alert test from the begining and the alert always shows me the correct value, i.e 11_HILLER, that is what me drives crazy. I have to leave now, but will send you the app later! Thanks, Walter


decsoft

Hello,

Please, Walter, sorry any inconvenience and, when you can, send me an application in which I can reproduce the problem. Then I will take a look in order to fix it as quickly as possible.



Walter Hiller

Hello and many thanks to David!

for all others: The solution is simple: The value of a MultiSelect control itsself is an array. This means if you want to search for the result of a single selection in an MultiSelect.Control you have to read first postion of the selected (answer) array:


decsoft

That is the question! :)


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.