delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/01/30/12:40:45

Message-ID: <20030130170755.54603.qmail@web13005.mail.yahoo.com>
Date: Thu, 30 Jan 2003 09:07:55 -0800 (PST)
From: Thomas Tutone <thomas8675309 AT yahoo DOT com>
Subject: Re: problem with fixed datatype (drawing simple arcs / pie segments)
To: djgpp AT delorie DOT com
Cc: M DOT Czamai AT gmx DOT net
In-Reply-To: <003301c2c82f$deb8b420$460c010a@Maddin>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--- Martin Czamai <M DOT Czamai AT gmx DOT net> wrote:
> "Thomas Tutone" <thomas8675309 AT yahoo DOT com> wrote:
> Subject: Re: problem with fixed datatype (drawing
> simple arcs / pie
> segments)
> 
> >
> >
> > "Martin Czamai" <M DOT Czamai AT gmx DOT net> wrote:
> > > my problem is, that I want to draw a something
> like
> > > a pie (circle
> > > segment) to some bitmap, but the current code
> > > doesn't work. Can
> > > somebody please tell me how to handle the fixed
> > > class correctly? This
> > > is extraction of the current code:

[incomplete code snippets snipped.]

> > > Maybe I'm too stupid, but I'm really interested
> in
> > > what's going wrong
> > > here. Please help!
> >
> > Martin, I don't think the problem is that you're
> too
> > stupid.  Rather, the problem is that you are
> violating
> > the first cardinal rule when asking for help in
> this
> > (and most other) newsgroups:  POST COMPILABLE
> CODE.
> > That means that we must be able to cut and paste
> what
> > you provide and compile it ourselves without
> changes.
> > We can't do that with what you provide.  The
> second
> > cardinal rule is make sure that the compilable
> code
> > you provide is short - no more than 50 lines is a
> good
> > rule of thumb.  Here you provide an "extraction" -
> > that's good - but it must be a self-contained
> > extraction that we can compile.  If we can't
> recreate
> > your problem, we can't help you.
> >
> > By the way, what the heck is "fix"?  Is that a
> class
> > defined in allegro?  And are you coding in C or in
> > C++?  It looks like some sort of hybrid.
_______________________________________________
> Hi Tom,
> 
> thanks for your reply. I'm sorry that I have
> violated some of the cardinal
> rules, even although I tried to cut the code as much
> down as possible.
> However, yes "fix" is a class that is based on the
> datatype "fixed" in
> Allegro. My problem seems to be the "how to use" the
> fixed datatype (or the
> class fix respectivly) that it draws the pie.
> Do you have experience on how to use those
> datatypes??
> Thanks for your help,
> Martin
> 

Okay Martin, a couple things.

First, please don't send me a personal reply if you
have questions - always post to the newsgroup.  I
probably won't know the answer to your question, since
I don't know squat about Allegro, but many others in
the newsgroup will.  I'm accordingly sending this, as
I did in response to to your original post, to the
newsgroup with a cc: to you.  (You're welcome to cc:
me if you post to the newsgroup, but I read the
newsgroup pretty regularly so it's not necessary.)

Second - and I'm sorry if I sound frustrated but
that's because I am - I feel like you didn't read, or
at least didn't understand, what I said before.  To
reiterate:

POST COMPILABLE CODE.

Not uncompilable snippets.  Something that we can cut
and paste and compile ourselves.  More specifically,
provide compilable code, describe what you expect it
to do, and then describe what it does instead.

Here's an example of compilable code:

#include <iostream>
using std::cout;
int main()
{
    cout << "Hello World.";
}

Here's an example of an uncompilable snippet:

    cout << "Hello World.";

You provided an uncompilable snippet, not compilable
code, and then when I pointed this out to you, you
didn't correct it.  If you want someone in the
newsgroup to help you, you need to provide a short
piece of compilable code that we can cut and paste
onto our own systems, describe what you wanted your
code to do, then describe what the code you posted
actually did instead.  Newsgroup users can compile
what you post and see what happens for themselves. 
They can't do this if you just post uncompilable
snippets.

Until you follow this advice, I don't think anyone is
going to help you - not because folks don't want to,
but because they probably can't, at least not without
great effort.  In addition, in the process of reducing
the problem to a short piece of compilable code, you
may well discover the solution for yourself.

Sorry for the lecture.  Believe it or not, I'm trying
to help.

By the way, like I asked you before - are you trying
to program in C or C++?  It matters, I think, because
I have the sense that you can't use the Allegro fix
class if you're programming in C, and you're not
supposed to use the Allegro fixed typedef if you're
programming in C++.  From the Allegro documentation:

"If you are programming in C++ you can ignore all the
above [about the "fixed" typedef] and use the fix
class instead, which overloads a lot of operators to
provide automatic conversion to and from integer and
floating point values, and calls the above routines as
they are required. You should not mix the fix class
with the fixed typedef though, because the compiler
will mistake the fixed values for regular integers and
insert unnecessary conversions."

Best regards,

Tom

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019