[Gambas-user] Shell or DesktopFile.RunExec()

T Lee Davidson t.lee.davidson at gmail.com
Mon Jul 23 20:19:27 CEST 2018


The DesktopFile class and, hence, its RunExec static method is, according to the wiki, specifically to provide for launching of
".desktop" files.

So, I would say that SHELL should be preferred, or EXEC if you do not need the capabilities of the system shell
(http://gambaswiki.org/wiki/doc/shellexec).



-- 
Lee


On 07/22/2018 03:17 PM, CD wrote:
> Hello,
> I need to run a program from another program.
> I first used "Shell":
> 
> sArgs = Shell$(sArgument1) & " " & Shell$(sArgument2)
> hdlProcess = Shell "MyProg " & sArgs
> 
> everything is working properly and I find in the MyProg code,
> Args.Count = 3:
> Args[0] is equal to Application.Name
> Args[1] is equal to sArgument1
> Args[2] is equal to sArgument2
> 
> If I'm using DesktopFile.RunExec() :
> sArgs = Shell $ (sArgument1) & "" & Shell $ (sArgument2)
> hdlProcess = DesktopFile.RunExec ("MyProg", sArgs)
> there a difference
> Args.Count = 2
> Args[0] is equal to Application.Name
> Args[1] is equal to sArgument1 & "" & sArgument2
> 
> Which command should I prefer?
> Shell or DesktopFile.RunExec ()
> 
> Regards
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 



More information about the User mailing list