hey guys a new programmer here..well i'm still in high school and we're using turbo pascal and i have this Major project doing and i am currently making a database in a program .. using "assigns" "rewrite" and the famous I/O Results. These parts are going fine but when i viewed my program object code( the people and their information) i can only see the last two people and their information ..my teacher said to get codes to scroll up and down O_O ( like you're supposed to give them to me). any ways this project is real important and i was wandering if you guys know some codes to scroll up and down. please send me the link(s) . Plus i'm using turbo pascal 7.0 16 bit. or i can upload my program and you can just input the codes for viewing the information.
thanks...
oh and can any one tell me how to make a box using alt
the scrolling codes have to go in view_member(dda,dpi and dsgo)
Program schoolSBA;
uses crt, dos;
Type
MemberDatabaseDDC = record {declaration of record}
Member_ID : string[10];
Member_Name:String[30];
Member_Address :String[50];
Member_Phone : String[14];
Member_Age:string[3];
Member_TicketPayment:Real;
Advert:string;
end;
MemberDatabaseDPI=record
Member_ID : string[10];
Member_Name:String[30];
Member_Address :String[50];
Member_Phone : String[14];
Member_Age:string[3];
Member_TicketPayment:Real;
end;
MemberDatabaseDSGO = record
Member_ID : string[10];
Member_Name:String[30];
Member_Address :String[50];
Member_Phone : String[14];
Member_Age:string[3];
Member_TicketPayment:Real;
end;
var
DDCDatabasefile : file of MemberDatabaseDDC;
DatabaseRecDDC: MemberDatabaseDDC; {variable for DDC record}
DPIDatabasefile: file of MemberDatabaseDPI;
DatabaseRecDPI: MemberDatabaseDPI;{variable for DPI record}
DSGODatabasefile : file of MemberDatabaseDSGO;
DatabaseRecDSGO :MemberDatabaseDSGO; {variable for DSGO record}
Choice, count,i: integer;
Opened : Boolean;
Databasename : String;
Procedure Mainmenu; Forward;
{*************************************************
*This Procedure is used to display the Main Menu *
*of the program. *
**************************************************}
Procedure Viewmenu;
{Procedure to display intro}
Begin
clrscr;
TextColor(red+black);
Textbackground(black);
Clrscr;
GotoXY (1,4);
WriteLn( 'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
WriteLn('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º');
WriteLn('º º º º');
WriteLn('º º º º');
WriteLn('º º º º');
WriteLn('º º º º');
WriteLn('º º º º');
WriteLn('º º º º');
WriteLn('º º º º');
WriteLn('º º º º');
WriteLn('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º');
WriteLn('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ');
GoToXY(23,23);
GotoXY (16,6);
Writeln('* Welcome to the Member database program.*');
TextColor(Green);
GotoXY(16,8);
Writeln('This program was written by Michael L. Jarvis');
GotoXY (16,10);
writeln('a student of the Saint Mary`s Academy.');
GotoXY(16,12);
Writeln('Press "ENTER" to access the main menu.');
readln;
end;
Function File_exist:integer;
Begin
clrscr;
Assign(DDCdatabasefile,'Memberdatabase.dat');
{$I-}
Reset (DDCDatabasefile);
{$I+}
If IOResult<>0 then
Rewrite(DDCDatabasefile);
{$I+}
File_Exist := IOResult;
Close(DDCDatabasefile);
end;
procedure advert;
{************************************************************************
*This Procedure Provides a list of the bands which will be performing *
*at the 16th annual World Creole Music Festival. *
************************************************************************}
var
Ans:char;
Begin
clrscr;
Assign(DDCDatabasefile,'MemberDatabase.dat');
{$I-}
Reset(DDCDatabasefile);
{$I+}
For count :=0 to filesize(DDCDatabasefile) -1 do
Begin
Seek(DDCDatabasefile,count);
Read(DDCDatabasefile,DatabaseRecDDC);
Writeln;
Writeln;
end;
close(DDCDatabasefile);
Textcolor(Yellow);
Textbackground(black);
GotoXY(24,9);
Writeln('------------------------------------------------');
GotoXY(23,10);
Writeln('------------------------------------------------');
GotoXY(23,11);
Writeln(' Welcome to the Advertisement. ');
GOTOXY(23,12);
Writeln(' ');
GOTOXY(23,12);
Writeln('-----------------------------------------------');
Gotoxy(23,13);
Writeln('-----------------------------------------------');
Writeln('*****************************************************************');
Writeln;
Writeln('ON OCTOBER 29th Come see Krosfyah,Beenie Man, Maxi Priest');
Writeln;
Writeln('Third World,Kassav and Midnight Groovers!!!!');
Writeln;
Writeln('On October 30th We have Carimi,Beris Hammond, UB40,Red Hot Flames');
Writeln;
Writeln('Grammacks and WCK.');
Writeln;
Writeln('ON OCTOBER 31st Come and dance to the music of Tabou Combo');
Writeln;
Writeln('Swinging Starz,Nazio Fontaine, Sean Paul, Jah Cure and Triple k!');
Writeln;
Writeln('This is all the Information that we have for the bands, thanks for');
Writeln;
Writeln('looking at the list.');
Writeln;
Writeln('*****************************************************************');
Textcolor(RED);
Writeln('PRESS ANY LETTER EXCEPT B TO GO BACK TO MAIN MENU');
Readln(Ans);
If Ans = 'b' then
Begin
Advert;
end
else
Mainmenu;
end;
{*********************************************************************}
Procedure Add_MemberDDC;
{*********************************************************************
*This Procedure is used to add members into the DDA database*
*********************************************************************}
BEGIN
clrscr;
Assign(DDCDatabasefile,'MemberDatabase.dat');
{$I-}
Reset(DDCDatabasefile);
{$I+}
If IOResult <>0 then
Rewrite(DDCDatabasefile);
{$I+}
Repeat
Textcolor(Green);
Textbackground(Black);
GotoXY(23,8);
Writeln('------------------------------------------------');
GotoXY(23,9);
Writeln('------------------------------------------------');
GotoXY(32,10);
Writeln(' Welcome to the DDC database. ');
GOTOXY(23,11);
Writeln(' ');
GOTOXY(23,11);
Writeln('----------------------------------------------- ');
Gotoxy(23,12);
Writeln('----------------------------------------------- ');
Writeln;
Writeln('Enter the Member ID.');
readln(DatabaseRecDDC.Member_ID);
Writeln;
Writeln('Enter the Member full name.');
Readln(DatabaseRecDDC.Member_Name);
Writeln;
Writeln('Enter the Member address.');
Readln(DatabaseRecDDC.Member_Address);
Writeln;
Writeln('Enter the Member phone number.');
Readln(DatabaseRecDDC.Member_Phone);
Writeln;
Writeln('Enter the Member age.');
Readln(
DatabaseRecDDC.Member_Age);
Writeln('Enter the Member Ticket Price');
Readln(DatabaseRecDDC.Member_TicketPayment);
Writeln;
{I-}
Until IOResult = 0;
seek(DDCDatabasefile,filesize(DDCDatabasefile));
Write('Now there are ',FileSize(DDCdatabasefile),' records in the DDC Database ');
ReadLn;
Write(DDCDatabasefile,DatabaseRecDDC);
Close(DDCDatabasefile);
Mainmenu;
end;
{***********************************************************************}
Procedure Add_MemberDPI;
{***********************************************************************
*This procedure is used to add members into the DPI database *
***********************************************************************}
Begin
clrscr;
Assign(DPIDatabasefile,'MemberDatabase.dat');
{$I-}
Reset(DPIDatabasefile);
{$I+}
If IOResult <>0 then
Rewrite(DPIDatabasefile);
{$I+}
Repeat
Textcolor(black);
Textbackground(Yellow);
GotoXY(23,8);
Writeln('------------------------------------------------');
GotoXY(23,9);
Writeln('------------------------------------------------');
GotoXY(32,10);
Writeln(' Welcome to the DPI database ');
GOTOXY(23,11);
Writeln(' ');
GOTOXY(23,11);
Writeln('-----------------------------------------------');
Gotoxy(23,12);
Writeln('-----------------------------------------------');
Writeln;
Writeln('Enter the Member ID.');
Readln(DatabaseRecDPI.Member_ID);
Writeln;
Writeln('Enter the Member full name.');
Readln(DatabaseRecDPI.Member_Name);
Writeln;
Writeln('Enter the Member address.');
Readln(DatabaseRecDPI.Member_Address);
Writeln;
Writeln('Enter the Member phone number.');
Readln(DatabaseRecDPI.Member_Phone);
Writeln;
Writeln('Enter the Member age.');
Readln(DatabaseRecDPI.Member_Age);
Writeln('Enter the Member Ticket Price');
Readln(DatabaseRecDPI.Member_TicketPayment);
Writeln;
{I-}
Until IOResult = 0;
seek(DPIDatabasefile,filesize(DPIDatabasefile));
Write(DPIDatabasefile,DatabaseRecDPI);
Write('Now there are ',FileSize(DPIdatabasefile),' records in the DPI database. ');
ReadLn;
Close(DPIDatabasefile);
Mainmenu;
end;
{**********************************************************************}
Procedure Add_MemberDSGO;
{***********************************************************************
*This Procedure is used to add members to the DSGO database *
***********************************************************************}
Begin
clrscr;
Assign(DSGODatabasefile,'MemberDatabase.dat');
{$I-}
Reset(DSGODatabasefile);
{$I+}
If IOResult <>0 then
Rewrite(DSGODatabasefile);
{$I+}
Repeat
Textcolor(Red);
Textbackground(black);
GotoXY(23,8);
Writeln('------------------------------------------------');
GotoXY(23,9);
Writeln('------------------------------------------------');
GotoXY(32,10);
Writeln(' Welcome to the DSGO database. ');
GOTOXY(23,11);
Writeln(' ');
GOTOXY(23,11);
Writeln('-----------------------------------------------');
Gotoxy(23,12);
Writeln('-----------------------------------------------');
Writeln;
Writeln('Enter the Member ID.');
readln(DatabaseRecDSGO.Member_ID);
Writeln;
Writeln('Enter the Member full name.');
Readln(DatabaseRecDSGO.Member_Name);
Writeln;
Writeln('Enter the Member address.');
Readln(DatabaseRecDSGO.Member_Address);
Writeln;
Writeln('Enter the Member phone number.');
Readln(DatabaseRecDSGO.Member_Phone);
Writeln ;
Writeln('Enter the Member age.');
Readln(DatabaseRecDSGO.Member_Age);
Writeln('Enter the Member Ticket Price');
Readln(DatabaseRecDSGO.Member_TicketPayment);
Writeln;
{I-}
Until IOResult = 0;
seek(DSGODatabasefile,filesize(DSGODatabasefile));
Write(DSGODatabasefile,DatabaseRecDSGO);
Write('Now there are ',FileSize(DSGOdatabasefile),' records in the DSGO database. ');
ReadLn;
Close(DSGODatabasefile);
Mainmenu;
end;
{***********************************************************************}
Procedure GrandTotals;
{************************************************************************
*This Procedure is used to identify the totals that each group pays and *
*the total of all three groups. *
************************************************************************}
var
Ans:char;
Number:Integer;
Begin
begin
clrscr;
Textcolor(green);
Textbackground(black);
GotoXY(23,8);
Writeln('------------------------------------------------');
GotoXY(23,9);
Writeln('------------------------------------------------');
GotoXY(30,10);
Writeln(' Welcome to the Grand Totals Page. ');
GOTOXY(23,11);
Writeln(' ');
GOTOXY(23,11);
Writeln('-----------------------------------------------');
Gotoxy(23,12);
Writeln('-----------------------------------------------');
Writeln;
Writeln('ENTER the Number for the specific group to view their total.');
Writeln;
Writeln('If you press 1 then you have chosen to view the total of DDC');
Writeln;
Writeln('If you press 2 then you have chosen to view the total of DPI.');
Writeln;
Writeln('If you press 3 then you have chosen to view the total of DSGO.');
Writeln;
Writeln('If you press 4 then you will see the grand totals of all the groups');
Writeln;
Writeln('Press 5 to go back to the main menu.');
Writeln;
Readln(Number);
case number of
1:Writeln('The Total cost for DDC MEMBERS IS $3900.00 ');
2:Writeln(' The total cost for DPI Members is $2620.00');
3:Writeln(' The total cost for DSGO Members is $1260');
4:Writeln(' The total cost for all the groups are $7780.00');
5:Mainmenu;
end;
If Number>5 then
Writeln('The number you have pressed is not in use, please select another number lower than that');
Writeln;
If Number <1 then
Writeln(' The number you have pressed is too low, please press another number');
writeln;
Writeln( ' Press the letter "R" then "Enter" to stay on the page and see another total.');
writeln;
writeln('If you are satified with your results press any letter except "r" to leave');
Readln(Ans);
If Ans = 'r' then
Begin
GrandTotals;
end
else
mainmenu;
end;
end;
{************************************************************************}
Procedure Add;
{*************************************************************************
* This Procedure is used to ask the user which database he would like to *
* use to add records to the respective groups. *
*************************************************************************}
var
Ans : char;
choice:integer;
begin
clrscr;
Textcolor(Green);
Textbackground(Black);
GotoXY(23,8);
Writeln('------------------------------------------------');
GotoXY(23,9);
Writeln('------------------------------------------------');
GotoXY(23,10);
Writeln(' Welcome to the Add option on this database ');
GOTOXY(23,11);
Writeln(' ');
GOTOXY(23,11);
Writeln('-----------------------------------------------');
Gotoxy(23,12);
Writeln('-----------------------------------------------');
WRITELN;
Writeln('Here you will choose which database you want to add someone to.');
Writeln;
Writeln('Press "1" to add a person to the DDC Database.');
Writeln;
Writeln('Press "2" to add a person to the DPI Database.');
Writeln;
Writeln('Press "3" to add a person to the DSGO Database.');
Writeln;
Writeln('Press "4" if you want to go back to the main menu.');
Writeln;
Writeln('Press the respective number then press " Enter" to continue');
Readln(choice);
case choice of
1:Add_MemberDDC;
2:Add_MemberDPI;
3:Add_MemberDSGO;
4:Mainmenu;
else
Mainmenu;
end;
END;
{*************************************************************************}
Procedure View_RecordsDDC;
{*************************************************************************
*This Procedure is used to view the information about the members in the *
*DDC Database. *
*************************************************************************}
Var
Ans: INTEGER;
Begin
clrscr;
Assign(DDCDatabasefile,'MemberDatabase.dat');
{$I-}
Reset(DDCDatabasefile);
{$I+}
For count := 0 to filesize(DDCDatabasefile) -1 do
Begin
Seek(DDCDatabasefile,count);
Read(DDCDatabasefile,DatabaseRecDDC);
writeln;
Textcolor(Red);
Textbackground(Black);
Writeln;
writeln('Member Identification#:',DatabaseRecDDC.Member_ID);
writeln;
writeln('name of Member: ',DatabaseRecDDC.Member_Name);
Writeln;
Writeln('Address of Member:',DatabaseRecDDC.Member_Address);
Writeln;
Writeln('Phone number of member:',DatabaseRecDDC.Member_Phone);
writeln;
Writeln('Age of Member:',DatabaseRecDDC.Member_Age);
Writeln;
Writeln('Ticket Payment of member:',DatabaseRecDDC.Member_TicketPayment);
Writeln;
Writeln(' ***********');
end;
close(DDCDatabasefile);
Writeln;
Textcolor(Green);
Writeln('Press 1 to stay.');
Writeln('Press 2 to go back to the main menu.');
readln(ans);
case ans of
1:view_recordsDDC;
2:mainmenu;
else
mainmenu;
end;
end;
Procedure View_RecordsDPI;
{*************************************************************************
*This Procedure is used to view the information about the members in the *
*DPI Database. *
*************************************************************************}
Var
Ans: INTEGER;
Begin
clrscr;
Assign(DPIDatabasefile,'MemberDatabase.dat');
{$I-}
Reset(DPIDatabasefile);
{$I+}
For count := 0 to filesize(DPIDatabasefile) -1 do
Begin
Seek(DPIDatabasefile,count);
Read(DPIDatabasefile,DatabaseRecDPI);
writeln;
writeln('Member Identification#:',DatabaseRecDPI.Member_ID);
writeln;
writeln('name of Member: ',DatabaseRecDPI.Member_Name);
Writeln;
Writeln('Address of Member:',DatabaseRecDPI.Member_Address);
Writeln;
Writeln('Phone number of member:',DatabaseRecDPI.Member_Phone);
writeln;
Writeln('Age of Member:',DatabaseRecDPI.Member_Age);
Writeln;
Writeln('Ticket payment of member:',DatabaseRecDPI.Member_TicketPayment);
Writeln;
Writeln(' ***********');
end;
Writeln;
Textcolor(Green);
Writeln('Press ANY LETTER, "except Y" to go back to the main menu.');
readln(ans);
Case Ans of
1:VIEW_RecordsDPI;
ELSE
MAINMENU;
end;
END;
Procedure View_RecordsDSGO;
{*************************************************************************
*This Procedure is used to view the information about the members in the *
*DSGO Database. *
*************************************************************************}
Var
Ans: INTEGER;
Begin
clrscr;
Assign(DSGODatabasefile,'MemberDatabase.dat');
{$I-}
Reset(DSGODatabasefile);
{$I+}
For count := 0 to filesize(DSGODatabasefile) -1 do
Begin
Seek(DSGODatabasefile,count);
Read(DSGODatabasefile,DatabaseRecDSGO);
writeln;
Writeln;
writeln('Member Identification#:',DatabaseRecDSGO.Member_ID);
writeln;
writeln('name of Member: ',DatabaseRecDSGO.Member_Name);
Writeln;
Writeln('Address of Member:',DatabaseRecDSGO.Member_Address);
Writeln;
Writeln('Phone number of member:',DatabaseRecDSGO.Member_Phone);
writeln;
Writeln('Age of Member:',DatabaseRecDSGO.Member_Age);
Writeln;
Writeln('Ticket payment of member:',DatabaseRecDSGO.Member_TicketPayment);
Writeln;
Writeln(' ***********');
end;
Writeln;
Textcolor(Green);
Writeln('Press 1 to stay .');
Writeln('Press 2 to go back to main menu.');
readln(ans);
Case Ans of
1:VIEW_RecordsDPI;
2:Mainmenu;
ELSE
MAINMENU;
end;
END;
{*************************************************************************}
Procedure Viewing;
{*************************************************************************
*This procedure is used to view the members in the different groups. *
*************************************************************************}
Var
Ans : char;
choice:Integer;
Begin
clrscr;
GotoXY(23,8);
Writeln('------------------------------------------------');
GotoXY(23,9);
Writeln('------------------------------------------------');
GotoXY(23,10);
Writeln(' Welcome to the Viewing option on this database ');
GOTOXY(23,11);
Writeln(' ');
GOTOXY(23,11);
Writeln('-----------------------------------------------');
Gotoxy(23,12);
Writeln('-----------------------------------------------');
Writeln('Welcome to the View option of this program');
Writeln('Here you have to select a number to view members in their group.');
Writeln;
Writeln('Press "1" to view DDC Members.');
Writeln;
Writeln('Press "2" to view DPI Members.');
Writeln;
Writeln('Press "3" to view DSGO Members.');
Writeln;
Writeln('Press "4" to go back to the main menu.');
Writeln;
Writeln('Select the number then press Enter.');
Readln(choice);
Case choice of
1:View_RecordsDDC;
2:View_RecordsDPI;
3:View_RecordsDSGO;
4:MainMenu;
else
Mainmenu;
end;
end;
Procedure AboutWCMF;
{************************************************************************
*This Procedure is used to give a brief synopsis about the WCMF *
************************************************************************}
Var
Ans:char;
Begin
Clrscr;
Assign(DDCDatabasefile,'MemberDatabase.dat');
{$I-}
Reset(DDCDatabasefile);
{$I+}
Begin
Seek(DDCDatabasefile,count);
Read(DDCDatabasefile,DatabaseRecDDC);
Writeln;
TextBackground(black);
Textcolor(yellow);
GotoXY(23,8);
Writeln('------------------------------------------------');
GotoXY(23,9);
Writeln('------------------------------------------------');
GotoXY(23,10);
Writeln(' Welcome to the Brief history of WCMF. ');
GOTOXY(23,11);
Writeln(' ');
GOTOXY(23,11);
Writeln('-----------------------------------------------');
Gotoxy(23,12);
Writeln('-----------------------------------------------');
Writeln('The World Creole Music Festival also known as WCMF was');
Writeln('established in 1997 by the Dominica Festival Commision');
Writeln('during the Independence celebrations. Its main aim was');
Writeln('to increase the country revenue from stay over visitors');
Writeln('coming to the island for the celebration and also to ');
Writeln('further broaden Dominica tourism products and to promote');
Writeln('the islands creole music. The WCMF has been a great and ');
Writeln('never disappointing show since it has been established');
Writeln('15 years ago, and it is highly improbable for anything');
Writeln('to make it unsuccessful!');
end;
Close(DDCDatabasefile);
Writeln;
Textcolor(red);
Writeln('Press any letter except "g" to go back to the main menu');
Readln(Ans);
If Ans = 'g' then
Begin
AboutWCMF;
end
else
Mainmenu;
end;
{************************************************************************}
{************************************************************************}
Procedure exit;
{*************************************************************************
*This Procedure is used merely to exit! *
*************************************************************************}
Begin
end;
{************************************************************************}
Procedure Mainmenu;
{***************************************************************************
*This Procedure is used to view and select the variety of options available*
***************************************************************************}
Begin
clrscr;
Textcolor(Green);
Textbackground(Black);
GotoXY(4,3);
Writeln('THIS PROGRAM PROVIDES A DATABASE OF THE MEMBERS ATTENDING THE');
GotoXY(15,5);
Writeln('16TH ANNUAL WORLD CREOLE MUSIC FESTIVAL');
GotoXY(24,11);
Writeln('1.Enter new Member into a database.');
GotoXY(24,13);
writeln('2.View members in their different groups.');
GotoXY(24,15);
Writeln('3.View the advertisement.');
GotoXY(24,17);
Writeln('4. View Grand totals.');
GotoXY(24,19);
Writeln('5.A brief history of WCMF. ');
GotoXY(24,21);
Writeln('6.Exit.');
Textcolor(Red);
GotoXY(32,60);
Writeln('Press the number of your choice , then press "Enter".QA);
GotoXY(70,25);
Readln(Choice);
{*********************************************************************}
Textcolor(blue);
Case choice of
1:ADD;
2:Viewing;
3:Advert;
4:GrandTotals;
5:AboutWCMF;
6:Exit;
else
Mainmenu
end;
end;
Begin{Main program}
clrscr;
Viewmenu;
Mainmenu;
end.{End of program}