Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this a bug?(error using numbers containing . in QM 2.2.0)
#1
Since I've got version 2.2.0.11

I have the error
Error in Macro6: missing ( after function name, or ; after statement.

double a=0.125

Thanks
plr
#2
Make sure that . is really . (not , or some other character).
#3
i'm sure
Another thing

Warning: cannot create backup: invalid schedule.

In option - files - autobackup i had to change the 0.5 with 1
#4
Something wrong with . in your system. It seems that Windows converts . to some other character when QM retrieves it from the editor or registry. What are locale settings in Control Panel (on XP - Regional and Language Options)?
#5
France
I ve just tried English and the problem is the same
#6
I want to know what character code QM gets from ..

Create macro with this code (from the beginning):

Code:
Copy      Help
double a=0.125

Try to run it to make sure that it shows error.

Create second macro with this code:
Code:
Copy      Help
str s.getwintext(id(2203))
out s[10]

Assign some trigger to the second macro, for example F6 (temporarily).

Open the first macro.

Run the second macro while the first macro is opened in the editor (eg press F6).

What number is displayed in the output then?
#7
32
#8
The second macro displays character code of 11'th character in currently opened macro. If currently opened macro is

double a=0.125

, it must display character code of ., which is 46. 32 is code of space. I don't know why . is converted to space. Then other programs that use . also should have problems.

I tried to set locale and keyboard to French (France), but everything works well. Maybe it depends on some system settings, or some installed programs, don't know.
#9
Try to use English keyboard layout when working in QM.
#10
I have changed the caracter , with . in XP - Regional and Language Options then restart QM
and it works.
Then I changed the . with , back - restart QM and it works

So it seems to be OK

Thanks for your time

plr
#11
I found the reason. Some dll (maybe database components) running in QM context sets French locale for msvcrt.dll. QM string-to-number functions depend on it (starting from some QM 2.2.0.x version). They fail to convert numbers containing . if French locale is set.

In the next version, I'll make QM independent from such changes.

I recommend to do the following (until next QM version will be released):

Create function RestoreNumericLocale and paste this code:

Code:
Copy      Help
setlocale LC_NUMERIC "C" ;;restore default numeric locale

At the beginning of the macro that you think is changing locale insert

Code:
Copy      Help
atend RestoreNumericLocale

---

To view current locale settings, can be used this code:

Code:
Copy      Help
out setlocale(LC_ALL 0)

Normally (soon after QM starts) it should display something like

LC_COLLATE=French_France.1252;LC_CTYPE=French_France.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=French_France.1252

You can execute this code to discover which macro changes default locale.
#12
That is all OK
Thanks a lot !!!
Great program
plr


Forum Jump:


Users browsing this thread: 1 Guest(s)