Page 25 of 28

Re: Minor scripting related wishes (a generic thread)

Posted: 03 May 2016 19:17
by bdeshi
:ghost: :ghost: Can we get a <space> variable?

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 08:48
by admin
Space? You mean " "?

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 10:41
by bdeshi
yep.

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 12:20
by admin
And what would be the advantage over " "?

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 12:44
by PeterH
Maybe <space 27> :?:

(Just an idea :whistle: )

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 13:20
by admin

Code: Select all

echo strrepeat(" ", 27);

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 13:32
by bdeshi
same advantage that <tab> has over
"	"

and <tab 27> over strrepeat(
"	"
, 27);
:ugeek:

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 13:44
by admin
It's a bit harder to type a TAB than a " "...

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 13:50
by bdeshi
I should've said straight up that there's really no compelling reason for a <space> variable, other than the fact that <tab> and <crlf> exist already.
I was spurred on by the fact that AHK also has a %A_Space% variable... 8)

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 13:52
by PeterH
SammaySarkar wrote:<tab 27>
:shock:

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 14:35
by admin
SammaySarkar wrote:I should've said straight up that there's really no compelling reason for a <space> variable, other than the fact that <tab> and <crlf> exist already.
I was spurred on by the fact that AHK also has a %A_Space% variable... 8)
It makes me thinking. Apparently I give the impression I have nothing to do here, just sitting idly in front of my screen waiting for wishes to come in. :biggrin: Er, no, wrong. :mrgreen:

Re: Minor scripting related wishes (a generic thread)

Posted: 04 May 2016 14:52
by bdeshi
No big deal. :(

Re: Minor scripting related wishes (a generic thread)

Posted: 08 May 2016 14:49
by nerdweed
nerdweed wrote:Could you please give a little steroid to SC moveto and copyto - allow a way to supress the rich-copy dialog.
admin wrote:The dialog asks a question. You want me decide for you?
nerdweed wrote:No, I would decide in a scripted way.

If we go in a branch view and are invoking a script, I would know what I am doing. I am always hitting a No in this case and could always use a predetermined No in such scenarios. There can be four completely independent possibilites here (3 options - yes, no, cancel or show the dialog).

On the same lines, copyto and move to can make use of the on_collision field which is available for backupto. I often goto help file to see the format and stop after seeing it is backupto only. Occasionaly, do think about (ab)using backupto + delete instead of moveto, but drop the idea as it would involve actual bit copies of large files.

P.S. - I never asked before for on_collision because of the subtle difference in parameters for these 3 ops (and wrote this out of flow today)
admin wrote:Why not simply use backupto()?
nerdweed wrote:I already answered that :ninja:

BackupTo is an alternative to CopyTo. Not a very good alternative for MoveTo for moves on the same partition.
admin wrote:OK, but that wish is more complex than it might seem. Maybe next year.
Don, do you have some time for this now.

Re: Minor scripting related wishes (a generic thread)

Posted: 12 May 2016 19:00
by admin
Nope, sorry. Too complex for now.

Re: Minor scripting related wishes (a generic thread)

Posted: 17 May 2016 14:50
by bdeshi
Hiiiy, it's me with another wish!
PHP7's new combined comparison operator <=> can be pretty nice!

Code: Select all

// operator <=>
  text compare(1, 2);
  text compare(4, 3);
  text compare(5, 5);

function compare($a, $b) {
  return ($a > $b) ? 1 : ( ($a < $b) ? -1 : 0 ) ;
}