ConTEXT launches incorrect executable

Started by Treval, December 26, 2008, 02:09:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Treval

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


Treval aka Badman


SplinterGU

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

#2
Didn't work..
Any other suggestions?


Treval aka Badman


SplinterGU

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

#4
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?


Treval aka Badman


Sandman

Quote from: Treval on December 26, 2008, 02:09:40 PMNow, 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.

Quote from: Treval on December 26, 2008, 06:59:21 PM
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

#6
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..


Treval aka Badman


SplinterGU

#7
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...


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
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Treval

#8
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.


Treval aka Badman


SplinterGU

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

#10
Well... this is a bug... mod_timer need initialization of SDL_TIMER...

Thanks.

add an 'import "mod_screen";'
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Sandman

Quote from: Treval on December 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.
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:
QuoteReturns 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

Quote from: Sandman on December 27, 2008, 01:08:57 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

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! :-\