For static objects, there are two good examples that come with DBC. exam19.dba and exam23.dba
Here's an example for the hiding and showing of objects. There is a ring of 360 boxes around the camera position (I have them bouncing randomly so it looks kinda like an energy field for fun). In the upper left corner you'll see the current polygon count and the screen FPS. Press space to hide the objects that are out of view. Press it again to show all objects. Use arrow keys to move around.
set display mode 800,600,32
sync on
sync rate 0
autocam off
rem matrix for reference
make matrix 1,1000,1000,10,10
for obj=1 to 360
make object box obj,1,10,1
next obj
do
rem move camera
move camera (upkey()-downkey())*.5
yrotate camera wrapvalue(camera angle y()+((rightkey()-leftkey())*.5))
rem set up toggle switch for spacekey
os=ns
ns=spacekey()
if ns > os
toggle=1-toggle
endif
rem if toggle=1 hide out of view objects, else show all objects
if toggle=1
text 0,60,"Hiding out of view objects"
for obj=1 to 360
if object in screen(obj)=1 then show object obj
if object in screen(obj)=0 then hide object obj
if object visible(obj)=1
rem position objects in a circle around camera
position object obj,300*cos(obj)+camera position x(),rnd(30),300*sin(obj)+camera position z()
endif
next obj
else
text 0,60,"Showing all objects"
for obj=1 to 360
show object obj
rem position objects in a circle around camera
position object obj,300*cos(obj)+camera position x(),rnd(30),300*sin(obj)+camera position z()
next obj
endif
rem infoirmation
text 0,0,"Polygons "+str$(statistic(1))
text 0,20,"FPS "+str$(screen fps())
text 0,40,"Press SPACE to toggle hiding out of view drops"
sync
loop
Enjoy your day.