#1 17 Dec 2011 21:02

ALAN_B
Member
Registered: 17 Dec 2011
Posts: 2

Query/Complaint about use of "RSH Variable" under "SET /a ..."

One of us is wrong, and I do not think it is me wink

see
http://ss64.com/nt/set.html

You say

   LSH      <<
   RSH      >>

I believe it because you say so, and also it is consistent with my many years programming in 'C'.

Further down you say something quite inconsistent to everything else, and also within itself

   LSH Variable  <<=
   RSH Variable  <<=

Regards
Alan

Offline

#2 17 Dec 2011 21:49

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,018
Website

Re: Query/Complaint about use of "RSH Variable" under "SET /a ..."

From the examples:

SET /A _result="2<<3"
   (=16)   { 2 Lsh 3 = binary 10 Lsh 3 = binary 10000 = decimal 16 }

If you then create a variable

SET _sample=2

SET /a "_sample<<=3"
  (=16 and _sample now contains 16)

Offline

#3 18 Dec 2011 00:12

ALAN_B
Member
Registered: 17 Dec 2011
Posts: 2

Re: Query/Complaint about use of "RSH Variable" under "SET /a ..."

Unfortunately I was too concise / cryptic (take your choice)
Immediately after posting I realised this.

Regrettably I found there was no EDIT available so I hoped you would get my drift.

My concern is the apparent inconsistency between the two items in

   LSH Variable  <<=
   RSH Variable  <<=

That is two different names, i.e. LSH and RSH, both of which refer to the same bitwise operator
I would expect the truth to be two different directions of bit shifting operators , one per "name"

   LSH Variable  <<=
   RSH Variable  >>=

Regards
Alan

Offline

#4 18 Dec 2011 00:52

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,018
Website

Re: Query/Complaint about use of "RSH Variable" under "SET /a ..."

Ah, I see what you mean now, Thanks I'll fix up the page

(Also moving this topic to the meta section as its about the site rather than discussing CMD scripting)

Offline

Board footer

Powered by FluxBB