![]() |
String Compare?
Is it possible to do primitive string compares at all? I seem to be drawing a blank.
Really, I'm looking for the logical equivalent of: if Parent.Text5.Text == "" then Parent.Temp = Parent.Input5.Text else Parent.Temp = Parent.Text5.Text Based on some things I've seen, I'm fumbling around with Parent.Temp = Parent.Text5.Text eq '' ? Parent.Input5.Text : Parent.Text5.Text Doesn't work of course, but that's what I'm aiming for. If one box has text in it, use that text. If not, use a different box.... Elsewhere, I'd love a 'Begins' type text compare. So I can compare the beginning of the string, but not the entire string (as the tail end changes) - but I suspect that's impossible with the tools at hand... Thanks, -Ken |
Normally you can only do one evaluation per line, so try the following:
ISEMPTY=Parent.Text5.Text=='' Parent.Temp=ISEMPTY ? Parent.Input5.Text : Parent.Text5.Text Or you can try to wrap the encoded apostrophes with parenthesis: ('') I've never had great luck with comparing null strings but maybe one of those will work. Putting a null string into a variable and trying to compare with that variable doesn't work because the engine sees that no variable with a value exists by that name, so it treats the variable name as plain text. We don't have any ability to do substring operations except for things like "123,456" put into a Location property of a Widget can be split by the comma by referencing the Left and Top properties. |
Thanks - I think you're example, and comments are enough to help me get what I want done, even if it's in a slightly more convoluted way than expected.
Unfortunately, I just haven't had the time to get back to it and try it out. But I wanted to make sure I responded and thanked you for the help. Thanks, -Ken |
Quote:
|
If you say so, but the exact thing you quoted meant that I had no such luck with it. If I make an XML attribute with nothing in it, the engine treats the referenced attribute as plain text instead of a variable. I ended up making it " " (a space) instead of "" and it worked fine... so I left it like that.
|
Quote:
|
| All times are GMT -5. The time now is 05:29 PM. |
vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI