MATLAB COMPILER RELEASE NOTES Betriebsanweisung Seite 163

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 264
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 162
Print Handlers
5-47
The print handler routine itself that deposits the text passed to it in an
output buffer
void WinPrint( char *text)
{
int cnt;
/* Allocate a buffer for the output */
if (firsttime) {
OutputBuffer = (char *)mxCalloc(1028, 1);
upperlim += 1028;
firsttime = 0;
}
/* Make sure there’s enough room in the buffer */
cnt = strlen(text);
while (totalcnt + cnt >= upperlim) {
char *TmpOut;
upperlim += 1028;
TmpOut = (char *)mxRealloc(OutputBuffer, upperlim);
if (TmpOut != NULL)
OutputBuffer = TmpOut;
}
/* Concatenate the next line of text */
strncat(OutputBuffer, text, cnt);
/* Update the number of characters stored in the buffer */
totalcnt += cnt;
}
The related function WinFlush that actually displays the text from the
output buffer in a Windows message box.
void WinFlush(void)
{
MessageBox(NULL, OutputBuffer, "MRANK", MB_OK);
mxFree(OutputBuffer);
}
For more details on mlfPrintMatrix,seetheMATLAB C Math Library User’s
Guide.
Seitenansicht 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 263 264

Kommentare zu diesen Handbüchern

Keine Kommentare