to use the function just put
Menu(blue,white,T#,R#,hold,selectedItem)
into a .dba file along with the function declaration at the bottom of the code eg.
menu(blue,white,t#,r#,hold,selectedItem)
function Menu(blue,white,T#,R#,hold,selectedItem)
set text size 12
blue=RGB(0,50,255)
white=RGB(255,255,255)
T# = 0
R# = 100
do
set cursor T#,R#
T# = T#+5.0
print "When DERNS Attack!!!"
wait 50
cls
if T# = 125 and R# = 100 then exit
loop
selectedItem=1
do
cls
`print menu items
if selectedItem=1 then ink blue,0 else ink white,0
text 300,350,"Play Game"
if selectedItem=2 then ink blue,0 else ink white,0
text 380,350,"Controls"
if selectedItem=3 then ink blue,0 else ink white,0
text 460,350,"Saves"
if selectedItem=4 then ink blue,0 else ink white,0
text 510,350,"Credits"
if selectedItem=5 then ink blue,0 else ink white,0
text 560,350,"Exit"
if Scancode()=58 then print codes
`select menu items
if leftkey()=1 and hold=0 then dec selectedItem : hold=1
if rightkey()=1 and hold=0 then inc selectedItem : hold=1
sync
if leftkey()=0 and rightkey()=0 then hold=0
sync
if selectedItem>5 then selectedItem=1
if selectedItem<1 then selectedItem=5
sync
`choose what to do when an item is selected
if returnkey()=1
`play game
if selectedItem=1 then print "game"
`display in
if selectedItem=2 then print "options"
sync
`Go to Saved Games
if selectedItem=3 then print "saves"
sync
`Show Credits
if selectedItem=4 then print "credits"
sync
`quit the game
if selectedItem=5 then end
sync
endif
sync
loop
endfunction Menu
however i'm not sure you've quite got the idea of a function all the parameters in the function(between the brackets) are supposed to be added by the user but you are assigning then values inside the function anyway so by deleting all the stuff inside the brackets your function will still work and not takes so much time to write out.
have a look at the first function i ever did its called goodtext() and works well
rem demonstrating simple but effective text function
rem main loop
do
rem the function call notice the parameters don't have to be variables
goodtext(320,240,255,0,0,40,"Hello")
loop
rem the function declaration
function goodtext(x,y,r,g,b,size,string$)
rem x+y=text position
rem r+g+b=rgb color values
rem size= size of the text
rem string$=string to be printed
rem the function now uses the variables that the person using wants
rem to place some pretty text on the screen
set text size size
ink rgb(r,g,b),0
text x,y,string$
endfunction
hope it helps any more probs just ask
ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!