Go to Post [Pi day] is an irrational holiday - KenWittlief [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-03-2004, 09:50
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: printf bug - beware!

Quote:
Originally Posted by gwross
Bill and Mark, if you could share your code, it would be appreciated.
Here's mine.

I didn't include some related minor changes made to the ifi_utilities functions.
We added "0x" in front of the hex prints and added a compile flag "_NO_PRINTS", so we could easily turn on/off all prints.

We kept the 80 byte limitation, but truncate strings at 80 bytes. I suppose I could have added "..." or something at the end of a truncated string to indicate when a text string is too long, but this code doesn't create one huge string.
It also doesn't care about the size of the variable being printed. There are separate calls for printing signed vs unsigned integers, and I never paid any attention to floats.
It's inefficient in that it outputs in discrete chunks.

I made it as simple as I could, so the newbie programmers could more easily follow the logic.
Send me any improvements you think of.
Attached Files
File Type: zip prints.zip (1.7 KB, 39 views)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 10-03-2004 at 17:12.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
printf and newlines Jeff McCune Programming 5 21-02-2004 21:09
Printf warning during compile? actorindp Programming 4 20-02-2004 17:02
printf isn't printf-ing. Help! Meandmyself Programming 14 15-02-2004 16:27
clear printf box? telefragger2000 Programming 6 05-02-2004 17:40
Last Call for bug reports rbayer Programming 0 08-01-2003 02:48


All times are GMT -5. The time now is 03:07.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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