x=if(eq(t\,0)\,w\,if(lt(x\,(0-tw))\,w\,x-4))
It's all about setting the value of x. I like the answer of Mulvya which is good if you want the text to scroll across the video frame in a fixed number of seconds. I however wanted a constant speed regardless of the width of the video.
I started with if(lt(x,(0-tw)),w,x-1)
The idea was to start at the video width w and go on decreasing the value of x till it becomes less than 0-text_w. At this point the text disappears.
But it did not work. Default value for x is 0, I needed it to set it to w at the start. So I came up with this -
if(eq(t,0),w,if(lt(x,(0-tw)),w,x-1))
x-1 was too slow for my taste for I changed it to x-4.
Escape the , before using it in your command x=if(eq(t\,0)\,w\,if(lt(x\,(0-tw))\,w\,x-4))
The opposite of that, starting from LEFT and going to RIGHT would be
if(eq(t,0),(0-tw),if(gt(x,(w+tw)),(0-tw),x+4))