Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by txesmi. 09/14/19 15:44
file_write var array ?
by jcl. 09/14/19 08:31
Shift on MA
by Fred7. 09/14/19 07:37
Smaller Zorro GUI for Windows XP
by Petra. 09/13/19 17:31
Options t8 format question
by jcl. 09/13/19 12:15
import pandas from python for deep learning
by anonymous69. 09/12/19 14:40
script mt5
by anonymous69. 09/12/19 12:11
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
5 registered members (3run, Dalla, bondo1, 2 invisible), 616 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
web20tpo, tarekhazem, Juanjo, Fred7, saulius
18288 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
dataParse - format string #477264
06/07/19 18:32
06/07/19 18:32
Joined: May 2015
Posts: 163
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 163
Czech Republic
Hi,

I have data in the csv:

1551356100;rsi_14;7;0;rsi_7;0;9;willr_27;0;9;willr_60;8;0;99.25;99.01
1551357000;rsi_14;6;9;rsi_7;0;9;willr_27;0;9;willr_60;8;0;99.34;99.11
1551357900;rsi_14;5;9;rsi_7;0;5;willr_27;0;9;willr_60;8;0;98.98;97.78

and format string:
string Format = "%t;;i1;i2;;i3;i4;;i5;i6;;i7;i8;f1;f2";

with test:
Code:
for (Row=0;Row<6;Row++){
   printf("n  %s", strdate("%Y-%m-%d %H:%M", dataVar(nHandle,Row,0)));
   for (i=1;i<10;i++)
      printf(" %d",dataInt(nHandle,Row,i));
    
}



2019-02-28 12:15 1120305152 1120273695 0 9 0 9 8 0 0
2019-02-28 12:30 1120316948 1120286802 0 9 0 9 8 0 0
2019-02-28 12:45 1120269763 1120112476 0 5 0 9 8 0 0
2019-02-28 13:00 1120288113 1120229130 9 4 0 9 9 0 0
2019-02-28 13:15 1120260588 1120105923 9 3 0 9 9 0 0
2019-02-28 13:30 1120223887 1119966986 9 2 3 9 9 0 0

first 2 integer (red) are missing in the dataset. Know anybody, where I have bug?

Thanks Milan

Re: dataParse - format string [Re: Grat] #477268
06/08/19 16:54
06/08/19 16:54
Joined: Sep 2003
Posts: 854
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 854
f1, f2 is overwriting i1,i2

Re: dataParse - format string [Re: Spirit] #477272
06/09/19 06:09
06/09/19 06:09
Joined: May 2015
Posts: 163
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 163
Czech Republic
No,

dataVar(nHandle,Row,1);
dataVar(nHandle,Row,2);

return correct value.

I found the solution:

[code]

string Format = "+%t;sss;i;i;sss;i;i;ss;i;i;ss;i;i;f1;f2";
int Records = dataParse(nHandle,Format,InName);

...
...

#define WIF_MAX 3
#define WIF_MIN 4
#define WIS_MAX 5
#define WIS_MIN 6

#define RSIF_MAX 7
#define RSIF_MIN 8
#define RSIS_MAX 9
#define RSIS_MIN 10

var _RSIF_MAX = (float)dataInt(nHandle,id,RSIF_MAX);
var _RSIF_MIN = (float)dataInt(nHandle,id,RSIF_MIN);
var _RSIS_MAX = (float)dataInt(nHandle,id,RSIS_MAX);
var _RSIS_MIN = (float)dataInt(nHandle,id,RSIS_MIN);
var _WIF_MAX = (float)dataInt(nHandle,id,WIF_MAX);
var _WIF_MIN = (float)dataInt(nHandle,id,WIF_MIN);
var _WIS_MAX = (float)dataInt(nHandle,id,WIS_MAX);
var _WIS_MIN = (float)dataInt(nHandle,id,WIS_MIN);

..
..
[code]

this work a correct.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1