Contoh program dapat di download disini
Hasil Program Setelah digabung :
Untuk codingnya :
PROGRAM MULTI_LIST;
USES CRT;
TYPE RBDT = RECORD
NPM : ARRAY [1..10] OF STRING [18];
NIRM : ARRAY [1..10] OF STRING [8];
NAMA : ARRAY [1..10] OF STRING [15];
ALM : ARRAY [1..10] OF STRING [15];
END;
TYPE RNIRM = RECORD
NIRM2 : ARRAY [1..10] OF STRING [8];
TM2 : ARRAY [1..10] OF STRING [10];
TH2 : ARRAY [1..10] OF STRING [10];
END;
VAR FBDT : ARRAY [1..10] OF RBDT;
FNIRM : ARRAY [1..10] OF RNIRM;
FILEBDT : FILE OF RBDT;
FILENIRM : FILE OF RNIRM;
FILES : TEXT;
FILES2 : TEXT;
PIL : CHAR;
N : INTEGER;
LABEL RETURN;
PROCEDURE INPUT_DATA;
VAR I,J : INTEGER;
BEGIN
CLRSCR;
ASSIGN(FILES,'F_BDT.TXT');
REWRITE(FILES);
WRITELN(' FILE BIODATA');WRITELN;WRITELN(FILES,' FILE BIODATA');WRITELN(FILES);
WRITE(' BANYAKNYA DATA : ');READLN(N);WRITELN(FILES,' BANYAKNYA DATA : ',N);
FOR I := 1 TO N DO
BEGIN
WITH FBDT[I] DO
BEGIN
WRITELN(' ');WRITELN(FILES);
WRITELN(' DATA KE-',I);WRITELN(FILES,' DATA KE-',I);
WRITE(' NPM : ');READLN(NPM[I]);WRITELN(FILES,' NPM : ',NPM[I]);
WRITE(' NIRM : ');READLN(NIRM[I]);WRITELN(FILES,' NIRM : ',NIRM[I]);
WRITE(' NAMA : ');READLN(NAMA[I]);WRITELN(FILES,' NAMA : ',NAMA[I]);
WRITE(' ALAMAT : ');READLN(ALM[I]);WRITELN(FILES,' ALAMAT : ',ALM[I]);
END;
END;
CLOSE(FILES);
CLRSCR;
ASSIGN(FILES2,'F_NIRM.TXT');
REWRITE(FILES2);
WRITELN(' FILE NIRM');WRITELN(FILES2,' FILE NIRM');WRITELN(FILES2);
WRITELN(' BANYAKNYA DATA : ',N);WRITELN(FILES2,' BANYAKNYA DATA : ',N);
FOR J:= 1 TO N DO
BEGIN
WITH FNIRM[J] DO
BEGIN
WRITELN('');WRITELN(FILES2);
WRITELN(' DATA KE-',J);WRITELN(FILES2,' DATA KE-',J);
WRITE(' NIRM : ');READLN(NIRM2[J]);WRITELN(FILES2,' NIRM : ',NIRM2[J]);
WRITE(' TANGGAL MULAI : ');READLN(TM2[J]);WRITELN(FILES2,' TANGGAL MULAI : ',TM2[J]);
WRITE(' TANGGAL HABIS : ');READLN(TH2[J]);WRITELN(FILES2,' TANGGAL HABIS : ',TH2[J]);
END;
END;
CLOSE(FILES2);
END;
PROCEDURE LINES;
VAR I : INTEGER;
BEGIN
FOR I := 1 TO 80 DO
WRITE('-');
END;
PROCEDURE VIEW_DATA;
VAR I,J : INTEGER;
BEGIN
CLRSCR;
FOR I := 1 TO N DO
BEGIN
FOR J := 1 TO N DO
BEGIN
WITH FBDT[I] DO
BEGIN
WITH FNIRM[J] DO
BEGIN
IF NIRM[I] = NIRM2[J] THEN
BEGIN
GOTOXY (55,6+I);WRITE(TM2[J]);
GOTOXY (68,6+I);WRITE(TH2[J]);
END
ELSE
BEGIN
GOTOXY (52,6+I);WRITE('TIDAK ADA TANGGAL');
END;
END;
GOTOXY (31,2);WRITELN('DATA MAHASISWA');
GOTOXY (1,4);LINES;
GOTOXY (2,5);WRITELN('NO NPM NIRM NAMA ALAMAT TGL MASUK TGL HABIS');
GOTOXY (1,6);LINES;
GOTOXY (2,6+I);WRITE(I:2);
GOTOXY (7,6+I);WRITE(NPM[I]);
GOTOXY (17,6+I);WRITE(NIRM[I]);
GOTOXY (27,6+I);WRITE(NAMA[I]);
GOTOXY (41,6+I);WRITE(ALM[I]);
END;
END;
END;
GOTOXY (1,7+I);LINES;
READLN;
END;
BEGIN
REPEAT
RETURN:
CLRSCR;
GOTOXY (9,3);WRITELN('<<< MENU FILE >>>');
GOTOXY (4,5);WRITELN('1. FILE BARU DAN INPUT DATA');
GOTOXY (4,6);WRITELN('2. TAMPILKAN DATA');
GOTOXY (4,7);WRITELN('3. SELESAI');
GOTOXY (4,9);WRITE('PILIHAN ANDA : ');READLN(PIL);
IF NOT (PIL IN ['1'..'5']) THEN
BEGIN
WRITELN(CHAR(7));
GOTOXY (23,13);WRITELN('PILIHAN SALAH !!!');
READLN;
GOTO RETURN;
END;
CASE PIL OF
'1' : INPUT_DATA;
'2' : VIEW_DATA;
END;
UNTIL PIL = '3';
END.
Terimakasih. Untuk Kurang dan Lebihnya saya mohon maaf .
Tidak ada komentar:
Posting Komentar