Gamestudio Links
Zorro Links
Newest Posts
Where's the Wiki?
by Quad. 06/25/19 22:16
Published Gamestudio Games?
by Dooley. 06/25/19 16:59
Updating to A8 [SOLVED]
by Dooley. 06/25/19 16:00
Message from IB of open position
by Zheka. 06/25/19 13:58
FXCM: "Can't connect to price server"
by riinvest. 06/25/19 10:35
New Zorro version 2.12
by jcl. 06/25/19 09:42
Aum120 is ready
by Emre. 06/24/19 17:54
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 (JeyKey II, wdlmaster, alibaba, jenGs, kvm), 574 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Theaisback, redye, rhe2564, Qw3rty, Dal
18239 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: 134
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 134
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: 840
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 840
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: 134
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 134
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