forked from rickulland/CoCoIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathputBookmark.b09
50 lines (46 loc) · 1.02 KB
/
putBookmark.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
PROCEDURE putBookmark
(* 06/23/22
TYPE bookmarks=server,page,title:STRING[144]
DIM path:BYTE
DIM int1,reclen:INTEGER
DIM instr:STRING[1]
DIM testit:bookmarks
PARAM bookmark:bookmarks
reclen:=240
RUN gfx2("owset",1,5,5,70,6,2,4)
RUN gfx2("curon") \RUN gfx2("gcset",0,0)
PRINT
ON ERROR GOTO 1000
10 OPEN #path,"/dd/SYS/bookmark.www":UPDATE
FOR int1=1 TO 50
SEEK #path,(int1-1)*reclen
GET #path,testit
IF testit.server="" THEN
SEEK #path,(int1-1)*reclen
PUT #path,bookmark
PRINT " "; bookmark.title
PRINT " "; bookmark.server; bookmark.page
PRINT " Bookmark saved.";
GOTO 30
ENDIF
NEXT int1
PRINT "Not saved. Bookmark file full.";
30 RUN gfx2("curxy",1,6) \ PRINT "Enter to leave"
instr:=""
WHILE instr="" DO
RUN BNKEY(instr)
ENDWHILE
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 int1=1 TO 50
PUT #path,bookmark
NEXT int1
CLOSE #path
GOTO 10