Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 12,420 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 1,032
Budapest
Aku_Aku Offline
Serious User
Aku_Aku  Offline
Serious User

Joined: Sep 2009
Posts: 1,032
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: 1,032
Budapest
Aku_Aku Offline
Serious User
Aku_Aku  Offline
Serious User

Joined: Sep 2009
Posts: 1,032
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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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 | 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