1 DECLARE FUNCTION getnam$ (a%)
\r
2 DECLARE FUNCTION getsym$ (a$, b%)
\r
3 DECLARE SUB editor ()
\r
4 DECLARE SUB leiaconf ()
\r
5 DECLARE SUB clrerr ()
\r
10 ' (c) Svjatoslav Agejenko
\r
11 ' All rights reserved.
\r
13 ' E-mail: svjatoslav@svjatoslav.eu
\r
14 ' Homepage: svjatoslav.eu
\r
16 DECLARE SUB dispp ()
\r
17 DECLARE SUB displukk ()
\r
18 DECLARE SUB kola (a%)
\r
20 DECLARE SUB start ()
\r
21 DECLARE SUB getnad (g%, n%, d%, k%)
\r
22 DECLARE SUB initp (b$)
\r
23 DECLARE SUB getmd (a$, m%, d%)
\r
24 DECLARE SUB son (a$)
\r
25 DECLARE SUB inita ()
\r
28 DECLARE SUB kell (a%)
\r
29 DECLARE SUB sync2 ()
\r
31 DECLARE SUB mnmain ()
\r
32 DECLARE SUB heli (a%)
\r
36 DIM SHARED ap$(1 TO 500)
\r
38 DIM SHARED pp$(1 TO 500)
\r
40 DIM SHARED prt, prt2
\r
43 DIM SHARED sona$(1 TO 50)
\r
47 DIM SHARED pn$(1 TO 7)
\r
51 DIM SHARED timero AS LONG
\r
53 DIM SHARED tunnidara
\r
55 DIM SHARED cnflist$(1 TO 200)
\r
66 PRINT "Programmi t88s ilmus j2rgnev t6rge:"
\r
68 PRINT "Programmi t2itmine katkestatud! Abi saamiseks lugege juhendit."
\r
73 IF apl = 0 THEN inita
\r
76 n1 = VAL(RIGHT$(a$, 4))
\r
77 n2 = VAL(LEFT$(a$, 2))
\r
79 n3 = VAL(RIGHT$(a$, 2))
\r
80 getnad n1, n2, n3, ndlp
\r
83 SELECT CASE sona$(1)
\r
85 getmd sona$(2), m1, d1
\r
86 getmd sona$(3), m2, d2
\r
88 IF m3 < m1 THEN GOTO 9
\r
89 IF m3 > m2 THEN GOTO 9
\r
90 IF m3 = m1 THEN IF d3 < d1 THEN GOTO 9
\r
91 IF m3 = m2 THEN IF d3 > d2 THEN GOTO 9
\r
94 getmd sona$(2), m1, d1
\r
95 getmd sona$(3), m2, d2
\r
97 IF m3 < m1 THEN GOTO 9
\r
98 IF m3 > m2 THEN GOTO 9
\r
99 IF m3 = m1 THEN IF d3 < d1 THEN GOTO 9
\r
100 IF m3 = m2 THEN IF d3 > d2 THEN GOTO 9
\r
101 IF ndlp <> VAL(sona$(4)) THEN GOTO 9
\r
104 getmd sona$(2), m1, d1
\r
105 getmd DATE$, m2, d2
\r
106 IF (m1 = m2) AND (d1 = d2) THEN b$ = sona$(3)
\r
111 IF b$ <> lp$ THEN initp b$
\r
120 IF a$ <> dato$ THEN chd
\r
125 SELECT CASE sona$(1)
\r
127 getmd sona$(2), h1, m1
\r
128 getmd TIME$, h2, m2
\r
129 ' PRINT h1, m1, h2, m2
\r
130 IF (h2 = h1) AND (m2 = m1) THEN
\r
131 IF sona$(3) = "sis" THEN b = 1
\r
132 IF sona$(3) = "val" THEN b = 2
\r
137 IF (tunnidara = 0) AND (b > 0) THEN kell b
\r
142 errmsg$ = "tundmatu viga. V6ibolla on v2he RAM m2lu?"
\r
147 PRINT "Kooli Kell 3 2003.09"
\r
148 PRINT "autor: Svjatoslav Agejenko "
\r
150 PRINT "s - kell tundi sisse v - kell tunnist v�lja"
\r
151 PRINT "a - sisesta uus aeg d - sisesta uus daatum"
\r
152 PRINT "p - n2itab dokumentatsiooni j - j�tab k�ik tunnid t�na �ra"
\r
153 PRINT "7 - 1 minut tagasi 8 - 1 minut edasi"
\r
154 PRINT "4 - 1 tund tagasi 5 - 1 tund edasi"
\r
155 PRINT "r - programmi restart q - programmist v�lja"
\r
156 PRINT "k - konfiguratsiooni redaktor CTRL+L - klaviatuuri lukk (sees/v2ljas)"
\r
161 PRINT "Kuu-P�ev-Aasta (USA standard)"
\r
167 IF pp$(a) <> SPACE$(LEN(pp$(a))) THEN
\r
169 PRINT SPACE$(15 - LEN(pp$(a)));
\r
181 PRINT "Klaviatuur lukus! Vajuta CTRL+L"
\r
189 IF ndlp = 0 THEN GOTO 14
\r
191 PRINT "n�dalap�ev:", pn$(ndlp)
\r
193 PRINT "p�evaplaan:", lp$
\r
200 IF tunnidara = 1 THEN
\r
201 PRINT "T2na on k6ik tunnid 2ra j2etud"
\r
216 PRINT "Konfiguratsiooni redaktor. Valige v2lja p2eva v6i aasta plaani."
\r
220 PRINT " nr nimi laiend suurus loomisdaatum"
\r
225 PRINT "K - valitud faili kustutamine U - uus fail ESC - redaktorist v2lja"
\r
230 IF a - 2 + p = v THEN
\r
233 PRINT cnflist$(a - 2 + p) + SPACE$(55 - LEN(cnflist$(a - 2 + p)))
\r
237 IF cnflist$(a - 2 + p) <> SPACE$(LEN(cnflist$(a - 2 + p))) THEN
\r
239 PRINT " valitud: " + getnam$(v)
\r
245 PRINT cnflist$(a - 2 + p) + SPACE$(80 - LEN(cnflist$(a - 2 + p)))
\r
252 'IF a$ <> "" THEN PRINT ASC(RIGHT$(a$, 1)); ASC(LEFT$(a$, 1))
\r
253 IF a$ = CHR$(27) THEN GOTO 18
\r
254 IF a$ = "u" OR a$ = "U" THEN SHELL "EDIT": GOTO 23
\r
255 IF a$ = CHR$(0) + "P" THEN v = v + 1
\r
256 IF a$ = CHR$(0) + "H" THEN v = v - 1
\r
257 IF a$ = CHR$(0) + CHR$(73) THEN v = v - 17
\r
258 IF a$ = CHR$(0) + CHR$(81) THEN v = v + 17
\r
259 IF a$ = "K" OR a$ = "k" THEN
\r
260 IF LEN(getnam$(v)) > 2 THEN
\r
261 IF getnam$(v) = "AASTA.AP" THEN
\r
271 IF a$ = CHR$(13) THEN
\r
272 IF getnam$(v) = "." THEN
\r
275 SHELL "EDIT " + getnam$(v)
\r
280 IF v < 1 THEN v = 1: SOUND 3000, .2
\r
281 IF v > 200 THEN v = 200: : SOUND 3000, .2
\r
283 21 IF v - p > 19 THEN p = p + 1: GOTO 21
\r
284 22 IF v - p < 1 THEN p = p - 1: GOTO 22
\r
292 SUB getmd (a$, m, d)
\r
294 m = VAL(LEFT$(b$, 2))
\r
295 d = VAL(RIGHT$(b$, 2))
\r
299 SUB getnad (g, n, d, k)
\r
305 p = p - 1: m = m + 12
\r
309 w = d + INT((13 * m - 1) / 5) + y + INT(y / 4) + INT(c / 4) - 2 * c
\r
310 k = w - 7 * INT(w / 7)
\r
311 IF k = 0 THEN k = 7
\r
314 FUNCTION getnam$ (a)
\r
317 d$ = getsym(cnflist$(a), b)
\r
318 IF d$ = " " THEN GOTO 19
\r
322 getnam$ = c$ + "." + getsym(cnflist$(a), 17) + getsym(cnflist$(a), 18)
\r
325 FUNCTION getsym$ (a$, b)
\r
326 getsym$ = RIGHT$(LEFT$(a$, b), 1)
\r
355 FOR a = 800 TO 1000 STEP 10
\r
369 errmsg$ = "Ei leia aastaplaani faili! 'aasta.ap'"
\r
370 OPEN "aasta.ap" FOR INPUT AS #1
\r
373 IF EOF(1) <> 0 THEN GOTO 3
\r
384 errmsg$ = "Ei leia aastaplaanis mainitud '" + b$ + ".pp' p2evaplaani!"
\r
385 OPEN b$ + ".pp" FOR INPUT AS #1
\r
388 IF EOF(1) <> 0 THEN GOTO 7
\r
399 IF b$ <> lk$ THEN lk$ = b$ ELSE GOTO 2
\r
420 s$ = s$ + CHR$(219)
\r
429 IF ABS(timero - TIMER) < a THEN GOTO 11
\r
441 SHELL "dir >dir.tmp"
\r
442 OPEN "dir.tmp" FOR INPUT AS #1
\r
444 IF EOF(1) <> 0 THEN GOTO 16
\r
446 IF LEN(a$) < 30 THEN GOTO 15
\r
447 IF LEFT$(a$, 1) = " " THEN GOTO 15
\r
448 IF LEFT$(a$, 1) = "." THEN GOTO 15
\r
449 b$ = RIGHT$(LEFT$(a$, 12), 3)
\r
450 IF b$ = "PP " OR b$ = "AP " THEN ELSE GOTO 15
\r
452 a$ = RIGHT$(d$, 4) + " " + a$
\r
453 IF LEN(a$) > 50 THEN a$ = LEFT$(a$, 50)
\r
464 b$ = LEFT$(TIME$, 5)
\r
465 IF b$ <> timo$ THEN chm
\r
471 IF ssave > ssavel THEN disp
\r
475 IF a$ = CHR$(12) THEN
\r
476 IF kblukk = 1 THEN kblukk = 0 ELSE kblukk = 1
\r
480 IF a$ <> "" THEN SOUND 3000, 1
\r
483 IF a$ = "k" OR a$ = "K" THEN editor
\r
485 IF a$ = "s" OR a$ = "S" THEN kell 1
\r
486 IF a$ = "v" OR a$ = "V" THEN kell 2
\r
490 PRINT " vana aeg: " + TIME$
\r
491 INPUT "sisesta uus aeg (TT:MM:SS): ", b$
\r
492 IF LEN(b$) <> 8 THEN GOTO 12
\r
499 IF a$ = "d" OR a$ = "D" THEN
\r
501 PRINT " vana daatum: " + DATE$
\r
502 INPUT "sisesta uus daatum (KK-PP-AAAA): ", b$
\r
503 IF LEN(b$) <> 10 THEN GOTO 13
\r
510 IF a$ = "7" OR a$ = "8" THEN
\r
511 b = VAL(RIGHT$(LEFT$(TIME$, 5), 2))
\r
512 IF a$ = "7" THEN b = b - 1
\r
513 IF a$ = "8" THEN b = b + 1
\r
514 IF b < 0 THEN b = 0
\r
515 IF b > 59 THEN b = 59
\r
517 IF LEFT$(d$, 1) = " " THEN d$ = RIGHT$(d$, LEN(d$) - 1)
\r
518 IF LEN(d$) < 2 THEN d$ = "0" + d$
\r
519 e$ = LEFT$(TIME$, 3) + d$ + RIGHT$(TIME$, 3)
\r
523 IF a$ = "4" OR a$ = "5" THEN
\r
524 b = VAL(LEFT$(TIME$, 2))
\r
525 IF a$ = "4" THEN b = b - 1
\r
526 IF a$ = "5" THEN b = b + 1
\r
527 IF b < 0 THEN b = 0
\r
528 IF b > 23 THEN b = 23
\r
530 IF LEFT$(d$, 1) = " " THEN d$ = RIGHT$(d$, LEN(d$) - 1)
\r
531 IF LEN(d$) < 2 THEN d$ = "0" + d$
\r
532 e$ = d$ + RIGHT$(TIME$, 6)
\r
536 IF a$ = "p" OR a$ = "P" THEN SHELL "EDIT juhend.txt": disp
\r
538 IF a$ = "r" OR a$ = "R" THEN rese
\r
539 IF a$ = "q" OR a$ = "Q" THEN SYSTEM
\r
541 IF a$ = "j" OR a$ = "J" THEN
\r
542 IF tunnidara = 0 THEN tunnidara = 1 ELSE tunnidara = 0
\r
546 IF ssave <= ssavel THEN
\r
552 IF ABS(TIMER - timero) > 10 THEN
\r
556 LOCATE RND * 22 + 1, RND * 79 + 1
\r
557 IF RND * 100 < 50 THEN PRINT "*" ELSE PRINT "."
\r
559 LOCATE RND * 22 + 1, RND * 50 + 1
\r
561 PRINT "< " + LEFT$(TIME$, 2);
\r
565 PRINT RIGHT$(LEFT$(TIME$, 5), 2) + " >"
\r
590 FOR c = 1 TO LEN(a$)
\r
591 d$ = RIGHT$(LEFT$(a$, c), 1)
\r
592 IF d$ = " " OR d$ = CHR$(9) THEN
\r
595 IF b = 1 THEN b = 0: mitus = mitus + 1
\r
596 sona$(mitus) = sona$(mitus) + d$
\r
606 pn$(1) = "esmasp�ev"
\r
607 pn$(2) = "teisip�ev"
\r
608 pn$(3) = "kolmap�ev"
\r
609 pn$(4) = "neljap�ev"
\r
612 pn$(7) = "p�hap�ev"
\r