DBPro doesn't have a boolean OR - it has bit-wise only, so using || is correct.
As you've pointed out, the problem was the 'Cam^2' - that should have been '2^Cam' instead. The exact same problem exists in the first line of the code too.
CamMask = (2^1) || (2^2) || (2^3)
for Cam = 1 to 32
//See if the camera was included in the mask
CamIncluded=CamMask && (2^Cam)
if CamIncluded>0
print "Camera ",Cam," Was Included in the mask!!"
endif
next Cam
wait key
You can also generate and test the mask using << and >> instead
CamMask = (1 << 1) || (1 << 2) || (1 << 3)
for Cam = 1 to 32
//See if the camera was included in the mask
CamIncluded = (CamMask >> 1) && 1
if bit get( CamMask, Cam )
print "Camera ",Cam," Was Included in the mask!!"
endif
next Cam
wait key
Finally, there are also some bit commands in my plug-in set that can also be used instead of the bitwise&power operators:
CamMask = bit set( CamMask, 1 ) ` Camera 1
CamMask = bit set( CamMask, 2 ) ` Camera 2
CamMask = bit set( CamMask, 5 ) ` Camera 5
for Cam = 1 to 32
//See if the camera was included in the mask
if bit get( CamMask, Cam )
print "Camera ",Cam," Was Included in the mask!!"
endif
next Cam
wait key