I have written the following test to attempt to isolate the FILENAME from a drive, directories, and filename combined string. My code is as follows:
SETENV,TEST,C:\\JACK\\WAS\\HERE\\JACK.XLS
NotJustFile:
MsgBox,0,Test,%Test%
StringGetPos,FoundIt,Test,\\
MsgBox,0,FoundIt,%FoundIt%
IfEqual,FoundIt,1,Goto,HaveJustFile
ENVADD,FoundIt,1
StringTrimLeft,NewTest,Test,%FoundIt%
SETENV,Test,%NewTest%
MsgBox, 0,Test,%Test%
Goto,NotJustFile
HaveJustFile:
MsgBox, 0,Done,%Test%
However, after it isolates "JACK.XLS" it does not terminate as I would expect. With StringGetPost returning a 1 because it did not find the string and my program exiting with the string I need. Instead it returns a 5 and continues into a endless loop.
Do anyone have any suggestions on what is going on here?
Thanks in advance,