SC Quicksearch() returns corrupted string

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

SC Quicksearch() returns corrupted string

Post by Papoulka »

OK, this has nothing to do with fuzzy search, although I am using that. It's on a plain Windows 7 32-bit PC with 4GB RAM, not a virtual machine. XY v15.90.0028 ::fresh.

I have a large external USB drive "R:". Path "R:\target\" there has 5300 first-level folders. The folder names average ~50 chars long. My script, described here in simplified form, reads each folder name from that path and creates a new empty folder in path "G:\dumfold\" with the same name. G: is an internal SSD.

There is a match name $selbase, which I here set to "selbase". Then I use quicksearch() to search through G:\dumfold\ for target folders that come close to matching "selbase".

Here's the code, minus some irrelevant (I think) details:

Code: Select all

 $dumfold = "G:\dumfold";
 $trgpath = "R:\target";
 $trgpathlst = folderreport("dirsrel", r, $trgpath, , , "|");
 foreach ($targ, $trgpathlst, "|", e) {new("$dumfold\$targ", dir);}
 $selbase = "selbase";
 $targmbe = quicksearch("$selbase /n/d/fuzzy=30", $dumfold, "|");
THE PROBLEM is that the quicksearch result string "$targmbe" sometimes contains not only a few fuzzy-matched folder names from G:\dumfold\ (which is what I expect), but also, following those, the entire 5300-folder list of R:\target (with full R:... path info).

Since the quicksearch knows nothing at all about R:, my guess is that the very long strings involved (260K chars) cause an XY memory pointer to get confused. So the problem may not be with QS itself, but that's how it shows up here.

This happens repeatably in my script, when the QS match attempt follows the renaming of a folder in R:\target\. The rename would have resulted from the prior match attempt. So overall, my script successfully finds one match and renames an folder in R:\target, but on the next match attempt (the value of $selbase having been changed) quicksearch returns the junk string.

[Edit] The problem does not occur if the R:\target\ path has 1000 folders instead of 5300.

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC Quicksearch() returns corrupted string

Post by admin »

Not being on your system I cannot reproduce this, of course.

Please isolate the script line which returns the corrupted string, with all its parameters, and the corrupted string itself (or at least a part of it).

Post Reply