You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enter the following VB script code to convert
Dim a As Integer
a = 10:
temp = 10 And 20
temp = a Or 10
Actual Js :
var a; // Integer
a = 10;
temp = 10 && 20;
temp = a || 10;
Expected Js:
var a; // Integer
a = 10;
temp = 10 & 20;
temp = a | 10;
Note : In Vba the AND, OR and XOR functions as boolean operator as well as bit wise operator.
FYI http://visualbasic.about.com/od/usingvbnet/l/bldykand_or_not.htm
=======
The same issue is applicable While converting Boolean operators
Try converting this Vba to Js
e = 23 > 67 Xor 11 > 8
f = 23 > 14 Xor 11 > 8
g = 14 > 23 Xor e
g = e Xor 11 > 8
g = e Xor f
Actual Js :
e = 23 > 67 ^ 11 > 8;
f = 23 > 14 ^ 11 > 8;
g = 14 > 23 ^ e;
g = e ^ 11 > 8;
g = e ^ f;
Note : '^' is a bitwise operator in Js
Expected Js; Since Js does not have 'Xor' operator or it's equivalent, we can create a login to
build 'Xor' functionality. Hope this link may helpl
http://www.howtocreate.co.uk/xor.html
if( ( foo && !bar ) || ( !foo && bar ) ) {
...
}
Original issue reported on code.google.com by nikhilsi...@google.com on 16 May 2010 at 5:58
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
nikhilsi...@google.com
on 16 May 2010 at 5:58The text was updated successfully, but these errors were encountered: