Autor Tema: ConTEXT launches incorrect executable  (Leído 5431 veces)

Treval

  • Newbie
  • *
  • Mensajes: 15
  • Karma: 0
  • I can do anything!
    • Treval's Project
ConTEXT launches incorrect executable
« en: Diciembre 26, 2008, 02:09:40 pm »
Hello.

I have followed and applied the instructions as described in here.
In ConTEXT, I have done the following steps:
1. File > Save As > Fenix (.prg)
2. F10 (bgdc)
3. F11 (bgdi)

Now, it launches the context executable instead of bgdi, like I configured. Why is this?
Screenshot
« última modificación: Diciembre 27, 2008, 04:11:15 pm por Sandman »


Treval aka Badman


SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12919
  • Karma: 378
Re: ConTEXT launches incorrect executable
« Respuesta #1 en: Diciembre 26, 2008, 02:29:19 pm »
look this http://forum.bennugd.org/index.php?topic=173.0 and this http://forum.bennugd.org/index.php?topic=165.msg2050#msg2050

It's said that you must go to "options/enviroment key options/run keys/add" (maybe can be others label options, I don't have ConTEXT now) and you must type "prg". Then you must close "ConTEXT" and run "fixbennu.reg"... and then you can use ConTEXT.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Treval

  • Newbie
  • *
  • Mensajes: 15
  • Karma: 0
  • I can do anything!
    • Treval's Project
Re: ConTEXT launches incorrect executable
« Respuesta #2 en: Diciembre 26, 2008, 06:37:58 pm »
Didn't work..
Any other suggestions?
« última modificación: Diciembre 27, 2008, 04:10:33 pm por Sandman »


Treval aka Badman


SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12919
  • Karma: 378
Re: ConTEXT launches incorrect executable
« Respuesta #3 en: Diciembre 26, 2008, 06:41:03 pm »
You already try uninstall previous ConTEXT version and delete registry entries?

other suggestions: yes, don't use ConTEXT... you have others options...

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

Treval

  • Newbie
  • *
  • Mensajes: 15
  • Karma: 0
  • I can do anything!
    • Treval's Project
Re: ConTEXT launches incorrect executable
« Respuesta #4 en: Diciembre 26, 2008, 06:59:21 pm »
I have uninstalled ConTEXT, reinstalled it, ran the fixbennu.reg.
Now it compiled, but nothing happens when I run the interpreter:
As you can see here.

I want to be able to use ConTEXT.

[edit]
Now it works.
But why doesn't it launch my Bennu program in a new Fenix window?
Why does it launch it in the output window of ConTEXT?
« última modificación: Diciembre 27, 2008, 04:10:02 pm por Sandman »


Treval aka Badman


Sandman

  • Sr. Member
  • ****
  • Mensajes: 298
  • Karma: 48
Re: ConTEXT launches incorrect executable
« Respuesta #5 en: Diciembre 26, 2008, 07:49:52 pm »
Now, it launches the context executable instead of bgdi, like I configured. Why is this?
Screenshot
This was probably because the execute field in the execute button config was not setup properly. Context uses ConExec.exe to start other programs.

But why doesn't it launch my Bennu program in a new Fenix window?
Why does it launch it in the output window of ConTEXT?
Because the option Capture console output is enabled for that specific key. This is a choice.
-- Sandman

Treval

  • Newbie
  • *
  • Mensajes: 15
  • Karma: 0
  • I can do anything!
    • Treval's Project
Re: ConTEXT launches incorrect executable
« Respuesta #6 en: Diciembre 26, 2008, 08:02:18 pm »
Many thanks for your input on that, Sandman.

Why does example a run and example b not?
I don't know why but it only seems to work when I exclude the timer..
« última modificación: Diciembre 27, 2008, 04:08:42 pm por Sandman »


Treval aka Badman


SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12919
  • Karma: 378
Re: ConTEXT launches incorrect executable
« Respuesta #7 en: Diciembre 26, 2008, 09:15:09 pm »
not, don't show output because code in while never is executed...
you never think in put a "say (get_timer());" before while?

Try this...

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

process Main();
private
    start;
begin
    start = get_timer();
    while(start + 1000 > get_timer());
        say ("Hello World! @"+ get_timer());
        frame;
    end
end
« última modificación: Diciembre 26, 2008, 09:23:29 pm por SplinterGU »
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Treval

  • Newbie
  • *
  • Mensajes: 15
  • Karma: 0
  • I can do anything!
    • Treval's Project
Re: ConTEXT launches incorrect executable
« Respuesta #8 en: Diciembre 26, 2008, 09:28:22 pm »
I don't understand why that code was put online if it does not execute.
Here

[edit]
Also, it appears get_timer() gets the amount of milliseconds since 0:00:00 (since the day began),
not time the program has been running in milliseconds. , as stated here (this is directed to Sandman).

(get_timer()/1000)/3600 = hours passed in current day.
« última modificación: Diciembre 27, 2008, 04:07:57 pm por Sandman »


Treval aka Badman


SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12919
  • Karma: 378
Re: ConTEXT launches incorrect executable
« Respuesta #9 en: Diciembre 26, 2008, 09:36:58 pm »
I don't know... I never wrote in wiki... maybe you must ask to Sandman where he get this sample...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12919
  • Karma: 378
Re: ConTEXT launches incorrect executable
« Respuesta #10 en: Diciembre 26, 2008, 10:23:38 pm »
Well... this is a bug... mod_timer need initialization of SDL_TIMER...

Thanks.

add an 'import "mod_screen";'
« última modificación: Diciembre 26, 2008, 10:26:32 pm por SplinterGU »
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Sandman

  • Sr. Member
  • ****
  • Mensajes: 298
  • Karma: 48
Re: ConTEXT launches incorrect executable
« Respuesta #11 en: Diciembre 27, 2008, 01:08:57 am »
I don't understand why that code was put online if it does not execute.
Here

[edit]
Also, it appears get_timer() gets the amount of milliseconds since 0:00:00 (since the day began),
not time the program has been running in milliseconds. , as stated here (this is directed to Sandman).

(get_timer()/1000)/3600 = hours passed in current day.
I am sorry for that. I write documentation mostly by heart and thought this particular example was so rudimentary it was not worth testing. Silly of me actually for such a small effort. Mostly my documentation is not validated or corrected, so I thank you for that.

However, the documentation is correct. The function get_timer() in mod_time returns SDL_GetTicks() and the documentation of SDL_GetTicks() says:
Citar
Returns the number of milliseconds since SDL library initialization. This value wraps around if the program runs for more than 49.7 days.

Thanks for finding this bug, though.

Sidenote to SplinterGU:
SDL_GetTicks() returns an unsigned integer of 32bit. Maybe get_timer() should return this too, instead of a signed integer of 32bit. You can assign it to an unsigned int without problem, but it's more beautiful to return unsigned as well.
-- Sandman

SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12919
  • Karma: 378
Re: ConTEXT launches incorrect executable
« Respuesta #12 en: Diciembre 27, 2008, 01:33:33 am »
Sidenote to SplinterGU:
SDL_GetTicks() returns an unsigned integer of 32bit. Maybe get_timer() should return this too, instead of a signed integer of 32bit. You can assign it to an unsigned int without problem, but it's more beautiful to return unsigned as well.

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

Rovinator

  • Newbie
  • *
  • Mensajes: 10
  • Karma: 0
Re: ConTEXT launches incorrect executable
« Respuesta #13 en: Diciembre 27, 2008, 01:43:26 am »
I think the program stays in the while loop so you get time to look at it, but the program finishes when it reaches it last end, thus closing your window in 1 ms! :-\