Autor Tema: break(int n) and continue(int n)  (Leído 6917 veces)

FreeYourMind

  • Hero Member
  • *****
  • Mensajes: 5563
  • Karma: 125
    • GECA soft
Re: break(int n) and continue(int n)
« Respuesta #15 en: Julio 23, 2010, 07:14:29 am »
What means 'tal vez' ?
Hhehheheh, it's a joke ;)

etiqueta: it's the same, don't work.
An example please  :D

SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12541
  • Karma: 370
Re: break(int n) and continue(int n)
« Respuesta #16 en: Julio 23, 2010, 07:32:14 am »
works...

Código: [Seleccionar]
import "mod_say";

begin

    say ( "Init" );

    if ( 1 )
        goto label;
    end

    say ( "I don't must displayed!" );

    return;

label:
    say ( "I'm label!" );

end

if you had made an example you had solved it!
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

FreeYourMind

  • Hero Member
  • *****
  • Mensajes: 5563
  • Karma: 125
    • GECA soft
Re: break(int n) and continue(int n)
« Respuesta #17 en: Julio 23, 2010, 08:14:14 am »
Don't work, don't recognize the label.

Código: [Seleccionar]
IF (_key(_space, _key_down))
     GOTO label;
END

IF (_key(_space, _key_up))
     BREAK;
END

label: say("lol");

 >:( Some import, declaration is missing ?

FreeYourMind

  • Hero Member
  • *****
  • Mensajes: 5563
  • Karma: 125
    • GECA soft
Re: break(int n) and continue(int n)
« Respuesta #18 en: Julio 23, 2010, 08:26:20 am »
Your example works!!!!


Here is my example, don't work:

Código: [Seleccionar]
import "mod_say";
import "mod_key";

begin

    my_process();

LOOP

if (key(_esc))
    exit("");
END


FRAME;
END

end

PROCESS my_process()
BEGIN

say ( "Init" );

LOOP

  if (key(_space))
  GOTO label;
  END

  label: say("lol");

FRAME;
END

END


SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12541
  • Karma: 370
Re: break(int n) and continue(int n)
« Respuesta #19 en: Julio 23, 2010, 12:25:10 pm »
label must be aligned to margin left! :P
« última modificación: Julio 23, 2010, 12:27:03 pm por SplinterGU »
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12541
  • Karma: 370
Re: break(int n) and continue(int n)
« Respuesta #20 en: Julio 23, 2010, 12:30:53 pm »
works!

Código: [Seleccionar]
import "mod_video";
import "mod_say";
import "mod_key";
import "mod_proc";

begin

    my_process();

LOOP

if (key(_esc))
    exit("");
END


FRAME;
END

end

PROCESS my_process()
BEGIN

say ( "Init" );

LOOP

  if (key(_space))
  GOTO label;
  END

    frame;
continue;
label: say("lol");

FRAME;
END

END
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

FreeYourMind

  • Hero Member
  • *****
  • Mensajes: 5563
  • Karma: 125
    • GECA soft
Re: break(int n) and continue(int n)
« Respuesta #21 en: Julio 23, 2010, 12:52:35 pm »
Interesting error origin... It's posible to fix and ignore tabulation when using goto's ?

SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12541
  • Karma: 370
Re: break(int n) and continue(int n)
« Respuesta #22 en: Julio 23, 2010, 12:55:55 pm »
It isn't an error... It's is intentional... must be...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12541
  • Karma: 370
Re: break(int n) and continue(int n)
« Respuesta #23 en: Julio 23, 2010, 01:01:50 pm »
In other way, in this thread we talk only about a proposal GOTO syntax, the final GOTO syntax thread is other... I'll close this thread.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2