Hello NatzW,
I wrote a quick callback function that will save the lines of text from your textbox to a file.
First, you get the number of text box lines.
Then, by index, get each text box line and write it to a file.
Finally, Close the file.
NOTE: If you know the maximum length of a line of text that will be displayed in your text box, then
you can declare you text array to be that size.
FILE * outputFile;
. . .
int CVICALLBACK SaveToFile (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int numLines = 0;
int i = 0;
char text[MAX_LINE_LEN];
switch (event)
{
case EVENT_COMMIT:
outputFile = fopen ("OutputFile.txt", "a");
GetNumTextBoxLines (panelHandle, PANEL_TEXTBOX, &numLines);
for (i = 0; i < numLines; i++) {
GetTextBoxLine (panelHandle, PANEL_TEXTBOX, i, text);
fprintf(outputFile, "%s\n", text);
}
fclose(outputFile);
break;
}
return 0;
}
Hope that helps.
Wendy L
LabWindows/CVI Developer Newsletter