home *** CD-ROM | disk | FTP | other *** search
- PROCEDURE GetDriveAndPath(VAR S:string);
- { A procedure that returns a Pascal string containing the current drive,
- current path and all punctuation. Simply append a raw file name.}
- VAR
- i : integer;
- T : string;
- Path : string;
- DriveString : string;
-
- FUNCTION CurrentDisk:integer;
- {Returns an integer specifying the current drive. 0 specifies A, etc.}
- GEMDOS($19);
-
- PROCEDURE GetDir(VAR Ptr:string; DriveID:integer);
- {Puts a C string defining the folders currently open on DriveID
- into S. DriveID of 0 specifies the current drive.}
- GEMDOS($47);
-
- BEGIN {getdriveandpath}
- DriveString := CONCAT(CHR(ORD('A')+CurrentDisk),':');
- GetDir(Path,0);
- {Convert from C to Pascal.}
- i := 0;
- WHILE Path[i] <> CHR(0) DO
- BEGIN
- T[i+1] := Path[i];
- i := i+1;
- END;
- {Set the length}
- T[0] := CHR(i);
- S := CONCAT(DriveString,T,'\');
- END {getdriveandpath};
-