SC: bug with quicksearch()

Things you’d like to miss in the future...
Post Reply
autocart
Posts: 1248
Joined: 26 Sep 2013 15:22

SC: bug with quicksearch()

Post by autocart »

This is actually a SC bug, but since it might need some brainstorming, maybe more questions & answers, I put it in a separate thread.

In one of my scripts I have the following line:

Code: Select all

$CorrSubTPLs = quicksearch($TPL_Prefix_InCaseOfSubTPL . $art_no . "_* /d", "$rootFolderForNewPartsLists\$subfolderNameForSubPartsLists", "|");
where all variables contain strings.
$TPL_Prefix_InCaseOfSubTPL . $art_no . "_* /d"
might resolve to
"TPL_4.201.23_* /d"
$rootFolderForNewPartsLists contains a full mounted path to a folder on the company server
and $subfolderNameForSubPartsLists contains the name of a subfolder under that full path.

BUG: Sometimes (randomly, as it seems) it happens that quicksearch in the line above returns (as the rusults look like) the names of all files and subfolders in "$rootFolderForNewPartsLists"
instead of, as I would expect in the example, all subfolders in "$rootFolderForNewPartsLists\$subfolderNameForSubPartsLists" starting with "TPL_4.201.23_". (In this case NO folder (nor file) exists there that would start with "TPL_4.201.23_".)

EDIT: I have never had that problem using listfolder() for to achieve the same, e.g. like that:

Code: Select all

listfolder("$rootFolderForNewPartsLists\$subfolderNameForSubPartsLists", $TPL_Prefix_InCaseOfSubTPL . $art_no . "_*", 2+8);

Post Reply