Home / lang / exec 
Edit  Rename  Undo  Refresh   
fr  de  es  it  nl  pl  pt  pt_BR  mk  sq  ca  ar  fa  vi  ja  ru  zh  zh_TW  eo 
Documentation
History  
EXEC - History
04/11/2007 04:03:22 - l.carlier
..............................................................................   ..............................................................................
                                                                                                                                                               
** If =*\WRITE*= is specified, you can send data to the command standard input   ** If =*\WRITE*= is specified, you can send data to the command standard input
                                                                                                                                                               
** If =*\READ*= is specified, then events will be generated each time the comm   ** If =*\READ*= is specified, then events will be generated each time the comm 
                                                                                                                                                               
If you use the =*\INPUT*= and =*\OUTPUT*= keywords instead of =*\READ*= and =*   If you use the =*\INPUT*= and =*\OUTPUT*= keywords instead of =*\READ*= and =*
                                                                                                                                                               
..............................................................................   ..............................................................................
                                                                                 {Seealso                                                                      
{Seealso                                                                         [cat/process] [comp/gb/process] [lang/lof]                                    
[cat/process] [comp/gb/process] [lang/lof]                                       }                                                                             
}                                                                                                                                                              
                                                                                                                                                               
08/28/2006 08:23:21 - gambas
..............................................................................   ..............................................................................
                                                                                                                                                               
  DIM sLine AS String                                                              DIM sLine AS String                                                         
                                                                                                                                                               
  LINE INPUT #LAST, sLine                                                          READ #LAST, sLine, -256                                                      
                                                                                                                                                               
  sOutput &= sLine                                                                 sOutput &= sLine                                                            
                                                                                                                                                               
