You shouldn't set the camera view in each loop cycle.
I modified your snippet a bit, is this what you wanted?
Rem Project: Dark Basic Pro Project
Rem Created: Saturday, December 15, 2012
Rem ***** Main Source File *****
set display mode 1280, 720, 32
set window position (desktop width() - 1280) / 2, (desktop height() - 720) / 2
sync on
sync rate 60
autocam off
make object cube 1, 1
dim viewport(2, 2)
viewport(0, 0) = 0 : set camera view 0, 0, 0, (screen width() / 2) - 1, (screen height() / 2) - 1 : color backdrop 0, 0xcccccc
viewport(1, 0) = 1 : make camera 1 : set camera view 1, screen width() / 2, 0, screen width(), (screen height() / 2) - 1 : color backdrop 1, 0xff7f7f
viewport(0, 1) = 2 : make camera 2 : set camera view 2, 0, screen height() / 2, (screen width() / 2) - 1, screen height() : color backdrop 2, 0x7fff7f
viewport(1, 1) = 3 : make camera 3 : set camera view 3, screen width() / 2, screen height() / 2, screen width(), screen height() : color backdrop 3, 0x7f7fff
position camera 0, 0, 0, -2 : point camera 0, 0, 0, 0 // Front
position camera 1, 0, 2, 0 : point camera 1, 0, 0, 0 // Top
position camera 2, -2, 0, 0 : point camera 2, 0, 0, 0 // Left
position camera 3, 2, 0, 0 : point camera 3, 0, 0, 0 // Right
sync mask 0xf // Only render the above 4 cameras by default (1 + 2 + 4 + 8 = 15)
while not escapekey()
// Over which viewport is the mouse cursor?
mx = mouseX() / (screen width() / 2)
my = mouseY() / (screen height() / 2)
// Pick the object by holding the LMB over it
if mouseclick() = 1
// Set the current camera to the corresponding viewport camera for use with the pick object function
set current camera viewport(mx, my)
// Pick the object
obj = pick object(mousex(), mousey(), 1, 1)
text mx * (screen width() / 2) + 20, my * (screen height() / 2) + (screen height() / 4), "Picked object " + str$(obj)
endif
text 0, 0, "Front"
text screen width() / 2, 0, "Top"
text 0, screen height() / 2, "Left"
text screen width() / 2, screen height() / 2, "Right"
yrotate object 1, wrapvalue(object angle y(1) + 0.5)
sync
endwhile
"Why do programmers get Halloween and Christmas mixed up?" Because Oct(31) = Dec(25)