Problems with other languages?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

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

Post by Marcus Tettmar » Mon Nov 12, 2007 8:16 am

Line 87-89
Line 112-114
Line 137-139

VBEval>Round(%seconds%,2),seconds
let>divby8=barsx/8
VBEval>Round(%divby8%,2),divby8
As I stated earlier: In some countries the comma is used as the decimal separator. But commas are used in VBScript and in Complex Expressions as parameter separators. Therefore if we have a value that contains a comma we must convert the comma to a period before passing that value to VBScript/Complex Expressions. The native math functions work with whatever is the regional set up. So in the above you could end up with %seconds% and/or %divby8% containing a comma (or whatever is set as an alternative to the period for the decimal placeholder). The solution, as already explained, is to replace occurrences of regional decimal placeholders with periods before passing the value to these functions. So the above becomes:

StringReplace>seconds,DecimalPlaceHolder,.,seconds
VBEval>Round(%seconds%,2),seconds

and we can remove the need to do the same to divby8 if we make the calculation local to the function. So your two divby8 lines become:

VBEval>Round(%barsx%/8,2),divby8

Of course that assumes barsx doesn't already contain non-periods. We could do:

StringReplace>barsx,DecimalPlaceHolder,.,barsx
VBEval>Round(%barsx%/8,2),divby8

PAP Delay Calculator:

line 129:
let>millisec={round(%premath%)}

line 149:
let>tempocalc={round(%premath%)}
So:

line 129 becomes:
StringReplace>millisec,DecimalPlaceHolder,.,millisec
let>millisec={round(%premath%)}

line 149 becomes:
StringReplace>tempocalc,DecimalPlaceHolder,.,tempocalc
let>tempocalc={round(%premath%)}

All the above assumes you have placed the DecimalPlaceHolder code at the top of each script as demonstrated previously.

Does this now make sense?
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
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Mon Nov 12, 2007 12:00 pm

Marcus I can;t thank you enough for th time you take to explain these things. Your support as usual goes beyond "support".

It makes sense now and putting it into practise should work. I will post up just in case anyone else is following this thread.

Thank you once again.
Phil Pendlebury - Linktree

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