Hi,
Could somebody show me how I "should" be writing this VB script that is meant to be a replacement for the Javascript "shift left" operator, here is the code I've been using to test it,
it seems to only work correctly with very low values, then the higher the values the more the VBScript differs from the Javascripts until it overflow errors out.
Thanks.
Could somebody show me how I "should" be writing this VB script that is meant to be a replacement for the Javascript "shift left" operator, here is the code I've been using to test it,
Code:
<script language="JavaScript">
function leftshiftjs(op,n) {
alert( op << n )
}
</script>
<script language="VBScript">
Function leftshiftvb(op,n)
Dim shiftleft, i
shiftleft = op
For i = 0 To n - 1
shiftleft = shiftleft * 2
Next
msgbox(shiftleft)
End Function
</script>
<button onclick="leftshiftvb(2,46)">TestVB</button>
<br>
<button onclick="leftshiftjs(2,46)">TestJS</button>
it seems to only work correctly with very low values, then the higher the values the more the VBScript differs from the Javascripts until it overflow errors out.
Thanks.