On Sat, 07 Dec 2013, MinnesotaJon wrote:
> If you are using SHELL, you can assign lines to variables.  If the string
> continues on multiple lines, assign the text to string variables, and
> concatenate those variables.  
> The example below merely shows SHELL accepting a string variable as its
> command string:
> 
> DIM sRes as String
> DIM shellString as String  
> 
>   shellString = "cat /proc/meminfo"
>   Shell shellString To sRes  
> 
> If you use EXEC, the flexibility is more limited, as the command cannot be
> contained in a variable, but the following will work:
> 
> DIM execString as String
> DIM sRes as String
>   execString = "/proc/meminfo"
>   Exec ["cat", execString] To sRes
> 

Of course, it can:

--8<----------------
Dim aExec As String[]
Dim sRes As String

aExec = ["cat", "/proc/meminfo"]
' Use aExec.Add() to add more arguments
Exec aExec To sRes
--8<----------------

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to