Data import script

Posted By: stevegee58

Data import script - 10/28/12 12:17

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;
 >
.

Posted By: Aku_Aku

Re: Data import script - 10/28/12 12:37

What is your plan? Will you wait until somebody ask for the details of the errors or do you provide them unbidden?
Posted By: stevegee58

Re: Data import script - 10/28/12 12:43

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.
Posted By: Aku_Aku

Re: Data import script - 10/28/12 12:52

Did you try to compile your example code?
Posted By: stevegee58

Re: Data import script - 10/28/12 13:13

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.
Posted By: jcl

Re: Data import script - 10/29/12 14:37

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.
Posted By: jcl

Re: Data import script - 10/29/12 14:46

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.
© 2024 lite-C Forums