Sintax change for quicksearch by goto

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Sintax change for quicksearch by goto

Post by zakhar »

I found today (under XY v. 24.90) that the sintax

Code: Select all

goto "location\?*$pattern*";
does not work - nothing will be found.
Instead

Code: Select all

goto "location\?$pattern";
- the variant without asterisks does work.
Did not find a word about it in help file.
May be I do something wrong, do not know, but it worked with asterisks until now.

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

Re: Sintax change for quicksearch by goto

Post by admin »

Since v24.80.0002 - 2023-08-12 13:42, dereferencing of variables (*$var) is supported also in interpolated strings (variables are resolved within quoted strings). So you have to take it apart to separate * and $:

Code: Select all

goto "location\?*" . "$pattern*";
That's a little unfortunate. I'm thinking of a better solution.

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Sintax change for quicksearch by goto

Post by zakhar »

admin wrote: 31 Aug 2023 08:14take it apart
Thank you!
I will take it apart. It works too.
For me it is important that the variant "lacation_1\;location_2\?" (two or more locations) works.

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Sintax change for quicksearch by goto

Post by zakhar »

I have now found that

Code: Select all

goto "location\;location\?"."$pattern -text- /d"
does not work, if $pattern contains "." .
Example:

Code: Select all

$pattern = "2022.08";
(This post is for additional information. I assume the answer is given under "31 Aug 2023 08:14".)

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

Re: Sintax change for quicksearch by goto

Post by admin »

I don't see a problem with the dot. Are you sure?

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Sintax change for quicksearch by goto

Post by zakhar »

admin wrote: 31 Aug 2023 15:10 I don't see a problem with the dot. Are you sure?
Yes, my problem is that I do not see any other cause, can't distinguish.
The example

Code: Select all

goto "location\;location\?"."$pattern -text- /d"
does not work, if $pattern contains "." . :veryconfused:

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

Re: Sintax change for quicksearch by goto

Post by admin »

Use this line to analyze the current search pattern:

Code: Select all

text <get find_queryparsed>;

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Sintax change for quicksearch by goto

Post by zakhar »

admin wrote: 31 Aug 2023 15:45 Use this line
Here my result (paths and text (text is one word of letters only) content are changed - but nothing more) is:
"
Query: 2022.08 -text- /d
Parsed: Name: "2022.08" AND Name: "*-text-*"

Search: Quick Search
Mode: Auto
SmartBooleanQueryParsing: Yes
Loose Boolean AND: Yes
ExtendedPatternMatching: Yes
MasterInvert: No
Tags DB Only: No

MatchCase: No WholeWords: No Invert: No
IgnoreDiacritics: No Path: No FindHidden: No

Search Path: C:\locatin_1\; C:\location_2\; C:\location_3\; C:\location_4\; C:\location_5\; C:\location_6\; C:\location_7\
Include Subfolders: Yes
Follow Junctions: No
".
I see asterisks that come not from my script.

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

Re: Sintax change for quicksearch by goto

Post by admin »

Auto-asterisks. There is no bug. Please refer to the Help.

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Sintax change for quicksearch by goto

Post by zakhar »

On v. 24.90.0100:
A structure like

Code: Select all

 goto "C:\location1\;
       C:\location2\;
       C:\location3\;
       C:\location4\;
       C:\location5\;
       C:\location6\;
       C:\location7\?"."2022 /d";
founds 28 folders for me and
a structure like

Code: Select all

 goto "C:\location1\;
       C:\location2\;
       C:\location3\;
       C:\location4\;
       C:\location5\;
       C:\location6\;
       C:\location7\?"."2022.08 /d";
does not find anything - no dereferencing of variables (mentioned here under "31 Aug 2023 08:14"), direct content is "2022.08". Is this goto-result not a bug?
Try it directly in "Scriting | Run script...".

There is one folder under folders found by first code example which contains "2022.08".
It can be filtered out after running the goto code using Live Filter with "2022.08" on that 28 found folders
or using the code

Code: Select all

filter $YearMonth;
with $YearMonth = "2022.08" in the script.

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Sintax change for quicksearch by goto

Post by zakhar »

On the other side:
The code in "Scriting | Run script..."

Code: Select all

 $q = "*2022.08*";
 goto "C:\location1\;
       C:\location2\;
       C:\location3\;
       C:\location4\;
       C:\location5\;
       C:\location6\;
       C:\location7\?"."$q /d";
founds the folder and the code

Code: Select all

 $YearMonth = "2022.08";
 $q = "*$YearMonth*";
 goto "C:\location1\;
       C:\location2\;
       C:\location3\;
       C:\location4\;
       C:\location5\;
       C:\location6\;
       C:\location7\?"."$q /d";
does not ... - here may be with dereferencing of variables (mentioned here under "31 Aug 2023 08:14").
The blue line above the list shows "2022.08*" with one asterisk after 8...

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

Re: Sintax change for quicksearch by goto

Post by admin »

Your friend: text <get find_queryparsed>;

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Sintax change for quicksearch by goto

Post by zakhar »

I found an other way:

Code: Select all

 $YearMonth = "2022.08";
 $YearMonth = "*".$YearMonth."*";
 goto "C:\location1\;
       C:\location2\;
       C:\location3\;
       C:\location4\;
       C:\location5\;
       C:\location6\;
       C:\location7\?"."$YearMonth AND -text- /d";
- THIS will do.
But it is not what it was... "It" was changed. I did not need $YearMonth = "*".$YearMonth."*"; and I did not need " AND " before. :)

I must say here that I placed my first post of "30 Aug 2023 23:04" under "Tips & Tricks Questions and Answers"
and found it next time I came to the forum under "Bugs". I find the placing under "Bugs" may be found aggressiv - it was not my intention.
It was planed as a peaceful question.

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

Re: Sintax change for quicksearch by goto

Post by admin »

Moved it to "Tips & Tricks Questions and Answers" :)

MBaas
Posts: 683
Joined: 15 Feb 2016 21:08

Re: Sintax change for quicksearch by goto

Post by MBaas »

Humm...I thought this thread might help me with my search problem, but it didn't. Just a remark: if "auto-asterisks" is such an interesting topic, it would be nice if it was easier to find in help (possibly an entry in the index) ;)
____________________________________________________________________________________
Happy user. Screen scaling 100% and W11Pro [Version 10.0.26200.7922], XY 28.30.0600 * * LinkTree

Post Reply