..............................................................................   ..............................................................................
07/04/2006 08:44:33 - gambas
{syntax                                                                          {syntax                                                                       
[ _Process_ *\=* ] *EXEC* _Command_ [ *WAIT* ] [ *FOR* { { *READ* | *INPUT* }    [ _Process_ *\=* ] *EXEC* _Command_ [ *WAIT* ] [ *FOR* { { *READ* | *INPUT* }  
*EXEC* _Command_ *TO* _Variable_                                                 *EXEC* _Command_ *TO* _Variable_                                              
}                                                                                }                                                                             
                                                                                                                                                               
..............................................................................   ..............................................................................
                                                                                                                                                               
* If =*\WAIT*= is specified, then the interpreter waits for the command ending   * If =*\WAIT*= is specified, then the interpreter waits for the command ending
                                                                                                                                                               
* If =*\F\[../or]*= is specified, then the command input-outputs are redirecte   * If =*\FOR*= is specified, then the command input-outputs are redirected so t 
                                                                                                                                                               
** If =*\WRITE*= is specified, you can send data to the command standard input   ** If =*\WRITE*= is specified, you can send data to the command standard input
                                                                                                                                                               
..............................................................................   ..............................................................................
                                                                                                                                                               
If you use the =*\INPUT*= and =*\OUTPUT*= keywords instead of =*\READ*= and =*   If you use the =*\INPUT*= and =*\OUTPUT*= keywords instead of =*\READ*= and =*
                                                                                                                                                               
                                                                                 =_Name_= is the event name used by the [../../comp/gb/process] [../../def/obje 
                                                                                                                                                                
You can get a reference to the internal [/comp/gb/process] [../../def/object]    You can get a reference to the internal [/comp/gb/process] [../../def/object] 
                                                                                                                                                               
If you use the second syntax, the command is executed, the interpreter waiting   If you use the second syntax, the command is executed, the interpreter waiting
                                                                                                                                                               
{Example                                                                         {Example                                                                      
' Get the content of a directory                                                 ' Get the contents of a directory                                              
                                                                                                                                                               
EXEC [ "ls", "-la", "/tmp" ] WAIT                                                EXEC [ "ls", "-la", "/tmp" ] WAIT                                             
}                                                                                }                                                                             
                                                                                                                                                               
{example                                                                         {example                                                                      
' Same thing, but in background                                                  ' Get the contents of a directory into a string                                
                                                                                 DIM sOutput AS String                                                          
                                                                                 EXEC [ "ls", "-la", "/tmp" ] TO sOutput                                        
                                                                                 }                                                                              
                                                                                                                                                                
                                                                                 {example                                                                       
                                                                                 ' Get the contents of a directory into a string, but in background             
                                                                                                                                                               
DIM Content AS String                                                            DIM sOutput AS String                                                          
                                                                                                                                                               
EXEC [ "ls", "-la", "/tmp" ] FOR READ                                            ' A specific event name is used                                                
                                                                                 EXEC [ "ls", "-la", "/tmp" ] FOR READ AS "Contents"                            
                                                                                                                                                               
...                                                                              ...                                                                           
                                                                                                                                                               
PUBLIC SUB Process_Read()                                                        PUBLIC SUB Contents_Read()                                                     
                                                                                                                                                               
  DIM sLine AS String                                                              DIM sLine AS String                                                         
                                                                                                                                                               
  LINE INPUT #LAST, sLine                                                          LINE INPUT #LAST, sLine                                                     
                                                                                                                                                               
  Content = Content & sLine                                                        sOutput &= sLine                                                             
  PRINT sLine                                                                                                                                                   
                                                                                 END                                                                            
                                                                                                                                                                
                                                                                 PUBLIC SUB Contents_Kill()                                                     
                                                                                                                                                                
                                                                                   PRINT sOutput                                                                
                                                                                                                                                               
END                                                                              END                                                                           
}                                                                                }                                                                             
..............................................................................   ..............................................................................
                                                                                 {Seealso                                                                      
                                                                                 [cat/process] [comp/gb/process] [lang/lof]                                    
{Seealso                                                                         }                                                                             
[cat/process] [comp/gb/process] [lang/lof]                                                                                                                     
}                                                                                                                                                              
                                                                                                                                                               
07/04/2006 08:36:19 - gambas
{syntax                                                                          {syntax                                                                       
[ _Process_ *\=* ] *EXEC* _Command_ [ *WAIT* ] [ *FOR* { { *READ* | *INPUT* }    [ _Process_ *\=* ] *EXEC* _Command_ [ *WAIT* ] [ *FOR* { { *READ* | *INPUT* }  
*EXEC* _Command_ *TO* _Variable_                                                 *EXEC* _Command_ *TO* _Variable_                                              
}                                                                                }                                                                             
                                                                                                                                                               
Executes a command. An internal [/comp/gb/process] object is created to manage   Executes a command. An internal [/comp/gb/process] [../../def/object] is creat 
                                                                                                                                                               
The command must be specified as an array of strings containing at least one e   The command must be specified as an array of strings containing at least one e
                                                                                                                                                               
* If =*\WAIT*= is specified, then the interpreter waits for the command ending   * If =*\WAIT*= is specified, then the interpreter waits for the command ending
                                                                                                                                                               
* If =*\F\OR*= is specified, then the command input-outputs are redirected so    * If =*\F\[../or]*= is specified, then the command input-outputs are redirecte 
                                                                                                                                                               
** If =*\WRITE*= is specified, you can send data to the command standard input   ** If =*\WRITE*= is specified, you can send data to the command standard input 
                                                                                                                                                               
** If =*\READ*= is specified, then events will be generated each time the comm   ** If =*\READ*= is specified, then events will be generated each time the comm 
                                                                                                                                                               
If you use the =*\INPUT*= and =*\OUTPUT*= keywords instead of =*\READ*= and =*   If you use the =*\INPUT*= and =*\OUTPUT*= keywords instead of =*\READ*= and =*
                                                                                                                                                               
You can get a reference to the internal [/comp/gb/process] object created by u   You can get a reference to the internal [/comp/gb/process] [../../def/object]  
                                                                                                                                                               
If you use the second syntax, the command is executed, the interpreter waiting   If you use the second syntax, the command is executed, the interpreter waiting
                                                                                                                                                               
..............................................................................   ..............................................................................
02/15/2006 06:12:25 - gambas
..............................................................................   ..............................................................................
{Seealso                                                                                                                                                       
[cat/process] [comp/gb/process] [lang/lof]                                       {Seealso                                                                      
}                                                                                [cat/process] [comp/gb/process] [lang/lof]                                    
                                                                                 }                                                                              
                                                                                                                                                               
02/15/2006 06:11:59 - gambas
..............................................................................   ..............................................................................
                                                                                                                                                               
* If =*\WAIT*= is specified, then the interpreter waits for the command ending   * If =*\WAIT*= is specified, then the interpreter waits for the command ending
                                                                                                                                                               
* If =*\F[../or]*= is specified, then the command input-outputs are redirected   * If =*\F\OR*= is specified, then the command input-outputs are redirected so  
                                                                                                                                                               
** If =*\WRITE*= is specified, you can send data to the command standard input   ** If =*\WRITE*= is specified, you can send data to the command standard input
                                                                                                                                                               
..............................................................................   ..............................................................................
02/15/2006 06:11:51 - gambas
..............................................................................   ..............................................................................
                                                                                                                                                               
* If =*\WAIT*= is specified, then the interpreter waits for the command ending   * If =*\WAIT*= is specified, then the interpreter waits for the command ending
                                                                                                                                                               
* If =*\F[/lang/or]*= is specified, then the command input-outputs are redirec   * If =*\F[../or]*= is specified, then the command input-outputs are redirected 
                                                                                                                                                               
** If =*\WRITE*= is specified, you can send data to the command standard input   ** If =*\WRITE*= is specified, you can send data to the command standard input
                                                                                                                                                               
..............................................................................   ..............................................................................
07/24/2005 00:05:08 - gambas
Creation