Skip to content

IsPathDelimiter ​

IsPathDelimiter checks within the parameter S for the character at the position given in Index, to determine if it is a path delimiter.

Declaration: Function IsPathDelimiter(const S : string; Index : Integer) : Boolean

A single example that would fail and return false if the path is "C:\Program Files...".

pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := IsPathDelimiter(Source.FileCon.CurrentFilename, 2);
end;

The following illustrates more examples.

pascal
procedure ScriptEvent(var Value:Variant);
var
  f: string;
begin
  F := 'C:\MyData\MyFiles\FileName.jpg';

 //Will return N (false)
 If IsPathDelimiter(f,2) then
    LogInfo('Yes it is')
 else
    LogInfo('No it is not');
  LogInfo('');

 //Will return Y (true)
 If IsPathDelimiter(f,3) then
    LogInfo('Yes it is')
 else
    LogInfo('No it is not');
  LogInfo('');
end;