Your code is wrong becaus you're saying that if it's less than 550. If you try to get it to go to the left, the x position will still be less than 550 right? So what you do is set a boundary like this,
y=240
x=0
sync
cls
do
text x,y, "Hello World"
sleep 50
cls
if x >= 550
x = x - 5
endif
if x<= 0
x = x + 5
endif
loop
sync on
I'm not sure if that'll work (I'm at work right now and I can't test) but that formula should work. Also, lemme ask you, what does that "sleep" command do? Double as a frame rate controller or something?
Hope I helped,
The Guy
The only limits we have are those we set.