View Single Post
  #13  
Old 04-21-2024, 06:32 AM
Spliff Spliff is offline
Registered User
 
Join Date: 04-07-2021
Posts: 207
There are some QS/AS designs, (a), (b), and (c) (see above, and below). For my task(s) at hand, I had found some (working!) solution for design (a), and came here this Sunday morning to share it, AND for explaining why my suggestion of a design (b) wasn't worth much, and why my suggestion for design (c) was much better indeed.

I then discovered your new design, which visually would be my design (c), so had high hopes (in spite of these hopes being turned down a little bit by your (as always, extremely concise wording)... and yes, technically, your design is (b), not (c), and yes, I cling to my solution for the time being, since design (b) (albeit looking as it was (c) then), at the end of the day, doesn't help me in any way for my current problems... but then, as said, I came a little bit late with my (necessarily theoretical) findings - now (unfortunately) being backed up by my (logically expectedly, useless) tries with v. ...17.

Thus, I can't hide my personal deception, for my means, but let's hope that for some of third parties' needs at least, (b) (in (c) appearance, hoho!) will be of real use then; I very much appreciate your effort though, and yes, I hadn't "seen" in time, had been aware of the superiority of (c), but not yet of its weight of importance for my problem, and probably most such problems, except for the very last days... ;-(


In what follows, YOU is the user, STRING is the string in the "Search for:" input box, GRID is the grid, in case as the grid-condition as a whole:

Above, I had presented two designs, one declared as better, one as lesser:

a) The then current, i.e. the previous one (i.e. before v17):
String
AND (implied/mandatory)
Grid

b) The "lesser" one:
String
AND/OR (= a toggle button in-between, AND being the default value)
Grid

c) The (in fact, much) "better" one:
String (logically as Grid's "row 0") (whenever there's a grid; else it's a stored QS)
AND/OR Grid row 1 (AND being the toggle's default) (technically grid row 1, logically grid's second one)
AND/OR more Grid rows (as always)

Now you have implemented (b), but with the appearance of (c) - which doesn't make it (c), obviously.


Now:

Logical (inclusive) OR (i.e. not exclusive XOR, of which we don't speak here) means, practically, MORE, tendentially (or=more, that's easy to remember), whilst logical AND, in practice, means LESS, and this paradox-on-first-sight resolves easily when we recall that both, AND and OR, apply to the conditions, not to the results, and more conditions, by AND, logically tend to shorten the result set, since more conditions are imposed on the "original" set.

(In what follows, let's also remember that String can be a construct of single string, and/or string and/or string... to a certain degree at least, I haven't tried this out thoroughly, and, as already said, with AND having precedence over OR (as in the abc).)

Let's assume that all "wanted" String strings are on level 2, and that you also have put the intertitling on level 2 (flag yellow=B=Bold; alternatively, you could have "marked" those Titles with a tag °t for example; in the end - we'll see this below, this tag = string solution for the Titles is even the only neat one, i.e. if you don't want to have "surplus", unwanted String "finds" - we'll come to that later)


