ArrayToFile function can write to disk in two different ways, depending on the option in "File type" field: if you choose ASCII you can read the file created with a text editor, but this consumes more room on disk. If you choose Bynary you have a more compact file but you need to read back with an appropriate program.
This code reads back some doubles from a file created with ArrayToFile and prints them to the debug window. Note the SetFilePtr instructions, by wich you can move to an fro in the file: you can build a simple data viewer customized to your actual acquisition and to the contents of your data file.
Hope this helps
Roberto
#include
#include
#include
#include
static double m[16];
static char buf[128];
static int i;
static int fH;
static char file[MAX_PATHNAME_LEN];
// Choose the file and open it
FileSelectPopup ("", "*.*", "", "Choose file to open",
VAL_LOAD_BUTTON, 0, 0, 1, 0, file);
fH = OpenFile (file, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);
// Position anywhere in the file and read some doubles
SetFilePtr (fH, sizeof (double) * 16, 0);
ReadFile (fH, buf, sizeof (double) * 8);
// Cast to the array of doubles and print them
memcpy (&m, buf, sizeof (double) * 8);
for (i = 0; i < 8; i++) {
DebugPrintf ("%d: %.1f\n", i, m[i]);
}
// Close the file
CloseFile (fH);