forked from rickulland/CoCoIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getBookmark.b09
73 lines (68 loc) · 1.81 KB
/
getBookmark.b09
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
PROCEDURE getBookmark
(* 06/23/22
TYPE bookmarks=server,page,title:STRING[144]
DIM path:BYTE
DIM int1,fn1,fn2,doloc,readloc,reclen:INTEGER
DIM instr:STRING[144]
PARAM bookmark:bookmarks
reclen:=240
ON ERROR GOTO 1000
RUN gfx2("owset",1,5,5,70,12,2,4)
RUN gfx2("curon") \RUN gfx2("gcset",0,0)
RUN gfx2("curxy",30,0) \ PRINT "Bookmarks:"
10 OPEN #path,"/dd/SYS/bookmark.www":READ
LOOP
FOR fn1=0 TO 4
FOR fn2=1 TO 10
readloc:=fn1*10+fn2-1
SEEK #path,readloc*reclen
GET #path,bookmark
PRINT readloc+1; " "; bookmark.title; " -- "; bookmark.server
NEXT fn2
20 RUN gfx2("revon")
INPUT "Key in URL or enter: number, ENTER=page, 99=exit: ",instr
RUN gfx2("revoff")
IF LEN(instr)<3 THEN
IF instr="" THEN 25
doloc:=VAL(instr)
IF doloc>50 THEN
bookmark.server:=""
bookmark.page:=""
bookmark.title:=""
GOTO 30
ELSE
SEEK #path,(doloc-1)*reclen
GET #path,bookmark
GOTO 30
ENDIF
ELSE
int1:=SUBSTR("/",instr)
IF int1<>0 THEN
bookmark.server:=LEFT$(instr,int1-1)
ENDIF
int1:=LEN(instr)-int1+1
bookmark.page:=RIGHT$(instr,int1)
GOTO 30
ENDIF
bookmark.server:=""
bookmark.page:=instr
bookmark.title:=""
GOTO 30
25 RUN gfx2("clear")
RUN gfx2("curxy",30,0) \ PRINT "Bookmarks:"
NEXT fn1
ENDLOOP
30 CLOSE #path
RUN gfx2("curoff")
RUN gfx2("owend")
END
1000 ON ERROR
CREATE #path,"/dd/SYS/bookmark.www":WRITE
bookmark.server=""
bookmark.page=""
bookmark.title=""
FOR fn1=1 TO 50
PUT #path,bookmark
NEXT fn1
CLOSE #path
GOTO 10