3176
Script / Re: Debugger in 4.3 hangs MC on error
« on: June 01, 2014, 20:15:28 »Thanks again, I had managed to forget the link between MC.Explorer commands & scripts in looking through all the script functions
You pre-empted my query on tokenize...!!
----- I had been looking at this -Code: [Select]<array> StrTokenize2Array(<str> input, <str> delimiter);
but it doesn't like thisCode: [Select]$arr StrTokenize2Array($arr input, "." delimiter);
@var $name = $arr[0];
@var $ext = $arr[1];
Not sure what is wrong with my syntaxIt splits the string into letters & gives $arr[xx] for each character but this is not useful for a filename that is not a constant pattern.
But now I can skip past that issue for this script.
Code: [Select]
@var $path = "C:\\MyFolder\\MyFiles.txt";
@var $arr = StrTokenize2Array($path, ".");
But the problem with that is that if any other part of the path happens to have a "." it will be bad.You can also use string function
Code: [Select]
@var $path = "C:\\MyFolder\\MyFiles.txt";
@var $positionOfLastDot = StrRFind($path, ".");
@var $name = StrSub($path , 0, $positionOfLastDot);
@var $ext = StrSub($path , $positionOfLastDot, -1);
There are many ways to do the same thing
