Hi all,
Could someone please tell me what is wrong with this code, in which I try to write 8 integers to a file and them read them back in?
I've found out that the "rep code" only applies to integer _arrays_, and that if I format each integer out one at a time using "%i<%i" it works.
But how do I format multiple parameters in one call to FmtFile?
Thx,
Ian
int chk[8], i, filehw, filehr;
filehw = OpenFile ("test.dat", VAL_WRITE_ONLY, VAL_TRUNCATE, VAL_BINARY);
FmtFile(filehw, "%i%i%i%i%i%i%i%i", 1,3,5,7,11,13,17,19);
CloseFile(filehw);
filehr = OpenFile ("test.dat", VAL_READ_ONLY, VAL_TRUNCATE, VAL_BINARY);
for (i=0; i< 8; i++){
ScanFile(filehr, "%i>%i", &chk[i]);
}
CloseFile(filehr);