Hi All,
For writing data to .cvs text, it would be useful to be able to change the filename dynamically via concatenation. Currently, I have to rename the already saved file every time or place it in a different folder to avoid overwriting.
For example, I use the filename
"Pix2Text_00",
"Pix2Text_01", etc...
to have an incrementing numbering.
Or another possibility would be to use date and time as a prefix
strdate( str0); strtime( str1);
"2026/04/07-17:24-Pix2Text"
to never have a duplicate filename.
I haven't managed to get this to work as a path. Is there a solution or workaround possible within FM?
In short, this is the method:
- Pixel values are scanned and placed in an Array.
- The Array is read to a pointer and written to a file.
int iA0;
void* iv00;
allocArray( 0, x, y, 0, 4);
...
putArray( 0, x, y, 0, src( ix0, iy0, 0));
iv00 = fopen( "C:\\FM\\TestData\\Pix2Text_00.txt", "w");
...
iA0 =getArray( 0, ix0, iy0, 0);
fprintf( iv00, "%d,", iA0);
Kind regards,
Paul Simoens