10 CHANEL%=0
11 BACKINDEX%=-1
12 CHAR%=-1
13 DIM BACKCHARS%(64)
14 READTEGDATA%=0
15 TEGDATA$=""
16 TEG$=""
17 OPEN #CHANEL%,"file:///E:/data.xml","input"
20 GOSUB 50
21 IF READTEGDATA%=1 THEN PRINT TEGDATA$:READTEGDATA%=0:REPAINT:SLEEP 500:GOTO 20
22 IF READTEGDATA%=0 THEN PRINT TEG$:READTEGDATA%=1
23 IF INKEY(0)=48 THEN END
24 REPAINT:SLEEP 500:GOTO 20
49 REM sub getdata
50 TEG$="":GOSUB 150
51 IF CHAR%<=20 THEN GOTO 50
52 IF READTEGDATA%=1 THEN GOSUB 100:RETURN
53 IF CHAR%=ASC("<") THEN GOSUB 150
55 IF CHAR%=ASC(">") THEN RETURN
56 TEG$=TEG$+CHR$(CHAR%)
57 GOSUB 150
58 GOTO 55
59 RETURN
60 REM endsub
99 REM sub readtegdata
100 TEGDATA$=""
101 IF CHAR%=ASC("<") THEN RETURN
102 TEGDATA$=TEGDATA$+CHR$(CHAR%)
103 GOSUB 150
104 GOTO 101
105 RETURN
110 REM endsub
149 REM sub readchar
150 IF BACKINDEX%>-1 THEN CHAR%=BACKCHARS%(BACKINDEX%):BACKINDEX%=BACKINDEX%-1:RETURN
151 GET #CHANEL%,CHAR%:TRAP 155
152 RETURN
155 PRINT "EOF":CLOSE #CHANEL%
156 IF INKEY(0)=48 THEN END
157 GOTO 156
160 REM endsub
199 REM sub backchar
200 BACKINDEX%=BACKINDEX%+1
201 BACKCHARS%(BACKINDEX%)=CHAR%
202 RETURN
210 REM undsub
