Dynomotion

Group: DynoMotion Message: 10441 From: wgripp Date: 10/31/2014
Subject: fprintf without "\n"
Hi,

I find that fprintf will append a "non printable"character (looks like ASCII #2  STX or #3 ETX) at the end of the string if the string is not terminated with "\n". Is this is the intended behaviour ?

This is a test case:

#include "KMotionDef.h"

main()
{
    FILE *f=fopen("C:\\temp\\test.txt","wt");
    printf("Transmission of %d rows,", 1);
    fclose(f);
}

This particular test appends the ETX character, another more complex examples seems to append the STX.

Thank you, best regards 


Group: DynoMotion Message: 10442 From: Tom Kerekes Date: 10/31/2014
Subject: Re: fprintf without "\n"
All printf or fprintf must be terminated with a new line character or the results will be indeterminate.  (A single stream to the PC and KMotionServer is used for printf, fopen, fprint, fclose except with embedded control characters of 0x01, 0x02, 0x03). 

Regards
TK


From: "wgripp@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, October 31, 2014 2:59 PM
Subject: [DynoMotion] fprintf without "\n"

 
Hi,

I find that fprintf will append a "non printable"character (looks like ASCII #2  STX or #3 ETX) at the end of the string if the string is not terminated with "\n". Is this is the intended behaviour ?

This is a test case:

#include "KMotionDef.h"

main()
{
    FILE *f=fopen("C:\\temp\\test.txt","wt");
    printf("Transmission of %d rows,", 1);
    fclose(f);
}

This particular test appends the ETX character, another more complex examples seems to append the STX.

Thank you, best regards 




Group: DynoMotion Message: 10443 From: wgripp Date: 10/31/2014
Subject: Re: fprintf without "\n"
Thanks !