Functions
CheckFolderChar(folderName)
StrDelete(Str,delStr)
代码
//Jimmy Jun 14th 2010
static str StrDelete(str Sx,str Ds) //Sx = string Ds = delstr
{
int St,Fl,i=0,j;
;
Fl = StrLen(Sx);
St = strScan(Sx,Ds,1,Fl);
j = StrLen(Ds);
if (St>=1)
{
Sx = strdel(Sx,St,j);
Fl = strlen(Sx);
while (i<=10)
{
St = strScan(Sx,Ds,1,Fl);
if (St>=1)
{
Sx = strdel(Sx,St,j);
Fl = strlen(Sx);
}
i=i+1;
}
}
return Sx;
}
代码
/**
Jimmy- Jun 14th 2010
intercompany item picture handling
check special characters in a subfolder name
remove \ / : * ? " < > |
*/
static Str checkFolderChar(Str pFolderName)
{
Str mReturn = "";
Int mLoop;
;
for (mLoop=1; mLoop<=StrLen(pFolderName); mLoop++)
{
if ((substr(pFolderName, mLoop, 1) != "\\")
&& (substr(pFolderName, mLoop, 1) != "/")
&& (substr(pFolderName, mLoop, 1) != ":")
&& (substr(pFolderName, mLoop, 1) != "*")
&& (substr(pFolderName, mLoop, 1) != "?")
&& (substr(pFolderName, mLoop, 1) != '"')
&& (substr(pFolderName, mLoop, 1) != "<")
&& (substr(pFolderName, mLoop, 1) != ">")
&& (substr(pFolderName, mLoop, 1) != "|"))
{
mReturn = mReturn + substr(pFolderName, mLoop, 1);
}
}
return mReturn;
}