/* Sample script to get the last sport news */
/* The used channel (34 = ZDF) and page are for German TV */

/* NOTE:you can run only ONE teletext REXX script or
        the TELETEXT/2 application at the same time */

call RxFuncAdd 'rtvLoadFuncs', 'TVREXX', 'rtvLoadFuncs'
call rtvLoadFuncs

arg filename
channel=34
page=222
subpage=0
slot=3

handle=rtvOpen()
IF handle = "0"
 then DO
    say "Error: driver or moviecard not installed"
    EXIT
END

rc = rtvSetChannel(handle, channel);

ret = rtvGetCachedPage(page,subpage,30);

ret=rtvVTTexttoASCII(ret, 1,0);

zeile1=substr(ret,804,37)  /* The news are 37 signs each line */
zeile2=substr(ret,844,37)
zeile3=substr(ret,884,37)
ret = LINEOUT(filename, zeile1);
ret = LINEOUT(filename, zeile2);
ret = LINEOUT(filename, zeile3);
closeline = LINEOUT(filename);
closeret = rtvClose(handle);

EXIT

