[fpc-pascal] Paths on different OS's

L505 fpc505 at z505.com
Thu Jul 14 22:46:24 CEST 2005


|
Path:=ExtractFileDir(ParamStr(0)+PathDelim+'SomePath'+PatHDelim+'Directory'+PatH
Delim+'etc'+PathDelim;
|
| Is cross platform, or
|
|
Path:=ExtractFileDir(SetDirSeparators(paramstr(0)+'\somepath\directory\etc\'));
|
| DoDirSeparators is the same as SetDirSeparators, but operates on a var param.
|
| All these functions are in sysutils, and are documented.
|

Thanks, I remember coming across them in the docs somewhere before!
The second example you mentioned might be easier on the eyes in the source code.
A little extra CPU, but oh well.





More information about the fpc-pascal mailing list