On 04/27/2010 10:14 AM, Xiaofan Chen wrote: > On Tue, Apr 27, 2010 at 9:59 PM, Alan B Pearce wrote: >>> char i; >>> for( i = 0; ! finished(); i++ ) >>> printf( "\r[%c]Please wait", "|/-\\"[i&3] ); >>> >>> Will let the user know that the program is working (not hanged) during a >>> wait. >> >> >> That's clever. Not being familiar with the inner intricacies of C I wouldn't >> have thought of doing it like that. >> > > What does the code mean? I do not understand it ... ;-( > > I think it prints out on one line: \r|Please wait \r/Please wait \r-Please wait \r\Please wait \r|Please wait : (until finished) This would appear as the only thing changing would be the character after the \r (newline). As Mark pointed out, like the old DOS programs used to do. -- Linux Home Automation Neil Cherry ncherry@linuxha.com http://www.linuxha.com/ Main site http://linuxha.blogspot.com/ My HA Blog Author of: Linux Smart Homes For Dummies -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist