problem with Waitcursorchanged

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

Post by pantik » Tue Mar 09, 2010 1:07 pm

Yes , i know it Marcus. I already found the solution. I just had to changue the regional setting to English (USA). Now all my scripts with "waitcursorchaged" run correctly. Also in VM of VMware although i cannot see the cursor moves but this is no problem.

At last, after 3 days, i can continue working :D :D :D

Thanks to all for your interest or care. (sorry for my basic english xD)

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Mar 09, 2010 5:14 pm

pantik wrote:Yes , i know it Marcus. I already found the solution. I just had to change the regional setting to English (USA). Now all my scripts with "waitcursorchaged" run correctly.
Hi Marcus,

I am glad pantik found a solution. It reminds me of this post: Regional settings decimal character causing issues

However this solution seems more like a workaround to me...

Why should a user be forced to change their regional settings to English (USA) to get their Macro Scheduler scipt to work properly?

Why the efforts to translate Macro Scheduler into other languages... if they are required to change their regional settings to English (USA) to make things work?

Marcus, do you plan on enhancing the WaitCursorChanged> command so that if a user with non-English regional settings wanted a delay of 1,5 seconds (1 and a half seconds), they could leave their regional settings alone and the following line would just work?

WaitCursorChanged>1,5

Am I missing something? Marcus, what is your view on this?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 09, 2010 5:24 pm

Baffles me too because It DOES already work. I just tested it.

WaitCursorChanged>1,5

Waits for 1.5 seconds if I set my regional settings to use the comma as the decimal separator.

Now, clearly, in a function that has more than one parm you would have to do:

Let>timeout=1,5
PretendFunction>timeout,anothervalue

Because the comma is the parameter separator.

But it will still work.

The only place the comma can NOT be used as the decimal separator is in complex expressions because in complex expressions the comma is reserved for the parameter separator.

Otherwise I don't FORCE the period to be the decimal separator - it is inherited from the operating system. Try it - set it to use the comma and then do this:

Let>x=5
Let>y=3
Let>x=x/y
MessageModal>x

You will see "1,66666666666667" displayed in the message box.

Seriously, posts like this baffle me. There's nothing broken. It already works.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 09, 2010 5:27 pm

pantik wrote:Yes , i know it Marcus. I already found the solution. I just had to changue the regional setting to English (USA). Now all my scripts with "waitcursorchaged" run correctly. Also in VM of VMware although i cannot see the cursor moves but this is no problem.
Strange. I have no idea why the regional settings should have any effect. I just changed my regional settings and WaitCursorChanged continue to work. It is not dependent on regional settings. Has no bearing. Coincidence perhaps.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 09, 2010 5:38 pm

Note that in other languages, including VBScript you must still use "." as the decimal separator when specifying numbers in your code.

Any values displayed to the user will use regional settings, but you still need to use "." in the code.

In Macro Scheduler you can actually use either in all native functions.

There is no bug to fix.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Mar 09, 2010 5:48 pm

Hi Marcus,

Thanks for the replies... I appreciate the detail and it may be helpful to others in the future if they have questions on this issue. I'm glad to see no compromises have been made concerning regional settings and that as far as we know... this should all be working fine.
mtettmar wrote:
pantik wrote:Yes , i know it Marcus. I already found the solution. I just had to changue the regional setting to English (USA). Now all my scripts with "waitcursorchaged" run correctly. Also in VM of VMware although i cannot see the cursor moves but this is no problem.
Strange. I have no idea why the regional settings should have any effect. I just changed my regional settings and WaitCursorChanged continue to work. It is not dependent on regional settings. Has no bearing. Coincidence perhaps.
I wonder... pantik, can you confirm that if you change your regional settings, the script fails, but if you change them back, it works again? Does it behave that same way on all your machines or just one?

Perhaps you are OK with your fix now that things are working... but if you require that script to work with non-English (USA) regional settings... and you are still finding that it doesn't, please post an example of a full script that demonstrates the problem. The smallest possible full script that demonstrates the problem would be best...

