GETCLIPBOARD and IF

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
lunalucky
Newbie
Posts: 14
Joined: Thu May 18, 2017 2:13 pm

GETCLIPBOARD and IF

Post by lunalucky » Thu Dec 28, 2017 9:04 am

Hi, when I debug my macro, NQUOTE is 8,4 and NQUO2 is 16,4, but the condition IF>nquote>nquo2 is true!!
Why? Can you help me?
Thanks

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: GETCLIPBOARD and IF

Post by JRL » Thu Dec 28, 2017 2:23 pm

I was going to suggest that you need to set the Decimal_Separator system variable to use a comma (,) but there appears to be a problem with the Decimal_Separator variable. The following does not evaluate properly.

Code: Select all

Let>decimal_Separator=,
Let>Bigger=16,4
Let>Smaller=8,4
Let>Product=%Smaller%*%Bigger%

lunalucky
Newbie
Posts: 14
Joined: Thu May 18, 2017 2:13 pm

Re: GETCLIPBOARD and IF

Post by lunalucky » Thu Dec 28, 2017 5:20 pm

But my variables are OK:
THOUSAND_SEPARATOR=.
DECIMAL_SEPARATOR=,

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: GETCLIPBOARD and IF

Post by JRL » Thu Dec 28, 2017 5:36 pm

But my variables are OK:
That is good. I did not know that because those variable assignments don't show in the image you posted.

What I am saying is that it appears that setting the Decimal_Separator variable to comma is not allowing scripts using comma as the decimal separator to work properly. I posted a short piece of code to demonstrate that.

If you run the code I posted you will see that the variable "product" is set to "8,4*16,4" rather than the product of the multiplication which should be 137,76.

So in your script where NQUOTE is 8,4 and NQUO2 is 16,4 the if statement thinks that "NQUOTE" is larger than "NQUO2" because "8" is larger than "1" . The comma is not being seen as the decimal separator even though you have set the "Decimal_Separator" variable to comma. Its supposed to work but something is broken.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts