Minor scripting related wishes (a generic thread)

Features wanted...
j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

:roll: It's a good thing that all these quite lengthy beta release docs are coming at this time of the year when my business work load is almost zero! It takes a while to convert them to blog format...but at least I have the time, for now, to do it! :wink:
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

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

Post by admin »

j_c_hallgren wrote::roll: It's a good thing that all these quite lengthy beta release docs are coming at this time of the year when my business work load is almost zero! It takes a while to convert them to blog format...but at least I have the time, for now, to do it! :wink:
Timing is everything... :D

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

As j_c and I had both noticed (in PM) "xys" doesn't appear to be an extension associated with anything major at the moment, it might be worth treating it as an official XYplorer Script File extension.

Not that we really need one, but it wouldn't hurt either.

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

I'm taking the liberty of posting this PM reply from The Qwerty as I think it is worthwhile enough to be shared about the concept of making XYS an "official" extension:
TheQwerty wrote:Well immediately all it does is make you have to type more in loadScriptFile commands.
If Don updated the command to automatically check for a file with the extension first it would be the same as it is now.

If we could get the extension listed on the look up sites, it might go to further our case that XY is notable software and worthy of a wikipedia entry.
It would allow for the creation of syntax highlighting definitions in supporting editors.
It's certainly not needed but it does make a number of things easier and might be useful.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

j_c_hallgren wrote:I'm taking the liberty of posting this PM reply from The Qwerty as I think it is worthwhile enough to be shared about the concept of making XYS an "official" extension:
TheQwerty wrote:Well immediately all it does is make you have to type more in loadScriptFile commands.
If Don updated the command to automatically check for a file with the extension first it would be the same as it is now.

If we could get the extension listed on the look up sites, it might go to further our case that XY is notable software and worthy of a wikipedia entry.
It would allow for the creation of syntax highlighting definitions in supporting editors.
It's certainly not needed but it does make a number of things easier and might be useful.
heh... I was holding that back in case I needed ammo to convince Don of its use. :P

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

Post by admin »

TheQwerty wrote:
j_c_hallgren wrote:I'm taking the liberty of posting this PM reply from The Qwerty as I think it is worthwhile enough to be shared about the concept of making XYS an "official" extension:
TheQwerty wrote:Well immediately all it does is make you have to type more in loadScriptFile commands.
If Don updated the command to automatically check for a file with the extension first it would be the same as it is now.

If we could get the extension listed on the look up sites, it might go to further our case that XY is notable software and worthy of a wikipedia entry.
It would allow for the creation of syntax highlighting definitions in supporting editors.
It's certainly not needed but it does make a number of things easier and might be useful.
heh... I was holding that back in case I needed ammo to convince Don of its use. :P
I liked *.xys instantly! :D

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

I was using TheQwerty's scripts as a good way to try out some of those features, as I'd not really spent much time using scripting...and in doing so, decided to see how some other things work...like how "step" would work in this complex case.

My conclusions:
1) The error and step pop-up's could, IMO, really use some additional data, like the name of the script currently being executed, as it may be nested, and some clue as to what line nbr (or similar) that the error/step is at.

I can also see this being needed on the 'File not found' error when a LoadScript fails, as it may be nested within another script.

This info would be needed to help debug errors that may occur for script users who may be using ones written by others, and who aren't "script junkies" themselves, but are just executing canned code.

2) When one does a Cancel to a "User Input", it seems to not bail out totally as I'd expect, but goes on to next cmd, which in this case, was another UserInput, where I did a 2nd cancel, which thus caused a RegExp error as values weren't filled in, so I then had to OK out of that, which finally got the script to end! (I used opt #9 of "Both.xys" to get this)

3) When the Step cmd is used, and then a LoadScript is done, should the Step carry forward into that second script? I'm just posing the question, as I could see it either way...some debuggers go into subroutines, which this resembles, and others don't until control comes back.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

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

Post by admin »

j_c_hallgren wrote:I was using TheQwerty's scripts as a good way to try out some of those features, as I'd not really spent much time using scripting...and in doing so, decided to see how some other things work...like how "step" would work in this complex case.

My conclusions:
1) The error and step pop-up's could, IMO, really use some additional data, like the name of the script currently being executed, as it may be nested, and some clue as to what line nbr (or similar) that the error/step is at.

I can also see this being needed on the 'File not found' error when a LoadScript fails, as it may be nested within another script.

