Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2005:
[Freeciv-Dev] Re: Console Printout method
Home

[Freeciv-Dev] Re: Console Printout method

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: YaChu Yang <yyan050@xxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Console Printout method
From: Jason Dorje Short <jdorje@xxxxxxxxxxxx>
Date: Tue, 06 Sep 2005 11:31:03 -0400

YaChu Yang wrote:
Hi,

I've been trying to print simple string messages to the commanline prompt. I've
found freelog(...) but I've notice that if I try using this method in my own
defined methods in my own files, in the commandline, it gives things like "last
message was repeated twice". I was wondering is there a print method which
allows us just to simply print to the commandline? something just as simple as
printf? because I noticed that when I use printf, the application seems to
"buffer" the messages and these messages don't get printed out to the
commandline until the application has been closed.

Any help would be greatly appreciated. Thank you for your time.

The terminal usually buffers printf output unless you put a newline (\n) at the end of the string.

Using freelog is the recommended method. freelog won't print multiple identical lines in a row but instead gives a message like "last message repeated 8 times" if you print the same string 8 times in a row.

-jason



[Prev in Thread] Current Thread [Next in Thread]