RetroBASIC

Retrogamecoding(.org) => EGSL => Topic started by: Rick3137 on June 02, 2013, 06:23:06 PM

Title: System command
Post by: Rick3137 on June 02, 2013, 06:23:06 PM
 I have been doing a study of EGSL and I got stuck with the system() command. How does that work?
Title: Re: System command
Post by: Tomaaz on June 02, 2013, 10:18:58 PM
You can start an external program with it or execute system command. Undel Linux this

Code: [Select]
system("mkdir EGSL")

will create a new directory named "EGSL" in a current directory.

This

Code: [Select]
system("firefox")

will start Firefox browser (of course, if it's installed) and wait till the browser is closed before continue. It does the same job os.execute() in Lua does.
Title: Re: System command
Post by: Rick3137 on June 02, 2013, 10:25:45 PM
 Thanks Tomaas.  How do you do one like system("cmd") ?
Title: Re: System command
Post by: Tomaaz on June 02, 2013, 10:36:40 PM
Do you mean cmd.exe on Windows? I'm not that familiar with using console on Windows, but from this topic (http://forum.luahub.com/index.php?topic=3822.0) it looks like os.execute() uses cmd.exe by default. Sorry, if this is not what you're asking about. :)
Title: Re: System command
Post by: Rick3137 on June 02, 2013, 11:21:17 PM
 Command line programs, don't always work right. The window programs work fine. Oh well. Not important. Thanks.