Source language: Translate to:

If error

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

If error

Postby mishem » Tue Feb 04, 2014 6:13 am

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
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm

Re: If error

Postby Gaev » Tue Feb 04, 2014 6:42 am

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,
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: If error

Postby mishem » Tue Feb 04, 2014 7:06 am

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.
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest