Quote: "Seems strange to make the button, and detect the mouse click in a function."
Not more strange then I dont want to repeat the code over and over again, and at the same time make so things happen if the cursor is on top of the text, like the text glowing up. But your point is noted.
Quote: "Is the button that exits the helpfiles in the same place as button to go into helpfiles? My bet is it is. Mouseclick in DBPro is not like mouseclick in other languages where it is activated once, it simply tells you if mouse button is currently pressed."
Well, this is something Im aware of. Thats why I put the button that activates the helpfiles at the top of the screen, and the button that returns from it at the bottom. The problem can be seen in another perspective:
rem The buttons
if button(20+text width("File"),10,2,"Help")=2 then helpFiles()
if button(10,10,1,"File")=1 then menu=1
. The top button activates the helpfiles, the button one activates a small menu. If the button that activates the menu would be over the ove that activates the helpfiles, the menu is only activated for a tiny part of a second. Thats why the button that activates the menu is bellow the one that activates the helpfiles. But still, if I activates the helpfiles, they exit. If I make so the button that exit does not exit, the helpfiles does not exit. So it might be the rest of code, and not the button function.
EDIT:
Found the problem. It wasnt any real coding error, it was just me doing a sloppy code. The problem was that the code was:
function helpFiles()
do
rem Clear the screen
cls
box 0,0,screen height(),screen width()*2
colorbox(0,0,20+text width("How to load an image "),screen height(),rgb(100,100,100))
rem Create the menu
if button(10,37,80,"How to load an image ")=85 then HowToLoad()
button(10,66,81,"How to transform an image")
button(10,95,82,"How to use the inderface ")
button(10,124,83,"How to deselect an image ")
if button(10,screen height()-text height("B")-12,84,"Back ")=0 then exit
sync
loop
endfunction
, when the buttonfunction returns a zero when its NOT pressed. But that doesnt explain why the button bellow another becomes "dominant".