uses crt,dos,graph,printer; var i,d,m:integer; position:char; label 1,2,3,4,999,k ; procedure calc; var op,c:char; z:real; f,s:integer; label 1,2,3; procedure box; begin writeln('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»'); writeln('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º'); writeln('º º º CASIO DR-512 º'); writeln('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º'); writeln('º º'); writeln('º º'); writeln('º ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ º'); writeln('º ³ 6 ³ ³ 7 ³ ³ 8 ³ ³ 9 ³ ³ / ³ º'); writeln('º ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ º'); writeln('º ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ º'); writeln('º ³ 3 ³ ³ 4 ³ ³ 5 ³ ³ * ³ ³ - ³ º'); writeln('º ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ º'); writeln('º ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ º'); writeln('º ³ 0 ³ ³ 1 ³ ³ 2 ³ ³ + ³ º'); writeln('º ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º'); writeln('º º'); writeln('º º'); writeln('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ'); gotoxy (2,20); writeln(' ESC- Back to menu'); end; begin clrscr; textbackground(blue); textcolor(yellow); clrscr; box; c:=readkey; case c of #27: goto 1; end; gotoxy(7,3); readln(f); clrscr; box; gotoxy(7,3); readln(s); 3: op:=readkey; case op of '*':z:=f*s; '-':z:=f-s; '+':z:=f+s; '/':z:=f/s else goto 3; end; gotoxy (7,3); writeln(z:5); readkey;clrscr; 1:end; procedure notebook; var p:searchrec; k:string; s:string; f:text; label 88; procedure print; var c:char; label 1; begin clrscr; writeln(' Now You have in notebook next files : '); writeln(''); writeln(' ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ'); writeln(''); findfirst('*.ntb',anyfile,p); while doserror=0 do begin with p do writeln(' ',Name:12); findnext (p); end; writeln(' ESC- Back to menu'); c:=readkey; case c of #27: goto 1; end; readln(k); clrscr; assign(f,k); reset(f); while not EOF(f) do begin readln(f,s); { writeln(' ',s); } end; writeln(LST,s); 1:end; procedure description; begin clrscr; writeln(''); writeln(' SHORT DESCRIPTION'); WRITELN(' ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ'); writeln(''); writeln(' At this part of program You can write something but only 128 symbols.'); writeln(' To save it you should write at first name of file WITH EXTENSION! '); writeln(' For example:"notebook.ntb". '); writeln(' REMAINDING: ') ; writeln(' Do not forget the extension: *.ntb.'); readkey;clrscr;end; procedure open_old; var c:char; label 1; begin clrscr; writeln(' Now You have in notebook next files : '); writeln(''); writeln(' ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ'); writeln(''); findfirst('*.ntb',anyfile,p); while doserror=0 do begin with p do writeln(' ',Name:12); findnext (p); end; writeln(' ESC- Back to menu'); c:=readkey; case c of #27: goto 1; end; readln(k); clrscr; assign(f,k); reset(f); while not EOF(f) do begin readln(f,s); writeln(' ',s); end; close(f); readkey; clrscr; 1: end; procedure open_new; var F: Text; nfname,nftext:string; c:char; label 1; begin clrscr; writeln(''); writeln(' Open new file'); writeln(' ÍÍÍÍÍÍÍÍÍÍÍÍÍ'); writeln(' ESC- Back to menu'); writeln(''); c:=readkey; case c of #27: goto 1; end; writeln(' Enter filename: ');readln(nfname); Assign(F, nfname); Rewrite(F); writeln(' Enter text');readln(nftext); Writeln(F, nftext); Close(F); 1: end; procedure delete; var ferase,ext:string; c:char; label 1; begin clrscr; writeln(' Now You have in notebook next files : '); writeln(''); writeln(' ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ'); findfirst('*.ntb',anyfile,p); while doserror=0 do begin with p do writeln(' ',Name:12); findnext (p); end; writeln (' ESC- Back to menu'); writeln(''); c:=readkey; case c of #27: goto 1; end; writeln(''); writeln(' Enter filename to delete');readln(ferase); assign(f,ferase); erase(f); 1: end; Procedure ramka; Var i,k:Integer; Begin For i:=1 to 24 do Begin GotoXY(1,i); Writeln('±'); GotoXY(39,i); Writeln('±'); End; For k:=1 to 39 do Begin GotoXY(k,1); Writeln('±'); GotoXY(k,24); Writeln('±'); End; End; var vybor:char; label vybor1,vybor2, vybor3 ,vybor4,vybor5 ,pov,1; begin 88:clrscr; ramka; gotoxy(14,3); writeln('NOTEBOOK'); gotoxy(14,4); writeln('ÍÍÍÍÍÍÍÍÍ'); gotoxy(12,7); writeln('1 OPEN OLD FILE'); gotoxy(12,9); writeln('2 OPEN NEW FILE'); gotoxy(12,11); writeln('3 DELETE OLD FILE'); gotoxy(12,13); writeln('4 EXIT NOTEBOOK'); GOTOxy(12,15); writeln('5 SHORT DESCRIPTION'); gotoxy(12,17); writeln('6 PRINT NOTEBOOK FILE'); gotoxy(5,20); writeln('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»'); gotoxy(5,21); writeln('º ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ º'); gotoxy(5,22); writeln('º ³ VERSION 4.00 ³ º'); gotoxy(5,23); writeln('º ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º'); gotoxy(5,24); writeln('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ'); pov: vybor:=readkey; case vybor of '1': goto vybor1; '2':goto vybor2; '3': goto vybor3; '4': goto vybor4; '5': goto vybor5; '6':goto 1 else goto pov; end; 1:print;goto 88; vybor1: open_old;goto 88; vybor2: open_new; goto 88; vybor3: delete; goto 88; vybor5: description; goto 88; readkey; clrscr; vybor4: end; procedure phonebook; procedure records; type phonebook=record name: string[10]; number: string; end; var lf: file of phonebook; i, n: integer; phone: phonebook; c:char; label 1; begin clrscr; assign(lf, 'phone.dat'); {$I-} reset(lf); {$I+} if IOResult=0 then seek(lf, filesize(lf)) else rewrite(lf); writeln(' ESC- Back to menu'); writeln(''); c:=readkey; case c of #27: goto 1; end; write('How many numbers? '); readln(n); for i:=1 to n do begin write('Name: '); readln(phone.name); write('Number: '); readln(phone.number); write(lf, phone); writeln; end; writeln(''); writeln('Here are (is) ', filesize(lf),' numbers.'); close(lf); readkey; clrscr; 1:end; procedure view; type phonebook=record name: string[10]; number: string; end; var lf: file of phonebook; i, n: integer; phone: phonebook; begin clrscr; assign(lf, 'phone.dat'); reset(lf); n:=filesize(lf); writeln(''); writeln(' Here are (is) ', n, ' numbers.'); writeln(''); writeln('ÕÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍ͸'); writeln('³Name: ³ Number:³'); writeln('ÔÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍ;'); for i:=1 to n do begin read(lf, phone); writeln(' ',phone.name,' ', phone.number); end; close(lf); readkey end; Procedure ramka; Var i,k:Integer; Begin For i:=1 to 24 do Begin GotoXY(1,i); Writeln('±'); GotoXY(39,i); Writeln('±'); End; For k:=1 to 39 do Begin GotoXY(k,1); Writeln('±'); GotoXY(k,24); Writeln('±'); End; End; var c:char; label 1,2,3,4,5; begin 4:clrscr; ramka; gotoxy(14,3); writeln('PHONEBOK'); gotoxy(14,4); writeln('ÍÍÍÍÍÍÍÍ'); gotoxy(12,7); writeln('1 MAKE NEW RECORD'); gotoxy(12,9); writeln('2 VIEW NUMBERS'); gotoxy(12,11); writeln('3 EXIT'); gotoxy(5,20); writeln('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»'); gotoxy(5,21); writeln('º ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ º'); gotoxy(5,22); writeln('º ³ VERSION 4.00 ³ º'); gotoxy(5,23); writeln('º ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º'); gotoxy(5,24); writeln('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ'); 5: c:= readkey; case c of '1': goto 1; '2': goto 2; '3': goto 3 else goto 5; end; 1: records; goto 4; 2: view; goto 4; 3:clrscr; end; procedure ramka; Var i,k:Integer; Begin For i:=1 to 24 do Begin GotoXY(1,i); Writeln('±'); GotoXY(39,i); Writeln('±'); End; For k:=1 to 39 do Begin GotoXY(k,1); Writeln('±'); GotoXY(k,24); Writeln('±'); End; End; begin d:=detect; initgraph(d,m,''); rectangle(1,1,639,479); settextstyle(4,0,9); outtextxy(50,35,'NOTEBOOK'); settextstyle(1,0,5); outtextxy(30,235,'(C) CREATED BY HOMESOFT'); settextstyle(1,0,6); outtextxy(250, 310,'1998'); readkey; readkey; for i:=639 downto 1 do rectangle(1,1,i,479); closegraph; 999: textmode(co40); textcolor(14); textbackground(blue); clrscr; ramka; gotoxy(14,3); writeln('MAIN MENU'); gotoxy(14,4); writeln('ÍÍÍÍÍÍÍÍÍ'); gotoxy(12,7); writeln('1 NOTEBOOK'); gotoxy(12,9); writeln('2 PHONEBOOK'); gotoxy(12,11); writeln('3 CALCULATOR'); gotoxy(12,13); writeln('4 EXIT NOW'); gotoxy(5,20); writeln('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»'); gotoxy(5,21); writeln('º ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ º'); gotoxy(5,22); writeln('º ³ VERSION 4.00 ³ º'); gotoxy(5,23); writeln('º ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º'); gotoxy(5,24); writeln('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ'); k:position:= readkey; case position of '1':goto 1; '2':goto 2; '3': goto 3; '4':goto 4 else goto k; end; 1:notebook; clrscr; goto 999; 2: phonebook; clrscr; goto 999; 3: closegraph; textmode(co80); calc; clrscr; goto 999; 4: textmode(co80); clrscr; end.