1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | PT := ADR(FileName); l := stu.StrLenW(FileName); SLASH_CNT := 0; FOR pos := 1 TO l DO IF pt^ = GC_sparkplug.FW_SLASH THEN SLASH_CNT := SLASH_CNT + 1; END_IF; PT := PT + 1; END_FOR; RightMostAfterLastSlash := l - SLASH_CNT; FileName : T_MaxString; // File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) END_VAR VAR SLASH_CNT : UINT; l: DINT; pt : POINTER TO WSTRING; pos: DINT; |