`---------
`chase cam
`---------
function chase_cam(id)
`work out the angle of the object being chased
yAng#=wrapvalue(object angle y(id)+180)
`grab the objects current position
xPos#=object position x(id)
yPos#=object position y(id)
zPos#=object position z(id)
`other variables
camDist=15
camHeight=3
`work out new position
xCamPos#=newxvalue(xPos#,yAng#,camDist)
zCamPos#=newzvalue(zPos#,yAng#,camDist)
`work out camera height
yCamPos#=get ground height(1,xCamPos#,zCamPos#)+camHeight
if yCamPos# < yPos#+camHeight then yCamPos#=yPos#+camHeight
`update camera position
position camera xCamPos#,yCamPos#,zCamPos#
point camera xPos#,yPos#+camHeight,zPos#
endfunction
`---------
`MAIN LOOP
`---------
main:
do
yAng=object angle y(1)
`the following is temporary. There will be more but it will made later
`get keyboard input for movement
if upkey()=1 then move object 1,4
if downkey()=1 then move object 1,-4
if leftkey()=1 then yrotate object 1,wrapvalue(yAng-4)
if rightkey()=1 then yrotate object 1,wrapvalue(yAng+4)
`work out the height of the character
xPos#=object position x(1)
zPos#=object position z(1)
yPos#=get ground height(1,xPos#,zPos#)
`update the objects position
position object 1,xPos#,yPos#,zPos#
`update the camera
chase_cam(1)
`update the screen
sync
loop
RUNTIME ERROR

rogram ran into a function declaration
How to fix this error??