Now, in (a) which was "(String) AND (Grid)":
String: xyz
AND (mandatory)
Grid: IndentLevel=2 (that's a valid condition since only xyz on level 2 are wanted)
> you get all xyz-items on level 2 but not the Titles ( as expected, so you add: )
OR Flag = yellow/Bold
> you will NOT get more results here (i.e. the bolded Titles) since OR is just another condition for the xyz items (which doesn't make sense (sic!), but since it's OR, it will at least not cut in your xyz results either); thus you add:
AND Flag=b
> cuts into your xyz results, i.e. will only show any bolded xyz items (whilst you wanted additional results instead, and anyway, you don't bold any of your "regular" items (but format important ones otherwise), since you don't want them to be visually mixed up with the Titles (which, necessarily = in order to maintain the tree order within the search, are within the same level 2 as their (conceptual, but not also technical) "child" items)


BUT what you CAN then (always in (a), or even now in (b), whilst NOT (being able of) taking advantage of (b)'s first-grid-row' AND/OR toggle):
Not only bold the intertitling (for your eyes only, haha), but also add a °t (technically needed now), to their title, or to their text, or wherever (or some other, similar STRING tag, obviously) and then:

Columns/Sort: Title0, ParentTitle2, TreeOrder3, IndentLevel1
String: xyz OR °t (the " OR °t" part by control-Enter in String)
Grid: AND IndentLevel = 2
> perfect result and thus my chosen solution, possible both in previous (a) and current (b), if, like me, you want all xyz items of level 2, together with their intertitling (and nothing else, e.g. xyz-items of levels>2 (since we have found that it's impossible to also sort these into the existing tree structure))


If you try, in (b) now (i.e. with the leading OR made possible), to "hold neat" the String, you will have to live with unwanted finds BUT which are BELOW the wanted ones, so that's technically possible, too, just a question of your preference, you either have neat search results, from my solution before, or you have a neat search string, as follows (Columns/Sort as before):

String: xyz
Grid: OR Flag=b
> again, you get the wanted results (i.e. the level-2-xyz with their intertitling, and we see here it's a real OR indeed, not a XOR), but below those, all other-level xyz finds (always given that level 1 is just there in your db for the (necessary) "ParentTitle" sort and doesn't contain any xyz-strings/items, obviously)
AND IndentLevel=2
> as without the AND since the AND (=the indent level) is just another condition for the Flag, NOT also for String (xyz, and which is what you will have wanted though), so, here again: 2-level-xyz's and Titles correctly ordered, then all level>2-xyz-items

Now you can fiddle around with these, String always xyz, then:
Grid: OR Flag=b
__AND (indented) Indent Level=2
> same as before (i.e. first what you want, then the unwanted level>2 xyz finds)

ditto for Grid OR and AND both indented,

whilst Grid:

AND IndentLevel=2
__OR Flag=b

and

__OR Flag = b
AND IndentLevel=2

> both show only the level-2 xyz items but no intertitling (and thus, it would not make sense to then fiddle around with the sort-order):


Since again, what looks like (c), is (b) in reality, so there is no way to add, in the Grid (sic!), BOTH
1) any additional condition(s) for the String, AND
2) any alternative condition(s) for the search but NOT also affecting the String condition,
at the same time:
it's either 1), with the first Grid row starting with AND,
or 2), with the first Grid row starting with OR:

No way out of this in current technical (b), and whatever you try: "It's the logic, stupid ;-)", in order to dare fudge Marilyn Monroe, or in other words, if you need a "mix", try to replace some non-String conditions by additional, "or", String conditions in case, so that the Grid can then either work independently of those (OR) or affect ALL of the String conditions at the same time (AND, might be quite rare...).

Hence:

Whilst previous (a) gave the only possibility to add additional String conditions via the Grid, current (b) also makes possible to add alternative conditions to the String condition (by first Grid row OR instead of it being the default AND), but not (yet) (as (c) would have done) the possibility to MIX alternative conditions AND additional String conditions.

Such a mix IS possible, obviously, if you leave the String empty, and put all necessary strings into the Grid (or with design (c), obviously, for global strings).


And here's the necessary code to smoothen / speed up such searches in (a) and (b): you just enter your "original" string (here xyz) and press Enter (you would need to have Tools-Options-Misc. - "Display selected item title in window title bar" ON, obviously):

$enter::
if winactive("ahk_exe UltraRecall.exe")
{
if winactive("distinct name of your stored search here")
{
controlgetfocus, s
if ( s == "Edit2" )
{
send, {end}
sleep, 100 ; ms
send, % " OR °t" ; or whatever additional global STRING condition(s)
; you need the % for the "", and you need the "" for the leading space
sleep, 100
send, {enter}
}
else
send, {enter}
}
; else if winactive("distinct name of another stored search here")
; as before, etc, then finally:
else ; any other Enter press in UR
send, {enter}
}
; else if winactive("some other application")
; ... etc
else ; for any app not listed before
send, {enter}
return


EDIT:
A "typo" above (any ":" and then ")" without a space in-between translate to some smiley), and just for completeness:
Possible "tag codes" (among more or less "readily available special chars) in MI do not include period and comma (.,) but are restricted to § and _ (e.g. §some or _some), whilst, as said, such characters in UR comprise the four chars ¬, ¦, § and ° (as used above).
And the recently added "Exclude" checkbox also helps enormously with constructing correct grids ;-)

Last edited by Spliff; 04-21-2024 at 07:46 AM.
Reply With Quote