Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i display Cluster1[0][n]in

Status
Not open for further replies.

julianluthor

Programmer
Nov 3, 2003
18
0
0
MY
how can i display Cluster1[0][n]in .dat file?Below is my code..
Code:
... 
for(int j=0;j<DataHeight;j++) 
{ 
for(int i=0;i<DataWidth;i++) 
{ 
Data[i][j]=(unsigned char)(((float)dataconv[j][i]-min)/(max-min)*255); 
if (Data[i][j]==170) 
{ 
Cluster1[0][n]=Data[i][j]; 
n++; 
} 
} 
}
 
int FilePtr = 0;

if (FileExists(&quot;filename.dat&quot;))
FilePtr = FileOpen(&quot;filename.dat&quot;, fmOpenWrite);
else
FileCreate(&quot;filename.dat&quot;);

if (FilePtr > 0)
{
FileSeek(FilePtr, 0, 2);
FileWrite(FilePtr, &(Cluster1[0][n]), 1);
}

FileClose(FilePtr);

This will create the file if neccessary, or open it for writing, move to the end of it, add the byte, then close it.

Chris
 
there is error at this line :
FilePtr = FileOpen(&quot;filename.dat&quot;, fmOpenWrite);
that said call of nonfunction.
 
i'm using version 5.0.is there any other way to display it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top