Its a variable and the value is in pixels. Here is a slightly better commented version.
REMSTART
----------------------------------------------------------
Beginner's Guide To DarkBASIC Game Programming
Copyright (C)2002 Jonathan S. Harbour and Joshua R. Smith
Chapter 6 - Conditions Program
----------------------------------------------------------
REMEND
REM Create some variables all units in pixels
`stores the ball's x position
BallX = 320
`stores the ball's y position
BallY = 240
`stores the ball's size
BallSize = 20
`stores the ball's side to side speed
SpeedX = 1
`stores the balls up and down speed
SpeedY = 2
`store how far away from the screens edge
`the ball can get before changing direction
Border = 25
REM Initialize the program
SYNC ON
REM Set the color
color = RGB(0, 200, 255)
INK color, 0
REM Start the main loop
DO
REM Clear the screen
CLS
REM Draw the screen border
LINE 0, 0, 639, 0
LINE 639, 0, 639, 479
LINE 639, 479, 0, 479
LINE 0, 479, 0, 0
REM Move the ball
BallX = BallX + SpeedX
BallY = BallY + SpeedY
REM Check conditions for the BallX
`if ball hits right side border then
`change the ball's x speed to a - of its value
`(change direction 1 becomes -1)
IF BallX > 639 - Border
BallX = 638 - Border
SpeedX = SpeedX*-1
ELSE
`if ball hits left side border then
`change the ball's x speed to a + of its value
`(change direction -1 becomes 1)
IF BallX < Border
BallX = Border + 1
SpeedX = SpeedX*-1
ENDIF
ENDIF
REM Check conditions for BallY
`if ball hits bottom border then
`change the ball's y speed to a - of its value
`(change direction 1 becomes -1)
IF BallY > 479 - Border
BallY = 478 - Border
SpeedY = SpeedY*-1
ELSE
`if ball hits top border then
`change the ball's y speed to a + of its value
`(change direction -1 becomes 1)
IF BallY < Border
BallY = Border + 1
SpeedY = SpeedY*-1
ENDIF
ENDIF
REM Draw the ball at the new position
CIRCLE BallX, BallY, BallSize
REM Check for escape
IF ESCAPEKEY() = 1 OR MOUSECLICK() = 1 THEN END
REM Redraw the screen
SYNC
LOOP