Jump to content




startup behaving differently to other run programs


  • You cannot reply to this topic
4 replies to this topic

#1 KaoS

    Diabolical Coder

  • Members
  • 1,510 posts
  • LocationThat dark shadow under your bed...

Posted 18 January 2013 - 12:52 PM

Hi guys, I ran into a most irksome issue yesterday and have yet to find the solution

In the shell program right by the end it locates your startup file and runs it, it uses the shell.run() command to do so. shell.run is just a wrapper for runLine() so they are essentially the same. after executing your startup file it starts the shell prompt from which you can launch programs, it uses the runLine() function to do so therefore we can assume they are run in the same way

if you run a program and include on the last line
os.queueEvent("terminate")
then the shell will error and terminate, this is important for top level overrides and it works fine however if you do the same in your startup file it does not terminate, as far as I can see the next os.pullEvent() is in the read() function used in the shell prompt but it does not terminate :(

does anyone know why?

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 18 January 2013 - 12:55 PM

doesn't read ( and sleep ) 'eat' all the events before starting? Meaning the event queue would be empty and it would not terminate as there is no terminate event...

#3 KaoS

    Diabolical Coder

  • Members
  • 1,510 posts
  • LocationThat dark shadow under your bed...

Posted 18 January 2013 - 12:57 PM

yes, but they eat them using os.pullEvent() so they still process the event, if it is "terminate" then the currently running program ends

try
os.queueEvent("terminate")
sleep(5)


#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 18 January 2013 - 01:00 PM

View PostKaoS, on 18 January 2013 - 12:57 PM, said:

yes, but they eat them using os.pullEvent() so they still process the event, if it is "terminate" then the currently running program ends

try
os.queueEvent("terminate")
sleep(5)
Hmmm ok... was just a theory...

#5 KaoS

    Diabolical Coder

  • Members
  • 1,510 posts
  • LocationThat dark shadow under your bed...

Posted 18 January 2013 - 01:01 PM

thanks :) I just wish you were right at the moment.... so frustrated lol





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users