IOData writing to a pre-existing file  [SOLVED]

Questions about MultiCharts and user contributed studies.
AMarsland
Posts: 28
Joined: 30 Sep 2010
Has thanked: 5 times
Been thanked: 1 time

IOData writing to a pre-existing file

Postby AMarsland » 14 Sep 2016

Hi there,

I'm using IOData to read a file with great success. Not having so much luck writing to a file.

Please could you supply the syntax for defineDLLfunc for all the functions.

Also could you supply a simple example of code to write to the end of an already existing .csv file.

Many thanks,

Anthony

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: IOData writing to a pre-existing file

Postby TJ » 14 Sep 2016

Hi there,

::

Also could you supply a simple example of code to write to the end of an already existing .csv file.

Many thanks,

Anthony

Go to Wiki and look up the keywords

PRINT

You will find the definition and usage examples.



While you are there, you can also look up:

File
FileAppend
FileDelete

hughesfleming
Posts: 275
Joined: 22 Apr 2014
Has thanked: 70 times
Been thanked: 72 times

Re: IOData writing to a pre-existing file

Postby hughesfleming » 14 Sep 2016

Hi Anthony,

Code: Select all

DefineDLLFunc:"IODATA.dll",double,"ADDStringFile",lpstr,lpstr;
and then

Code: Select all

ADDStringFile(OutputFile,ExportString);
Mine is setup like this:-

Code: Select all

OutputFile = OutputFileNamePath+GetSymbolName+OutputFileNameExtention;
OutputDateString = FormatDate(OutputDateFormat, ELDateToDateTime(Date));
ExportString = OutputDateString+" "+NumToStr(O,OutputDigits)+" "+NumToStr(H,OutputDigits)+" "+NumToStr(L,OutputDigits)+" "+NumToStr(C,OutputDigits)+NewLine;

If BarType= 2 then begin
ADDStringFile(OutputFile,ExportString);
end;


AMarsland
Posts: 28
Joined: 30 Sep 2010
Has thanked: 5 times
Been thanked: 1 time

Re: IOData writing to a pre-existing file  [SOLVED]

Postby AMarsland » 14 Sep 2016

Thank you. Very, very helpful...

Anthony


Return to “MultiCharts”