#STUDENT RESPONSE ANI3-C
7 messages in this thread
Jerry,
The program written for exercise 3 is:
// ———— program begins here —————
main()
{
//int count=1;
//int total=25;
int mx,my,ml,mr,mk;
//Qnumber(&total,1,50,"Enter the loop count:")
WaitClick(&mx,&my,&ml,&mr,&mk);
//for (count;count<=total;count=count+1) {
// printf("We're at number: %d.",count);
// Qtext("Wait.");
//}
printf("x:%d,y:%d,l:%d,r:%d,k:%d,mx,my,ml,mr,mk);
Qtext("Wait,");
}
//————-program ends here——————-
I get an error message "program cannot span lines at line 16". Help, please.
Jack
>>>JERRY>>>
Jack, look at this line carefully. Something's missing:
printf("x:%d,y:%d,l:%d,r:%d,k:%d,mx,my,ml,mr,mk);
What is the format for printf()?
printf("<stuff in quotes>",varlist);
You have so closing quote.
<<<JERRY<<<
Jerry,
Thanks for your last note – I added the missing quote and it flew like a bird.
NOW, however, I'm stuck on the next exercise (#4), in spite of proof reading
the code carefully. Even my wife pitched in, but I cannot locate an error.
The program runs, BUT It does not draw increasingly larger cirsleswith each
pick on the "Wait" dialogue. It runs me through the increasing count indicated
in the mnenu bar, but draws only one circle visible at the end, the first
radius, I would guess. It may be a logical error, I don't know. Can you help,
please? Thanks.
Jack (Program follows)
main()
{
int count=1;
int total=25;
int mx,my,ml,mr,mk;
printf("Pick the circle centerpoint:");
Qnumber(&total,1,50,"Enter the circle radius:");
WaitClick(&mx,&my,&ml,&mr,&mk);
for (count;count<=total;count=count+1) {
printf("We're at number: %d.",count);
Circle(mx,my,count);
Qtext("Wait.");
}
}
>>>Jerry>>>
It may be a logical error, I don't know. Can you help, please? Thanks.
The code looks okay,actually. Maybe I'm not seeing something now. 🙂
Let's look at a few other things. What Ink are you using?
<<<Jerry<<<
Hi Jerry,
I'm really excited. I looked at the ink, and it was accidentally set on
"scrape" from the other ANI course (ANI2), I changed it to opaque, and it runs
like a charm!
Now please tell me how you knew the question to ask that put me on the
right track and WHY the ink made such a clear difference in the
program bahavior. Thanks VERY much.
>>>Jerry>>>
Now please tell me how you knew the question to ask that put me on the right
track and WHY the ink made such a clear difference in the program bahavior.
Thanks VERY much.
You're welcome. As for how I knew, I didn't. I ran the question by DaveA,
and showed him the code. He didn't see a problem either so he suggested
checking the ink setting. I think he's been doing product support for
Animator Pro for too long.
<<<Jerry<<<
Whoa Jack,
Inks make _a_lot_ of difference – all the time. If you are just used to Opaque
(and now Scrape :{)) you should try them all out.
You can even do an action (draw a filled box), click on undo, change the ink,
and then click on redo to see the same box in the new ink.
It becomes a design issue whether to make a POCO routine use the current ink
(and tool in some instances), or to fix it in the POCO routine.
Chuck Jameson
Silver Tongue Software