Il domenica 15 novembre 2009 17:05:00 Charlie Reinl ha scritto: > Am Sonntag, den 15.11.2009, 15:40 +0100 schrieb Stefano Palmeri: > > Il domenica 15 novembre 2009 12:42:17 Charlie Reinl ha scritto: > > > Salut, > > > > > > I looking for a function or switch in gambas, > > > which gives me the path-string as relative path > > > and not the whole path up from / > > > > I'm not sure I understood. Do you mean > > > > PRINT File.BaseName("/home/user/mydocuments") > > > > --> mydocuments > > > > ? > > > > Stefano > > Salut, > > I mean "/home/user/myNiceProject/allOtherFiles/ThisDoc.txt" > to make "allOtherFiles/ThisDoc.txt" >
DIM sFullPath, sRelativePath as string sFullPath = "/home/user/myNiceProject/allOtherFiles/ThisDoc.txt" sRelativePath= File.BaseName(File.Dir(sFullPath)) &/ file.name(sFullPath) PRINT sRelativePath --> allOtherFiles/ThisDoc.txt Saluti, Stefano > or "/home/user/mydocuments/allOtherFiles/ThisDoc.txt" > out of "/home/user/myNiceProject" to make > "../mydocuments/allOtherFiles/ThisDoc.txt" > > Hope that's clearer now! > > Even the "/home/user" replaced by "~" could be. > But in a format, that all other functions which need a file as argument > can handle it. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user