[Gambas-user] Gambas Internet Cafe

Rob sourceforge-raindog2 at ...94...
Tue Mar 30 02:17:06 CEST 2004


On Monday 29 March 2004 14:23, Dimitri Bellini wrote:
> Dear Rob
> 	i try to put your code but i have an error syntax in:
> - shell "mozilla-firefox" as MozProcess
> I cant understand why?

It looks like the infamous "Gambas hates tabs" problem.
If you copy it out of somewhere that won't put tabs on the 
clipboard (like Konsole) it might be okay, but otherwise you 
need to delete the whitespace at the beginning of the line in 
the gambas IDE (even if it appears to be spaces) and recompile.

Turns out you need to killall MozillaFirebird-bin (or whatever 
they call it now) to terminate mozilla because the shell script 
you run to start it seems to go away.

Here's actual working code copied out of my local gambas IDE 
(though I had it killing mozilla after 15 seconds, didn't wait 
an hour :) )

PUBLIC MozProcess AS Process
PUBLIC cutofftime AS Date

SUB StartMozilla()
    cutofftime = Now + (1.0/24.0)
    Timer1.delay = 1000 
    Timer1.enabled = TRUE
    SHELL "mozilla-firebird" AS MozProcess
END

PUBLIC SUB Timer1_Timer()

  IF Now > cutofftime THEN StopMozilla

END

SUB StopMozilla()
  timer1.Enabled = FALSE
  
  SHELL "killall -HUP MozillaFirebird-bin" WAIT
  WAIT 2
  SHELL "killall MozillaFirebird-bin" WAIT
  
  Message.Info("Sorry, your time is up!")
  
END


Rob





More information about the User mailing list