- PR -

logical shift operators

1
投稿者投稿内容
Oregon
ベテラン
会議室デビュー日: 2001/08/01
投稿数: 52
お住まい・勤務地: Tualatin 97062
投稿日時: 2001-09-13 03:22
I don't know if this is documented but logical shift operators in w2k script should be escaped by '^' twice as follows:
コード:

@echo off
set /A x=(%1 + 1) ^<^< 2
set x
set /A x=(%1 + 1) ^>^> 2
set x



the w2k scripting never fail to amuse us

quiz: what about arithmetic operator '%' (mod) in script?

Oregon
ベテラン
会議室デビュー日: 2001/08/01
投稿数: 52
お住まい・勤務地: Tualatin 97062
投稿日時: 2001-09-21 03:19
引用:

quiz: what about arithmetic operator '%' (mod) in script?



doubling %% works in the batch script:
e.g.
コード:

set /A x=%1 %% %2

Oregon
ベテラン
会議室デビュー日: 2001/08/01
投稿数: 52
お住まい・勤務地: Tualatin 97062
投稿日時: 2001-09-28 00:53
but...
look out for other aspects of w2k scripting in other threads

'arithmetics' in "Look! Ma' the script can compute!"
'% operators' in "Dr Watson's % % argument"

w2k scripting is a land of mines
_________________
1

スキルアップ/キャリアアップ(JOB@IT)