Thanks and take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

Post by pantik » Wed Mar 10, 2010 12:12 am

Although i am spanish and i usually use spanish(Spain) in regional setting (in spain "," is used to decimal number), i always write "." for decimal numbers for convention (standar) when i am programming. Rarely or never you can use a programming lenguage or application software using "," for decimal numbers. This is just to clarify. Thereby in my code i always use "."
jpuziano wrote:I wonder... pantik, can you confirm that if you change your regional settings, the script fails, but if you change them back, it works again? Does it behave that same way on all your machines or just one?
Yes and Yes. I use windows XP sp2 and virtual machines of VMWare (also with windows XP sp2). When I change regional setting to spanish (Spain) the scripts fail and when i change them back to english (USA) it works correctly. I tested it in desktop, notebook and virtual machine.
jpuziano wrote:Perhaps you are OK with your fix now that things are working... but if you require that script to work with non-English (USA) regional settings... and you are still finding that it doesn't, please post an example of a full script that demonstrates the problem. The smallest possible full script that demonstrates the problem would be best...
Here a very simple code that i used for testing:

Code: Select all

OnEvent>KEY_DOWN,1,3,mousemove
label>loop
Wait>0.1
goto>loop

srt>mousemove
  MouseMoveRel>250,250
  WaitCursorChanged>0.5
  mdl>ok
end>mousemove
In all my machines, this code (compiled or not) shows modal message "ok" when i used english (USA) and stop or hung when i use spanish (Spain).

I could not guess that for using spanish regional setting i have to use "," in some commands like "waitcursorchaged" in stead of ".".

When i am programming "," is a arguments separator and "." is used for decimal numbers. Anyway it doesn't make sense that you have to use "," if you are going to run the scrip in some machines and "." if you are going to run it in anothers.

I hope i had explain it claerly. If you dont understand some thing, say to me and i will try use anothers words.

Regards.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Mar 10, 2010 9:17 am

Anyway it doesn't make sense that you have to use "," if you are going to run the scrip in some machines and "." if you are going to run it in anothers.
You don't. You can still use "." whatever your regional settings are set to. Just like every other programming language.

It just so happens that if your decimal separator is set to something other than "." you can, in Macro Scheduler, *also* use that if you so wish. But you are not forced to.

"." still works as the decimal separator whatever it is set to in regional settings.

I just changed my regional settings to use "," as the decimal separator and "." as the thousands separator and your script worked absolutely fine for me, as I expected, without modification.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Mar 10, 2010 9:37 am

I'm sorry, I tell a lie. You are correct. "." is not always working as I thought. I will get this sorted in the next release.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Mar 10, 2010 8:15 pm

mtettmar wrote:I'm sorry, I tell a lie. You are correct. "." is not always working as I thought. I will get this sorted in the next release.
Fantastic - I love it when the hard-to-find bugs get found and fixed.

Thanks Marcus for digging into the details and thanks pantik for being persistant... this fix will help all Macro Scheduler users that do not use regional settings of English (USA).

Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Mar 12, 2010 3:43 pm

Hi pantik,

Marcus has released version 11.1.23 of Macro Scheduler which I believe has a fix for the problem you reported.

Can you please verify that it fixes your issue and post back? Please and thanks.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Thu Apr 01, 2010 5:30 am

Hi pantik,

Ahh well, no confirmation if the fix solved your problem, but I'm going assume it did... or I bet we would have heard more on this.

Here's 10 reputation points in appreciation - I hope you win a T-shirt in the next go-round, I think you've earned it.

Some folks here might think that reputation points are only for rewarding someone who has helped you solve a problem.

I think that in addition, folks who report bugs that get fixed... also deserve recognition and thanks. What do the rest of you think?

Who knows, it might encourage others to report bugs they have been "living with" and if they too get fixed, things just get better for us all.

I don't see a down side there. :D
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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