Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, TedMar, dr_panther, Ayumi), 1,048 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Data import script #410102
10/28/12 12:17
10/28/12 12:17
Joined: Feb 2012
Posts: 37
S
stevegee58 Offline OP
Newbie
stevegee58  Offline OP
Newbie
S

Joined: Feb 2012
Posts: 37
I'm trying to write a data import script. The plan is to use normal Windows file i/o to open the text file containing the data to import and filling in the TICK struct.

I've tried writing a very simple lite C script to do Windows file i/o but I keep getting syntax errors during compile.

Here's an example:

Code:
#include <litec.h>
#include <stdio.h>
#include <windows.h>

function run()
{
	FILE *fp=fopen("test.txt","w");
	fclose (fp);
}



Here is a dump of the Zorro message window:

Code:
Zorro 1.02 Trading Automaton 
Made with GamestudioŽ by oP group 2012

FXCM.dll opened
IB.dll opened

forexite_import compiling..
Error in 'stdio.h' line 23: 
syntax error
< typedef struct _iobuf FILE;
 >
.


Last edited by stevegee58; 10/28/12 12:54.
Re: Data import script [Re: stevegee58] #410105
10/28/12 12:37
10/28/12 12:37
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
What is your plan? Will you wait until somebody ask for the details of the errors or do you provide them unbidden?

Re: Data import script [Re: Aku_Aku] #410107
10/28/12 12:43
10/28/12 12:43
Joined: Feb 2012
Posts: 37
S
stevegee58 Offline OP
Newbie
stevegee58  Offline OP
Newbie
S

Joined: Feb 2012
Posts: 37
It's absurdly easy to copy/paste my code in a script and run it to see the errors. Anyway I edited the original post with the errors.

Anyway I figured jcl would come along and point out what I did wrong.

Last edited by stevegee58; 10/28/12 12:44.
Re: Data import script [Re: stevegee58] #410108
10/28/12 12:52
10/28/12 12:52
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
Did you try to compile your example code?

Re: Data import script [Re: Aku_Aku] #410110
10/28/12 13:13
10/28/12 13:13
Joined: Feb 2012
Posts: 37
S
stevegee58 Offline OP
Newbie
stevegee58  Offline OP
Newbie
S

Joined: Feb 2012
Posts: 37
I did some searching outside the Zorro area of this message board and found the functions file_open_read, file_str_read and file_close.

For some reason the compiler can't seem to find these functions either.

Last edited by stevegee58; 10/28/12 13:18.
Re: Data import script [Re: stevegee58] #410146
10/29/12 14:37
10/29/12 14:37
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, those functions were for A8, we have not included them in Zorro. I'll check why you get the syntax error - there's likely some incompatible line in the header file.

Re: Data import script [Re: jcl] #410150
10/29/12 14:46
10/29/12 14:46
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok, the bug is in litec.h - please edit it and remove the "typedef void FILE" in line 42. FILE was twice defined this way.

Also, better write "void main()" instead of "function run()" - the run function is only for trading.


Moderated by  Petra 

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