Page 1 of 1

If error

PostPosted: Tue Feb 04, 2014 6:13 am
by mishem
Code: Select all
SetVar "[TextEntry1]" "0"
SubStr "[TextEntry1]" "1" "1" "[Result]"
If "[Result]" "=" ","
   AlertBox "" ""
EndIf


I get AlertBox

so too

SetVar "[Result]" "0"
IfEx "[Result]=,"
AlertBox "" ""
EndIf

And so

SetVar "[Result]" "0"
IfEx "[Result]=[#44]"
AlertBox "" ""
EndIf

, = 0

Re: If error

PostPosted: Tue Feb 04, 2014 6:42 am
by Gaev
mishem:

Try ...
Code: Select all
If "[Result]" "=" "!,"
On my machine ...

1) I did not get the AlertBox when using comma (,)

2) But got it when I used the decimal point (.)

This suggested that your windows might be configured for European style displays of decimal numbers e.g. 123,45 ... and so, a comma by itself is translated as 0, ... which is seen to match 0

3) When I tried using !. ... meaning no translation of specified string ... I did not get the AlertBox,

Re: If error

PostPosted: Tue Feb 04, 2014 7:06 am
by mishem
Now I try differently.

for example

SetVar "[Result]" "10"
If "[Result] " "=" "1,"
AlertBox "" ""
EndIf

not show AlertBox

SetVar "[Result]" "1"
If "[Result] " "=" "1,"
AlertBox "" ""
EndIf

show AlertBox

European style displays of decimal numbers e.g. 123,45

Yes.

And I do check it out, not to have two or more commas.

In NeoBookDBPro have the opportunity to set the format type ",#0.00".

In TextEntry no such.

Anyway, I could not do that.

If "[Result]" "=" "!,"

So yeah. Help.

In my case it is a way out.
But this is not the solution for the future. Such moments must not be possible to take into account.

Thank you.