I have to process a file where each row is a path:
<drive><path1>[path2]<filename>
Each row will become:
[path2]<filename>
where:
<> mandatory field (known length)
[] optional field (UNknown length)
that is I have to make a string's subtraction
I didn't find something ready to use in InstallShield function so I write this code:
Code Sample |
IN STRING completePath = <drive><path1>[path2]<filename> IN STRING fixedPath = <drive><path1> OUT STRING shortPath = [path2]<filename> ncompletePathLength = StrLength(completePath); nfixedPath = StrLength(fixedPath); nDiff = (ncompletePathLength - nfixedPath); StrSub (shortPath, completePath, nfixedPath, nDiff); |
is there something better optimized?
(I know among you there are code guru...)
Thanks.
Ciao, Giuseppe