Hello
I'm looking to replace the Global Variable String that I'm using in Excel because it cause me some problem. To do so, I want to look at working with a file to trasmit info between MC and Excel
Anyone as an example of code use to write and read a single line to a file
Martin
How to read / write a single line in a file
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: How to read / write a single line in a file
Hello Martin,
In power Language there is no prebuilt ability to read from a text file. This functionality can be accessed by means of a custom DLL.
In power Language there is no prebuilt ability to read from a text file. This functionality can be accessed by means of a custom DLL.
Re: How to read / write a single line in a file
Martin,
Have you tried "ELCollections.dll" ? I think it can do it.
Best regards.
Here is a sample of function i use :
Have you tried "ELCollections.dll" ? I think it can do it.
Best regards.
Here is a sample of function i use :
Code: Select all
Var:
References(ListN.New),
derniereRef(0);
// Ouverture du fichier des references
Value1 = ListN.ReadFile(References,"C:\References.txt");
// Lecture de la derniere valeur
derniereRef = ListN.back(References);
value1=ListN.Clear(References);
// Affiche la derniere valeur
GenRef = derniereRef+1;
FileAppend("C:\References.txt",numtostr(derniereRef+1,0) + NewLine);