getting path and filename from path+filename

Hi Is there any easy way of getting the path and filename from path+filename? That is, the user types in the full path like c:\temp\NewFolder\Myfile.txt and then I want to “extract” the information like this: Path= c:\temp\NewFolder\ Filename = MyFile (with or without extension) My solution would be, to make a Visual Basic program…But it would be nicer if it were possible to do it directly from within Navision:-) Jens

Here’s a function: SplitFilename(Filename : Text[250];VAR Path : Text[250];VAR Name : Text[250]) Path := ''; Name := ''; Filename := DELCHR(Filename,'<>'); IF (Filename = '') THEN EXIT; Pos := STRLEN(Filename); REPEAT Found := (COPYSTR(Filename,Pos,1) = '\'); IF NOT Found THEN Pos := Pos - 1; UNTIL (Pos = 0) OR Found; IF Found THEN BEGIN Path := COPYSTR(Filename,1,Pos); Name := COPYSTR(Filename,Pos+1); END ELSE BEGIN Path := ''; Name := Filename; END;

Hi SV Nice!! Thanks - I had some of the same ideas myself. Jens

Hi Jens I think I know where you’re working, so get a hold of SPD database and look for Codeunit 50075 !!!