Errors, bugs, questions - page 1812
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
"Doctor, I have something that hurts!" © )
Give me an example of such an expression. A reproducible one. Then you will be able to say something.
{
int d1;
ulong i, frac1=frac, ll1=ll, type1=type;
i=1; d1=10;
while (ll>=d1) {d1=d1*10; i=i+1;}
if (type==0 || type==2) return (frac1+ll1*Pow10frac_length+i*Pow10(frac_length+i)+
type1*Pow10(frac_length+i+1)+bs*Pow10(frac_length+i+2)+Id1_class*Pow10(frac_length+i+3));
else return(ll1+i*Pow10(i)+type1*Pow10(i+1)+bs*Pow10(i+2)+Id1_class*Pow10(i+3));
}
ulong Pow10(ulong power) // power>0
{
ulong r=10;
if (power==0) return 1;
for (ulong i=2; i<=power; i++) r=r*10;
return r;
}
The problem is in the PackMagic function. external variables int frac_length=2; int Pow10frac_length=100; int Id1_class=1;.
You didn't give an example of an error. At what values of the arguments does this function return the wrong value (which one?) and what should be the correct result?
For example:
Id1_class=1, bs=0, type=0, frac=99, ll=1, frac_length=2, Pow10frac_length=100, return returned 11299.
It should be 1001199. In Expert, functions in class, demo account in Open.
It's not a fact that 11299 will always be returned in case of an error.
It's playing. Wrote your code to script, it gave correct value (1001199) when run in debug mode, but if I compile release and run it from tree in MT5, it gave 11199 steadily. I was able to localize the problem, here is the reproducing code:
void OnStart()
{
ulong i = 1;
ulong a1 = Pow10(frac_length + i);
ulong a2 = Pow10(frac_length + i + 1);
ulong a3 = Pow10(frac_length + i + 2);
ulong a4 = Pow10(frac_length + i + 3);
Print(IntegerToString(a1), " ", IntegerToString(a2), " ", IntegerToString(a3), " ", IntegerToString(a4));
}
ulong Pow10(const ulong power)
{
ulong r = 10;
if (power == 0)
return 1;
for (ulong i = 2; i <= power; i++)
r = r*10;
return r;
}
In debug mode it works correctly. But at start of release from navigator in MT5 either it produces nonsense ("1000 10000 100 100 100" instead of "1000 10000 100000 1000000") or MT5 hangs with full load of one of cores of the processor.
There are two ways to fix it. Either of these ways:
ulong a2 = Pow10(frac_length + i + (ulong)1);
ulong a3 = Pow10(frac_length + i + (ulong)2);
ulong a4 = Pow10(frac_length + i + (ulong)3);
Either by moving global variable frac_length inside Start() function.
This is indeed a compiler bug, write to Service Desk.
When hovering over a just published own review for a Market product, several suggestions/actions appear. If you select "edit" and change the review, a "No rights" error will pop up after clicking on "Update".
Application to the SR cannot be created -An error has occurred.
When hovering over a just published own review for a Market product, several suggestions/actions appear. If you select "edit" and change the review, the "No rights" error pops up after clicking on "Update".
Please specify the name and version of your browser.
On chrome 56.0.2924.87 the flight is fine, both with and without manually refreshing the review page.
Application to the SR cannot be created -An error has occurred.
Apparently there has been an update to the anti-cSRF token checking principles.
In chrome, you can do it like this:
Press F12 while on www.mql5.com => in dashboard go to Application => Cookies => click on cookies => Clear all from...
Please specify the name and version of your browser.
On Chrome 56.0.2924.87 the flight is fine, both with and without manually refreshing the review page.