"Fossies" - the Fresh Open Source Software Archive

Member "sip-0.12.1/macros/sip_exec.sci" (13 Oct 2011, 505 Bytes) of package /linux/privat/sip-0.12.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Scilab source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 function sip_exec(myfiletoexec)
    2 // This is just a misc. scilab utility; this functionality shall appear in
    3 // Scilab 6.
    4 //
    5 // Like exec but picks the file from PATH so you don't have to specify the full
    6 // path every time.
    7 //
    8 // AUTHOR
    9 // Allan CORNET http://bugzilla.scilab.org/show_bug.cgi?id=10094
   10 
   11 ps = getenv('PATH');
   12 ps = strsplit(ps,':')
   13 
   14 for i = 1:size(ps,'*')
   15   p = fullpath(ps(1), myfiletoexec)
   16   if isfile(p) then
   17     exec(p);
   18     return
   19   end
   20 end
   21 
   22 error('file not found in PATH');
   23 endfunction