Hi there,
How could I use Power Language to reference a text file in my Dropbox which contains a list of dates and dividend payments.
Yes, I could load as a separate ASCI file but would prefer to hold data out of the MC eco system and just read it when needed.
Many thanks,
Anthony
Dividend Files
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Dividend Files
Hello Anthony,
Attached is a sample DLL with source files. Using the functions InData, OutData, RFile, SFile, ADDStringFile, DelFile, DirCreate this library can write to file, read from file, add a line to file, delete file, create folder.
Below is sample code for reading from the file:
Attached is a sample DLL with source files. Using the functions InData, OutData, RFile, SFile, ADDStringFile, DelFile, DirCreate this library can write to file, read from file, add a line to file, delete file, create folder.
Below is sample code for reading from the file:
Code: Select all
DefineDLLFunc: "C:\Users\root\Desktop\IOData\Release\IOData.dll", int, "RFile", lpstr;
DefineDLLFunc: "C:\Users\root\Desktop\IOData\Release\IOData.dll", lpstr, "InData", int;
var: idx(0), LinesCount(0);
once cleardebug;
if(LastBarOnChart_s) then begin
Print("What's in the file ?");
LinesCount = RFile("c:\\Temp\\11\\TS_Orders_Clean.txt");
for idx = 0 to LinesCount - 1 begin
print(InData(idx));
end;
end;
- Attachments
-
- IOData.zip
- (27.4 MiB) Downloaded 264 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Dividend Files
AMarsland, you can use these functions only from the PowerLanguage code.Thanks Henry,
Can I access any of these functions directly from MC?
Anthony
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Dividend Files
Hello HenryHello Anthony,
Attached is a sample DLL with source files. Using the functions InData, OutData, RFile, SFile, ADDStringFile, DelFile, DirCreate this library can write to file, read from file, add a line to file, delete file, create folder.
Below is sample code for reading from the file:Code: Select all
DefineDLLFunc: "C:\Users\root\Desktop\IOData\Release\IOData.dll", int, "RFile", lpstr;
DefineDLLFunc: "C:\Users\root\Desktop\IOData\Release\IOData.dll", lpstr, "InData", int;
var: idx(0), LinesCount(0);
once cleardebug;
if(LastBarOnChart_s) then begin
Print("What's in the file ?");
LinesCount = RFile("c:\\Temp\\11\\TS_Orders_Clean.txt");
for idx = 0 to LinesCount - 1 begin
print(InData(idx));
end;
end;
Amateur question:
Can I install. if so how do I install these dll from the zip file?
Martin