Platforms to show: All Mac Windows Linux Cross-Platform

Back to CatSearchMBS class.

CatSearchMBS.close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Catalog Search MBS MacClassic Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
The destructor.

There is no need to call this method except you want to free all resources of this object now without waiting for Xojo to do it for you.

CatSearchMBS.Search(volume as FolderItem, allowRecursiveSearch as Boolean) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Catalog Search MBS MacClassic Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes the Search engine.

Call this to initiate a search a volume. If the returned value is false, then an error has occured (either there is not enough free memory or the volume wasn't valid). If the returned value is true, everything is okay.

The volume parameter can be anything that identifies the volume, including any file or folder on it.

If allowRecursiveSearch is true and the volume is a folder you search only the folder on this volume, but using recursive directory search.

The allowRecursiveSearch parameter determines whether the search shall use the slower recursive directory scan method if the volume does not support CatSearchMBS. If you pass false for a volume that does not support CatSearchMBS, this method will fail, and return false.

Update: Newer plugin versions (4.x?) allow to search folders if allowRecursiveSearch=true.

CatSearchMBS.SearchNext as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Catalog Search MBS MacClassic Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Searches for the next machting file
Example
// Here's an example of a proper search loop:

dim cs as CatSearchMBS
// ....

dim response as Integer
do
If UserCancelled then
exit
end
response = cs.SearchNext
if response = 0 then
// ... read cs.result and process the found item
end
loop until response < 0

Once the search criteria has been set, call this function repeatedly as long as it returns non-negative values.
Once the result is negative, the search is finished and CatSearchClose should be called.

These are the possible non-negative return values:
0a match has been found, and the found item can be inquired by calling Result.
1a certain amount of time has passed (see ResponseTimeout). You can ignore this result and continue to search.
2files or folders were added or removed to the volume. You may ignore this error by simply continuing the search.
-39 (eofErr)end of search, no more matches

The items on this page are in the following plugins: MBS MacClassic Plugin.


The biggest plugin in space...