Mail Archives: djgpp/1998/03/24/03:10:00
Hello Dan,
Dan Chak <chakster AT geocities DOT com> schreef in artikel
<35134F49 DOT C51C6867 AT geocities DOT com>...
> I have the following code in a program of mine which (to me) seems to be
> harmless. However, I get an error with DJGPP that says "Error: Jump to
> case label" for the line that reads "case 3:". Can anyone help me
> figure out why??
Hmm, I am to lazy to set something up to try your snippet, but two things
come to mind when seeing the below piece of code.
>
> int choice;
> do {
> choice = mainMenu->update();
> switch (choice) {
> case 2:
in the following line you create a local variable and in that case (no pun
intended) you should put braces around such a case statement.
{
> BITMAP * card = load_pcx("10d.pcx", myPal);
> show_mouse(NULL);
> masked_blit(card, screen, 0, 0, 50, 50, 115, 177);
> show_mouse(screen);
> delete card;
> choice = 0;
> break;
}
> case 3:
> delete mainMenu;
Seeing your code this is something for Allegro isn't it? So why use delay,
try the rest() function from the Allegro lib and see if that's the
culperit. If you have installed the Allegro timer, delay will break your
program if I recal correctly.
> delay(2);
> break;
> }
> } while (!choice);
>
> Thanks,
Well I hope this helps... ;-))
> Dan Chak
--
Greetings from sunny Amsterdam,
Jan Bijsterbosch
email: bijster AT worldonline DOT nl
http://home.worldonline.nl/~bijster
- Raw text -