Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   printf and newlines (http://www.chiefdelphi.com/forums/showthread.php?t=25727)

Jeff McCune 21-02-2004 11:43

printf and newlines
 
I'm using minicom in unix to read back the data from printf... How the heck do I get a new line so I can get a scrolling set of values rather than just a single line that always overwrites itself? I've tried all permutations of \r and \n together. Do I need to set my terminal to something specific, vt100 or ansi or something?

steven114 21-02-2004 15:16

Re: printf and newlines
 
Quote:

Originally Posted by Jeff McCune
I'm using minicom in unix to read back the data from printf... How the heck do I get a new line so I can get a scrolling set of values rather than just a single line that always overwrites itself? I've tried all permutations of \r and \n together. Do I need to set my terminal to something specific, vt100 or ansi or something?

I used the settings 152000 baud (or something like that) and CRLF line returns successfully with my terminal, but I don't use minicom specifically.

Jeff McCune 21-02-2004 17:44

Re: printf and newlines
 
Quote:

Originally Posted by steven114
I used the settings 152000 baud (or something like that) and CRLF line returns successfully with my terminal, but I don't use minicom specifically.

CRLF is \r\n from the perspective of printf(), right? Just making sure I'm bot being an idiot.

steven114 21-02-2004 18:38

Re: printf and newlines
 
Quote:

Originally Posted by Jeff McCune
CRLF is \r\n from the perspective of printf(), right? Just making sure I'm bot being an idiot.

I had just \n in the printf calls, \r is unneeded (afaik)

Astronouth7303 21-02-2004 20:01

Re: printf and newlines
 
I would guess that mplab uses ansi (ascii, 1 byte) letters. It's based on the compiler, since it translates strings to binary. that's also where \n stuff comes from.

gnormhurst 21-02-2004 21:09

Re: printf and newlines
 
Quote:

Originally Posted by Jeff McCune
I'm using minicom in unix to read back the data from printf... How the heck do I get a new line so I can get a scrolling set of values rather than just a single line that always overwrites itself? I've tried all permutations of \r and \n together. Do I need to set my terminal to something specific, vt100 or ansi or something?

This probably won't help: I wanted to achieve the same thing (single, overwriting line) using the IFI loader's Terminal window. I tried \r, but it had the same result as \n.

I glanced at printf_lib.c and saw some stuff about \r, so there's hope. Have a look at printf_lib.c

-Norm


All times are GMT -5. The time now is 04:24.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi