드라이브, 패스, 파일명 분리 함수 ProcessPath
Posted at 2010/03/26 12:45// Posted in IT 관련/프로그램 개발팁
var
selectedFile : string;
drive : char;
path, fileName : string;
begin
// Ask the user to select a file
if PromptForFileName(selectedFile)
then
begin
// Display this full file/path value
ShowMessage('Selected file = '+selectedFile);
// Split this full file/path value into its constituent parts
ProcessPath(selectedFile, drive, path, fileName);
ShowMessage('drive = '+drive);
ShowMessage('path = '+path);
ShowMessage('fileName = '+fileName);
end;
end;
Result:
{ The user selects C:\Files\data.txt and hits OK }
Selected file = C:\Files\data.txt
drive = C
path = \Files
filename = data.txt
Selected file = C:\Files\data.txt
drive = C
path = \Files
filename = data.txt
'IT 관련 > 프로그램 개발팁' 카테고리의 다른 글
| 드라이브, 패스, 파일명 분리 함수 ProcessPath (0) | 2010/03/26 |
|---|