I am just learning too, but here's how I would edit your code.
Sync On : Sync Rate 0
Goto Main_Menu
Main_Menu:
Do
if Button(20,55,"Main (Server)")=1 then Goto Main_Server
if Button(20,95,"Main (Client)")=1 then goto Main_Client
If Button(20,135,"Exit")=1 then End
sync
loop
Main_Server:
cls
ink rgb(255,255,255),0
Text 10,10,"Main (Server)";
sync
Do
sync
Loop
end
Main_Client:
cls
ink rgb(0,255,0),0
Text 10,10,"Main (Client)";
sync
Do
sync
Loop
end
function Button(x1,y1,WORDS$)
Pressed=0
x2=Text Width(WORDS$)
y2=Text Height(WORDS$)
if mousex()>x1 and mousex()<x1+x2
if mousey()>y1-y2 and mousey()<y1+y2
Pressed=1
endif
endif
if pressed=1
ink rgb(255,0,0),0
Pressed=Mouseclick()
else
ink rgb(255,255,255),0
endif
text x1,y1,WORDS$
endfunction pressed
If you want the color to go back to white after they click it then assign it again.
Here I went back to white for the server, and changed to green for the client.
I also noticed your nested if statements in the funtion, and edited them as well.
They seemed redundant in one spot.
The pressed=0 in the else of the if pressed=1 condition seemed unnecessary too.
If its not =1 then its =0 already.
I'm a noob to DBPro too, so this probably is not the best solution.