To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 8204
8203  |  8205
Subject: 
Re: printf question
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Wed, 6 Dec 2000 05:31:31 GMT
Viewed: 
1104 times
  
Ooops. Sent from a non authorized account and bounced...

|That letter is the Yen symbol. Have you tried printf("%\"?). Reading
|the source implies that he looks for \, but I couldn't see any test
for
|it like I could for %. And % is explicitely called out..
|
|* "%" sign followed by anything else prints that character.
|
|-- chris prosser
|
|Here is the comment from the pcode source:
|at http://handyboard.com/software/pcode.asm
|
|*****************************************************************
|*
|* Pprintf print formatted string
|*
|* takes following on stack:
|*
|* ssss string ptr to formatting string
|* aaaa arg1  \
|* bbbb arg2  |-- optional args: ints, floats, or
|* cccc arg3  / string ptrs.
|* nnnn # of arg bytes (NOT including initial fmt string)
|*
|* returns with zero on stack.
|*
|* accepts following formatting controls:
|*
|* "%d" decimal-printed integer
|* "%x" hex-printed integer
|* "%f" floating-point number
|* "%s" null-terminated char string
|* "%c" ascii-printed byte (low byte of int)
|* "%b" binary-printed byte (low byte of int)
|*
|* "%" sign followed by anything else prints that character.
|*
|* 0x0a end-of-line (clears screen when another
|* char is printed)
|*
|* guarantees printing up to 80 characters; a given printf that
|* tries to print more than 80 characters runs the risk of the
|* excess characters being truncated.
|*
|* uses following routines:
|*
|*     check_printbuffer returns # of free bytes in string
|* buffer in D.
|*
|*     putchar places A in string buffer.
|* returns with C set if failed.
|* preserves B, X reg.
|*
|*     putchar_always places A in string buffer, despite
|* putchar claiming it's full (putchar
|* always lies and saves you one char.)
|*
|

----- Original Message -----
From: "Nick Golder" <purenrg@iastate.edu>
To: <lugnet.robotics.handyboard@lugnet.com>
Sent: Monday, December 04, 2000 11:41 AM
Subject: Re: printf question


I have also tried this idea.  Thanks for the suggestion though.  To be • more
exact about the character I am getting though, it is a letter Y with two
dashes in it.  Each dash being a third from the top and a third from the
bottom.  I am at my wits end.  Any help would be appreciated.  I have also
tried different boards and LCD panels to make sure it wasn't that.
Once again, thanks in advance.
-Nick
At 10:11 AM 12/4/2000 -0500, Brat Wizard wrote:
The correct syntax would be:

printf("\\\n");

The problem you're having is that the '\' character is a special • character
and needs to be escaped. The newline is also a special character and • needs
to be escaped. In your example, which one is being escaped??? The correct
way is to escape them both.

Hope this helps-

John


Nick Golder wrote:
I am having a problem with this line:
printf("\\n");

It is print some strange ASCII character that looks like an upside down
broom and I need it to print just a "\" (minus the parenths of course). • I
have also tried
this:
int d;
d=92;
printf("%c",d);
I still get the same result.
I am using IC 2.81.  Any help would be greatly appreciated.
Thanks in advance.
-Nick
purenrg@iastate.edu

--
+----------------------------------------------------------------------+
| "I'll give up my modem when they pry it from my cold, dead fingers!" |
| John Whitten -
brat@naxs.com  <http://www.wizard.org>http://www.wizard.org • |
+----------------------------------------------------------------------+




Message is in Reply To:
  Re: printf question
 
I have also tried this idea. Thanks for the suggestion though. To be more exact about the character I am getting though, it is a letter Y with two dashes in it. Each dash being a third from the top and a third from the bottom. I am at my wits end. (...) (24 years ago, 4-Dec-00, to lugnet.robotics.handyboard)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR