::

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

Post by admin »

fishgod wrote:
admin wrote:Let me pick out one point for now:
fishgod wrote::arrow: usage of brackets ( and ) which will include all parameters of a command. e.g.: ::filter(*.png;*.jpg) that would it also make it possible to use the same seperaters for commands and parameters without that nasty required space
"same separators"??? I do not see that.
for examle using a ; as command-seperator and as parameter-seperator would make it possible to use a syntax like this:

Code: Select all

filter(bla;bla;bla);filter(bla;bla)
:oops: Sure -- I guess I had separator-blindness for a minute...

However, I'd never use ; as argument separator anyway.

After some thinking (and a dinner) I agree fully with your notion of "nasty required space". This must be solved! Using quotes when necessary is probably the way... I try to make up my mind this time before talking to fast...

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: ::

Post by jacky »

admin wrote:The other solution would be to change the separator on the fly. Here's a possible syntax (might look strange at first, but I thought long about it and it's not that bad):

All the following scripts would be identical:

goto Desktop; selpos a
/# /goto Desktop# selpos a
/***/goto Desktop***selpos a
/::/goto Desktop::selpos a
/; /goto Desktop; selpos a


BTW, concerning the final ";":
goto Desktop; selpos a
goto Desktop; selpos a;

Also in CSS it is optional.
Yes, it looks good, I like it. So your examples are meant to places where we're supposed to ented a script (eg; UDC Run Script), right?
So to do the same with Go To, how would that work, just adding the official/default separator (to indicate this is a script) ?

Yeah, seems it looks good.

About the "nasty required space", I think the easiest (maybe not for you though) would be to have parameters to be either one word/number, or then require quotes.

But of course, there are the special cases that are open/openwith, where the quotes have an extra meaning and a parameter goes on after the quotes ended (eg. open "notepad" ReadMeXY.txt)
Proud XYplorer Fanatic

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

Re: ::

Post by admin »

RalphM wrote:So my vote goes to use similar syntax as other languages, where possible. Maybe Don needs to decide which one it should be, 'cos it might save him the most time by not having to face syntax problems all the time, that have already been thought about by other developers and solved in some way.
Exactly. The C-style-system works since decades so I guess it can't be that bad. Plus it's the most widely known scripting syntax, which makes usage easier and documentation as well.

These should function, and function all the same:
filter "*.png;*.jpg";selpos a;copyto "D:\Archive, 1\<dyyyymmdd>"
filter "*.png;*.jpg" ; selpos a ; copyto "D:\Archive, 1\<dyyyymmdd>"
filter "*.png;*.jpg";selpos a;copyto "D:\Archive, 1\<dyyyymmdd>";
filter "*.png;*.jpg";selpos "a";copyto "D:\Archive, 1\<dyyyymmdd>";

Rules:
- the last ; is optional
- spaces around ; are ignored
- arguments containing a ; must be quoted
- all arguments can be quoted
- if arguments contain quotes the quotes must be doubled
- brackets??? don't know yet -- does this look better???:
filter("*.png;*.jpg");selpos(a);copyto("D:\Archive, 1\<dyyyymmdd>")

BTW, I think quoting is better than escaping because there could be a file C:\blah\;oh.jpg ... so what's that "\;" now... needs double-escape "\\;" ... nasty.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: ::

Post by jacky »

admin wrote:Rules:
- the last ; is optional
- spaces around ; are ignored
- arguments containing a ; must be quoted
- all arguments can be quoted
- if arguments contain quotes the quotes must be doubled
- brackets??? don't know yet -- does this look better???:
filter("*.png;*.jpg");selpos(a);copyto("D:\Archive, 1\<dyyyymmdd>")
So this would work as well?
sep +;filter "*.png;*.jpg" ; selpos a ; copyto D:\Archive, 1\<dyyyymmdd>
Given that while there's a space, there is no ;

Looks good to me. The only thing I don't like is that selpos "a" syntax, because I wanted the quote to mean something special (find as you type) !
How would that work for open/openwith then ?


About brackets, unless you intend to have functions that returns data, I don't think they're necessary.
As for reading, it may be easier when it's all packed on one line, but when it comes to multi-line scripts I'm not sure it really helps, no.
Proud XYplorer Fanatic

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

Re: ::

Post by admin »

jacky wrote:
admin wrote:Rules:
- the last ; is optional
- spaces around ; are ignored
- arguments containing a ; must be quoted
- all arguments can be quoted
- if arguments contain quotes the quotes must be doubled
- brackets??? don't know yet -- does this look better???:
filter("*.png;*.jpg");selpos(a);copyto("D:\Archive, 1\<dyyyymmdd>")
So this would work as well?
sep +;filter "*.png;*.jpg" ; selpos a ; copyto D:\Archive, 1\<dyyyymmdd>
--->>> no that would parse D:\Archive as target, and 1\<dyyyymmdd> as source

Looks good to me. The only thing I don't like is that selpos "a" syntax, because I wanted the quote to mean something special (find as you type) !
--->>> simply dblquote would work ""find""; but maybe I rather add another parameter for it...

How would that work for open/openwith then ?
--->>> same: double all quotes, e.g. open ""winzip32"" -min

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: ::

Post by jacky »

admin wrote:So this would work as well?
sep +;filter "*.png;*.jpg" ; selpos a ; copyto D:\Archive, 1\<dyyyymmdd>
--->>> no that would parse D:\Archive as target, and 1\<dyyyymmdd> as source
even with "sep +" that put the param. separator to + and not coma ?
admin wrote:How would that work for open/openwith then ?
--->>> same: double all quotes, e.g. open ""winzip32"" -min
hmm... that looks a little weird, because you said: "all arguments can be quoted"
So since the full param for open would be: "winzip" -min
shouldn't it be like: open ""winzip" -min" :?:
Proud XYplorer Fanatic

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Post by PeterH »

Why not quote every string? As posted elsewhere before, to allow:
set world, "Don";
set s1 "Hello world";
set s2 "Hello " world
(First is 'hello world', second is 'Hello Don'!)
It might be neccessary to talk about space-chars in s2-setting.

No problem with
set abc, "x ; y & :: oder , . no problem";
Neccessary: quote-sign inside string must be doubled:
set xyz, "Result = ""47"""
allow 2 quote-chars: either of " and '
set xya, "result = '47'"
set xyb, 'result = "47"'
set xyc, "'result' = ""47"""

Need a list of operands? Maybe 4?
First set variables: varname, var1 and var2 to whatever you want, then
anycmd "op. 1", "OP ; 2", "OP , 3 with var" varname, "4" var1 var2 "...";

It seems to me that sometimes seperators of script and of receiving system are mixed up?
filter "aaa;bbb"
is only one operand, meaning a list. But the list doesn't matter script! (Or at least shouldn't)

Did I miss something?
(It's not from me - it's IBM REXX. And I love it :roll:
Must have code 10000s of lines...)

Now: come on and hit me with the nudelwood... 8)

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

Re: ::

Post by admin »

jacky wrote:
admin wrote:So this would work as well?
sep +;filter "*.png;*.jpg" ; selpos a ; copyto D:\Archive, 1\<dyyyymmdd>
--->>> no that would parse D:\Archive as target, and 1\<dyyyymmdd> as source
even with "sep +" that put the param. separator to + and not coma ?
admin wrote:How would that work for open/openwith then ?
--->>> same: double all quotes, e.g. open ""winzip32"" -min
hmm... that looks a little weird, because you said: "all arguments can be quoted"
So since the full param for open would be: "winzip" -min
shouldn't it be like: open ""winzip" -min" :?:
1. Oh yes, I overlooked the sep +. Probably because I had already decided to drop this command! :P Because it makes code hard to read and maintain, and with quoting it is not necessary anymore.

2. I give you a definite answer later -- I'm just writing the parser...

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

Post by admin »

PeterH wrote:Why not quote every string? As posted elsewhere before, to allow:
set world, "Don";
set s1 "Hello world";
set s2 "Hello " world
(First is 'hello world', second is 'Hello Don'!)
That calls for a concatenator: set s2 "Hello "+world, or set s2 "Hello ".world (PHP). But, I like the way PHP handles vars in quotes: "Hello $world" would be resolved to "Hello Don". Very practical. I hate quoting + concatenating in other languages...

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Post by PeterH »

I don't quite understand that. In your example I have a problem, if, as usual for me, my varname begins with a $? (There always is a risk, that part of a string is a varname... Have used a language, where every varname was prefixed by & - thats bad, I must say. Especially, if you need the string &i...)

And problem with concatenation? Just make simple version with implicite concatenation: 2 adjacent strings (a variable is just a placeholder for a string) are directly concatenated - ready!
set a = 'Ab,c'
set b = 'x' a ',y' 'z;z'
leads to b = 'xAb,c,yz:z

Every , inide a string is part of the string, every , outside is a separator for XY. So a , 'ab,c',b are 3 operands.

Never have a problem with any varname, never have a problem with (or without) spaces combined with delimiters, or spaces between concatenated strings and/or vars. No need for a concatanation-operator.

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

Post by admin »

PeterH wrote:I don't quite understand that. In your example I have a problem, if, as usual for me, my varname begins with a $? (There always is a risk, that part of a string is a varname... Have used a language, where every varname was prefixed by & - thats bad, I must say. Especially, if you need the string &i...)

And problem with concatenation? Just make simple version with implicite concatenation: 2 adjacent strings (a variable is just a placeholder for a string) are directly concatenated - ready!
set a = 'Ab,c'
set b = 'x' a ',y' 'z;z'
leads to b = 'xAb,c,yz:z

Every , inide a string is part of the string, every , outside is a separator for XY. So a , 'ab,c',b are 3 operands.

Never have a problem with any varname, never have a problem with (or without) spaces combined with delimiters, or spaces between concatenated strings and/or vars. No need for a concatanation-operator.
We'll see whether we need it.

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

Re: ::

Post by admin »

jacky wrote:
admin wrote:How would that work for open/openwith then ?
--->>> same: double all quotes, e.g. open ""winzip32"" -min
hmm... that looks a little weird, because you said: "all arguments can be quoted"
So since the full param for open would be: "winzip" -min
shouldn't it be like: open ""winzip" -min" :?:
Yes! :)

But these work just the same:
::open "winzip" -min
::open """winzip"" -min"

And sorry for all the syntax mess! XYwiki-(re)work-wise I mean...

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: ::

Post by jacky »

admin wrote:
jacky wrote:shouldn't it be like: open ""winzip" -min" :?:
Yes! :)

But these work just the same:
::open "winzip" -min
::open """winzip"" -min"
hmm... ok I haven't tried the new beta yet, but I don't understand that you said yes, like this would work ::open ""winzip" -min"
would it? the way i see it, it would be treated as: open + [empty string] + winzip + -min (with space in front), hence why it was quoted

It's like your example, which has me confused a bit as well :
msg ""quoted" ""sep,sep"" unquoted"; (*)
I'm not sure how "quoted" gets quoted here, I'll have to wrap my mind around that ""syntax"" I guess ;)
admin wrote:And sorry for all the syntax mess! XYwiki-(re)work-wise I mean...
No worries, I'll just be mad if you change it all again in two weeks :P ;)
Proud XYplorer Fanatic

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Post by PeterH »

...please change it today :roll:
Sorry, but just one problem in the moment. (It's quite late...)

I set some vars, and before I start work I want to control them. So here each to 2 lines concerning 2 vars:

set fname, "c:\" ;
set $dings, " -one, more- "
...
msg ...
...
"fname = '" fname "'" <br>
"$dings = '" $dings "'"
... ;

As I have a lot of vars, I have to display the name of the var in front of the value of the var, to know which var is meant. (Sorry for that sentence :oops: ) The result should be
fname = 'c:\'
$dings = ' -one, more- '
But this is impossible, with current syntax, I get something like:
c:\ = '"c:\"'"
" -one, more- = '" -one, more- "'

(But don't get me wrong - I think the way you're on is good :) )
More tomorrow - it was a long day today...

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

Post by admin »

PeterH wrote:...Sorry, but just one problem in the moment.
Live with it. If you only have one problem you are a lucky man. :)

Post Reply