This info would be needed to help debug errors that may occur for script users who may be using ones written by others, and who aren't "script junkies" themselves, but are just executing canned code.

2) When one does a Cancel to a "User Input", it seems to not bail out totally as I'd expect, but goes on to next cmd, which in this case, was another UserInput, where I did a 2nd cancel, which thus caused a RegExp error as values weren't filled in, so I then had to OK out of that, which finally got the script to end! (I used opt #9 of "Both.xys" to get this)

3) When the Step cmd is used, and then a LoadScript is done, should the Step carry forward into that second script? I'm just posing the question, as I could see it either way...some debuggers go into subroutines, which this resembles, and others don't until control comes back.
1) Will wait until dust settles. Then it will be clear what's there and what should/can be shown.
2) Good question: I guess the script should end after a cancel!?
3) I'd leave it as it is because it's very natural from the coding perspective: scope of Step command is the script batch, but not any "subroutines".

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

As I wrote, I would expect that if I cancel on a UserInput dialog, that I've decided to abandon the script, either cause it was the wrong one or I may need to do something else first/instead....kinda like a cancel on a software install...you just bail out!

And I can wait for the info on error/step, but at least it's on the list.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

Is there anyway we could have a way to hide script batches from the load script file menus?


I had two thoughts on ways to do this:
1) If the label starts with a specific character (perhaps !) do not display it in the menu.

Example:
"Visible Script : vs"DoStuff (); Sub ("!hs");
"Hidden Script : !hs"DoOtherStuff ();

2) Add a special "command" (perhaps #HiddenItems) that can be placed within a script file so that any batches following this "command" will not be displayed.

Example:
"Visible Script : vs"DoStuff (); Sub ("hs");
#HiddenItems
"Hidden Script : hs"DoOtherStuff ();

In both cases the displayed menu would just be:
Visible Script

And obviously this would render the caption for the hidden script(s) redundant.


What I'm trying to achieve is a way to use Sub (); to simplify my script files, without making the displayed menu a mess or having to write a secondary file just to drive the menu.

Thoughts?

EDIT: This is not a request for DoStuff and DoOtherStuff functions. :lol:

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

Post by admin »

TheQwerty wrote:Is there anyway we could have a way to hide script batches from the load script file menus?
Makes sense! I'll see...

RalphM
Posts: 1932
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Post by RalphM »

Maybe we could just call the hidden scripts either Sub() or Function() and those wouldn't show in the menu.

Edit: Sorry, wrote this before checking the new beta and seeing there, that Don already made up his mind on this one
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

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

Post by PeterH »

In the thread :: Don wrote:
Caption is a visual identifier, label is a programmatic identifier. Beautiful symmetry wherever I look.
The rest of this symmetry seems to be "_label"?
By the way: I would have expected it should read "_:label". Is the former a short form of this?
But back to what I want to say: now we do have a (first) situation with label, but without a caption. (And I hope I'm right thinking, that a caption starting with _ that is: "_caption:label" makes no sense, as it has no meaning but "don't use this caption"?) And as I don't understand the argument for the current syntax I would like to ask again: why not change it to something like
label(caption)
where label is the label, one word without special chars, starting in column 1,
and (caption) contains the caption, which may be a quoted string.
If this should "not show in menu": don't write (...), but only the label.
And maybe: if caption should just be the label, write (=).

Advantages I see:
- label ist first word of script (never saw something else for a label)
- label never needs quotes (never saw that, too)
- "no caption" is just expressed by specifying no caption, not by saying by _ that none is meant.

Just to say: delimiters here are just examples and could be changed - what I would like to see are the 3 former rules.
Now, as (...) also can be used in operands, they seem less strange to me in this place, as was before. I still fell this is much more intuitive than the "label:coption" syntax.
Sorry: if I would have understood any reason for the current syntax, I wouldn't have asked again...

Any opinions?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

Any chance we could get a way to have global variables that can be used/set in Sub() and Load() commands?

I've got some scripts in mind but without such functionality they can't happen.

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

Post by admin »

TheQwerty wrote:Any chance we could get a way to have global variables that can be used/set in Sub() and Load() commands?

I've got some scripts in mind but without such functionality they can't happen.
Somebody had to pop this question sooner or later, and the answer is: Yes! :D -- But not now. :twisted: (By coincidence this afternoon I thought about it and found a cool way to implement it, resp. saw how easy it is to implement.)

Post Reply