[Gambas-user] how to 'which' with gambas

Stefano Palmeri stefanopalmeri at ...152...
Sun Aug 13 02:28:30 CEST 2006


Alle 22:31, venerdì 11 agosto 2006, Rob Kudla ha scritto:
> On Fri August 11 2006 16:00, Stefano Palmeri wrote:
> > I was talking about a function that do the same job as
> > the command line "which".  Anyway it is surely
> > not a priority... I will continue to play with SHELL "which...
> 
> It should be possible to write such a function pretty easily.  
> Here is some pseudo-code.
> 
> function which(exename as string) as string
> 
> 	dim paths as new String[]
> 	dim path as string
> 	dim dirresult as new String[]
> 
> 	paths = Split(Application.Env["PATH"], ":")
> 	for each path in paths
> 		dirresult = dir(path, exename)
> 		if dirresult.count > 0 then
> 			return dirresult[0]
> 		end if
> 	next
> 
> 	return ""
> 
> end
> 
> 'Rob
> 

Thanks a lot for your suggestions!

Regards,

Stefano Palmeri






> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 




More information about the User mailing list