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
Due to changes in copying struct - corrected ByteImg.mqh file to use union
download the new FastFile in its publication https://www.mql5.com/ru/forum/6291#comment_4967832gg always outputs 0. Although if the query is entered directly into the database, it outputs the correct value.
And if instead of COUNT put some column and then look at the array size ArraySize(tbl.m_data), everything is fine. I.e. count doesn't work. I don't know, maybe I'm doing something wrong.....
I am currently experiencing this error, can anyone help me?
I am currently experiencing this error, can anyone help me?
thanks for posting
fix in the archive
Forum on trading, automated trading systems and testing trading strategies
Discussion of the article "SQL and MQL5: Working with SQLite Database"
Denis Kanapis, 2017.06.11 15:28
gg always outputs 0. Although if you enter the query directly into the database, it outputs the correct value.
And if instead of COUNT put some column and then look at the array size ArraySize(tbl.m_data), everything is good. I.e. count doesn't work. I don't know, maybe I'm doing something wrong.....
The same thing - COUNT outputs 0, but when you run the script from SQLiteStuido - everything counts.
Practically it was found that this happens on tables with ~10000>number ofStrokes. Moreover, if the obtained table tbl, as in the above example, is printed (by a function built into the code) - columns of INTEGER type will be printed 0, although they are not 0, of course. And in the same printout DOUBLE outputs correctly.
Something seems to be wrong with ints(I haven't had time to test it yet).
Forum on trading, automated trading systems and testing trading strategies
Discussion of the article "SQL and MQL5: Working with SQLite Database"
BeforeFlight, 2017.08.31 07:55 AM
Same thing - COUNT outputs 0, but when running a script from SQLiteStuido - everything counts.
Practically found that this happens on tables with ~10000>number ofStrokes. Moreover, if the obtained table tbl, as in the above example, is printed (by a function built into the code) - the columns of INTEGER type will be printed 0, although they are not 0, of course. And in the same printout DOUBLE outputs correctly.
Something seems to be wrong with ints(I haven't had time to test it yet).
I found it - in the file "Include\MQH\Ctrl\ByteImg.mqh":
instead of:
apparently meant:
after that everything is correct with COUNT, and the printout of the tables. At least my tests pass.
@o_o @Denis Kanapis
Found it-- in the "Include\MQH\Ctrl\ByteImg.mqh" file:
instead of:
apparently meant:
after that, everything is correct with COUNT, and the printout of the tables. At least my tests pass.
@o_o @Denis Kanapis
Just wanted to tell you about this error, you were ahead of me :). For INT values the value 0 was given all the time.
you described a bug for SD, because __int is union
union __int { int v; uchar b[4]; };
and the difference between
__int d; d.v=0;и
__int d={0};there should be no difference between and
The code fragment you show doesn't understand how it affects your COUNT at all.
because the ViewInt function does not write, but just the opposite - it reads the number in d.v. And it doesn't care about the current value of d.v.
-----
I added your suggested edit to ByteImg to make you feel more comfortable.
But you please localise and provide a reprint of this bug. Since so far everything looks like a bug, but definitely not a bug of the lib.