One of the first things I ever made in DBP ages ago, not very clean, and very lengthy, but take a look as it utilises other useful commands to.
_options:
CLS : `Clear the screen
SET CURSOR 0,0 : `Set cursor to top left
_Window:
INPUT "1 for Windowed, 2 for Non-Windowed: ", W_NW
IF W_NW < 1 or W_NW > 2 : `if you don't choose a valid option
CLS : `Clear the screen
GOTO _Window : `Jump to _window
ENDIF
IF W_NW = 1 : `If you chose the windowed option
SET WINDOW ON
ELSE : `You must of chose non-windowed option
SET WINDOW OFF
ENDIF
REM Put width height and depth into three different variables
INPUT "Screen Width: ", swidth
INPUT "Screen Height: ", sheight
INPUT "Screen Depth: ", sdepth
SET DISPLAY MODE swidth, sheight, sdepth : `Set w, h, and d
X = CHECK DISPLAY MODE(swidth, sheight, sdepth) : `Make sure they can be handled by the graphics card and monitor
PRINT X : `Print it
_automation:
CLS
PRINT "F1 for options." : SLEEP 500
PRINT "Mouse click to quit." : SLEEP 500
PRINT "Move mouse to update CO-ORDS." : SLEEP 3000
CLS
_repeat:
REPEAT
CLS
PRINT "Click where you want the co-ords to be displayed."
UNTIL MOUSECLICK()>0
CLS
COORDY3=MOUSEMOVEY()
COORDY22=MOUSEY()
COORDX3=MOUSEMOVEX()
COORDX22=MOUSEX()
SET CURSOR COORDX22,COORDY22
F = 1 : `Set F to 1
DO
IF F = 1 : `If F = 1 perform the following
COORDY3=MOUSEMOVEY()
COORDY22=MOUSEY()
COORDX3=MOUSEMOVEX()
COORDX22=MOUSEX()
ENDIF
F = 2 : `Set F to 2
DISABLE ESCAPEKEY : `Disable Escapekey
CLS : `Clear the screen
COORDY=MOUSEMOVEY() : `Get the co-ords.
COORDY2=MOUSEY() : ` " "
COORDX=MOUSEMOVEX() : ` " "
COORDX2=MOUSEX() : ` " "
SET CURSOR COORDX22,COORDY22 : `Put where the text will appear
PRINT COORDX2," ",COORDY2 : `Print the co-ords
IF ESCAPEKEY()=1 THEN GOTO _exit : `If esc is pressed goto _exit
IF SCANCODE()=59 THEN GOTO _options : `If F1 is pressed goto _options
LOOP
_exit:
CLS : `Clear the screen
SET CURSOR 0,0 : `Put where the text will appear
PRINT "Do you really want to exit?";
INPUT " Y for Yes, N for No: ", EXIT1$
EXIT1$ = UPPER$(EXIT1$) : `Convert the string EXIT1$ to UPPERCASE
IF EXIT1$ = "Y" : `IF EXIT1$ = Y
END : `End the program
ENDIF
IF EXIT1$ = "N" : `IF EXIT1$ = N
GOTO _repeat : `Goto repeat
ENDIF
CLS : `Clear the screen
SLEEP 500
PRINT "That was not Y or N."
SLEEP 2000
GOTO _exit : `Goto exit
I hear and I forget. I see and I remember. I do and I understand.