Question to InputSelect() style=1024

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Question to InputSelect() style=1024

Post by PeterH »

I started successfully to use InputSelect() with style=1024 to specify a line like
OperandName|13.2
where OperandName is the name of an operand,
and 13.2 is a code for "what to display" when selected, i.e. operand 2 of command 13.

Now an operand is [separator="|"] :veryconfused: (I *do* want to show the default!)
So the | is interpreted as separator between caption and data - bad...

Any idea what to do?

OK: the last idea is to specify a wish. But how could the unintended recognition of this fixed separator be disabled?
- define a 2nd sep, special for style=1024? Bad for syntax of InputSelect().
- define some escape char to ignore this | in text? All data must be scanned for |.
- define a new option where fixed-sep=something "exotic"? (I started to use filled triangles and squares for seps.)
- ???

Hm - bad situation. Any help?
Win11 Pro 223H2 Gerrman

jupe
Posts: 2811
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Question to InputSelect() style=1024

Post by jupe »

It just has to look like a pipe right? could you just replace the | in the string with a unicode equivalent (eg. ┃ << not a pipe) before inputselect is called, or easier before you build the string with the |13.2 part.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Question to InputSelect() style=1024

Post by PeterH »

Hi jupe,
thanks for the idea!
First I thought to "cheat" this way is bad - if e.g. someone copies such a text and wonders about the strange way that pipe works.
But then I noticed that you can't (yet) copy text from inputselect-display :whistle:

So I think I'll try this, if no other idea will be heared of.

It may last some time, as in the moment I'm restructuring the complete script logic...
...but this was planned, and I hope it will be much more variable that way.

Thanks again!
Win11 Pro 223H2 Gerrman

jupe
Posts: 2811
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Question to InputSelect() style=1024

Post by jupe »

I am not sure exactly how you intend to use that 13.2 data, but in case you're interested, below is one way of doing what I think you are trying to achieve without style 1024. I just mocked up a few sample entries for this example, in reality you could probably extract all of them from the docs via scripting though.

Code: Select all

  $cmds = <<<'>>>'
formatlist(list, [format], [separator="|"], [param], [flags])
quicksearch([query="*"], [path], [separator="<crlf>"], [flags])
regexreplace(string, pattern, [replacement], [matchcase])
zip_list2(zipfile, [separator="|"], [flags], [separatorProperties=<tab>)
>>>;
  $sel = inputselect(, $cmds, <crlf>, 0);
  if ($sel) {
    $sel = regexmatches($sel, "^\w+");
    help "idh_scripting_comref.htm#idh_sc_$sel";
  }

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Question to InputSelect() style=1024

Post by PeterH »

Sorry for being late!

In the moment I'm trying to do as much as I can only by the data I've generated.
And I'm also trying to create "kind of dialogs" with inputselect(). Before I just related on the line number as return - but this is hard if there are not only lines with lists of commands, but especially on top there are "independent" lines.
But I'm still testing out what I can do ...
... am surprised about some found abilities ...
... and am getting new ideas by the way :D

Sometimes it seems my biggest problem is to find a style for what I want to display :whistle:

All in all: very interesting.

Thanks for your interest!
Win11 Pro 223H2 Gerrman

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Question to InputSelect() style=1024

Post by PeterH »

@jupe
I've tested your "not a pipe" character - the results were rather strange: it occupies *2* characters - while (XY as well as my editor) only count 1. Result is that for the rest of the line the cursor is shown misplaced... :veryconfused:
But 1 char before or after (don't remember) this "wide" char an equivalent not-wide pipe-like symbol exists, and serves well to show a pipe-like not-a-pipe char. :tup:
(What an explanation :party: )

So your tip really helped - thanks again!
Win11 Pro 223H2 Gerrman

Post Reply