<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Help(Project crisis)' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Help(Project crisis)' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sun, 19 May 2013 01:04:56 -0700</pubDate>
    <lastBuildDate>Sun, 19 May 2013 01:04:56 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426760/helpproject-crisis/</link>
      <description>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.&lt;br /&gt;
&lt;br /&gt;
thanks...&lt;br /&gt;
oh and can any one tell me how to make a box using alt&lt;br /&gt;
&lt;br /&gt;
the scrolling codes have to go in view_member(dda,dpi and dsgo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Program schoolSBA;&lt;br /&gt;
&lt;br /&gt;
uses crt, dos;&lt;br /&gt;
&lt;br /&gt;
Type&lt;br /&gt;
MemberDatabaseDDC = record {declaration of record}&lt;br /&gt;
&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
   Member_Address :String[50];&lt;br /&gt;
    Member_Phone : String[14];&lt;br /&gt;
     Member_Age:string[3];&lt;br /&gt;
      Member_TicketPayment:Real;&lt;br /&gt;
&lt;br /&gt;
       Advert:string;&lt;br /&gt;
        end;&lt;br /&gt;
&lt;br /&gt;
 MemberDatabaseDPI=record&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
   Member_Address :String[50];&lt;br /&gt;
    Member_Phone : String[14];&lt;br /&gt;
     Member_Age:string[3];&lt;br /&gt;
      Member_TicketPayment:Real;&lt;br /&gt;
      end;&lt;br /&gt;
&lt;br /&gt;
      MemberDatabaseDSGO = record&lt;br /&gt;
        Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
   Member_Address :String[50];&lt;br /&gt;
    Member_Phone : String[14];&lt;br /&gt;
     Member_Age:string[3];&lt;br /&gt;
      Member_TicketPayment:Real;&lt;br /&gt;
      end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
 DDCDatabasefile : file of MemberDatabaseDDC;&lt;br /&gt;
  DatabaseRecDDC: MemberDatabaseDDC; {variable for DDC record}&lt;br /&gt;
&lt;br /&gt;
  DPIDatabasefile: file of MemberDatabaseDPI;&lt;br /&gt;
  DatabaseRecDPI: MemberDatabaseDPI;{variable for DPI record}&lt;br /&gt;
&lt;br /&gt;
  DSGODatabasefile : file of MemberDatabaseDSGO;&lt;br /&gt;
  DatabaseRecDSGO :MemberDatabaseDSGO; {variable for DSGO record}&lt;br /&gt;
&lt;br /&gt;
   Choice, count,i: integer;&lt;br /&gt;
       Opened   : Boolean;&lt;br /&gt;
    Databasename : String;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu; Forward;&lt;br /&gt;
&lt;br /&gt;
{*************************************************&lt;br /&gt;
*This Procedure is used to display the Main Menu *&lt;br /&gt;
*of the program.                                 *&lt;br /&gt;
**************************************************
}&lt;br /&gt;
&lt;br /&gt;
     Procedure Viewmenu;&lt;br /&gt;
    {Procedure to display intro}&lt;br /&gt;
   Begin&lt;br /&gt;
 clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  TextColor(red+black);&lt;br /&gt;
  Textbackground(black);&lt;br /&gt;
  Clrscr;&lt;br /&gt;
GotoXY (1,4);&lt;br /&gt;
 WriteLn(    'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
     WriteLn('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼ º');&lt;br /&gt;
     WriteLn('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
     GoToXY(23,23);&lt;br /&gt;
&lt;br /&gt;
     GotoXY (16,6);&lt;br /&gt;
      Writeln('* Welcome to the Member database program.*');&lt;br /&gt;
        TextColor(Green);&lt;br /&gt;
          GotoXY(16,8);&lt;br /&gt;
          Writeln('This program was written by Michael L. Jarvis');&lt;br /&gt;
&lt;br /&gt;
                GotoXY (16,10);&lt;br /&gt;
    writeln('a student of the Saint Mary`s Academy.');&lt;br /&gt;
    GotoXY(16,12);&lt;br /&gt;
    Writeln('Press "ENTER" to access the main menu.');&lt;br /&gt;
  readln;&lt;br /&gt;
 end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Function File_exist:integer;&lt;br /&gt;
    Begin&lt;br /&gt;
      clrscr;&lt;br /&gt;
        Assign(DDCdatabasefile,'Memberdatabase.dat');&lt;br /&gt;
          {$I-}&lt;br /&gt;
            Reset (DDCDatabasefile);&lt;br /&gt;
           {$I+}&lt;br /&gt;
        If IOResult&amp;lt;&amp;gt;0 then&lt;br /&gt;
          Rewrite(DDCDatabasefile);&lt;br /&gt;
        {$I+}&lt;br /&gt;
      File_Exist := IOResult;&lt;br /&gt;
Close(DDCDatabasefile);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  procedure advert;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure Provides a list of the bands which will be performing   *&lt;br /&gt;
*at the 16th annual World Creole Music Festival.                        *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 var&lt;br /&gt;
&lt;br /&gt;
  Ans:char;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    clrscr;&lt;br /&gt;
      Assign(DDCDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
      {$I-}&lt;br /&gt;
       Reset(DDCDatabasefile);&lt;br /&gt;
        {$I+}&lt;br /&gt;
&lt;br /&gt;
      For count :=0 to filesize(DDCDatabasefile) -1 do&lt;br /&gt;
     Begin&lt;br /&gt;
    Seek(DDCDatabasefile,count);&lt;br /&gt;
   Read(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
&lt;br /&gt;
 Writeln;&lt;br /&gt;
&lt;br /&gt;
 Writeln;&lt;br /&gt;
  end;&lt;br /&gt;
   close(DDCDatabasefile);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Textcolor(Yellow);&lt;br /&gt;
Textbackground(black);&lt;br /&gt;
&lt;br /&gt;
GotoXY(24,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,10);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,11);&lt;br /&gt;
Writeln(' Welcome to the Advertisement.     ');&lt;br /&gt;
GOTOXY(23,12);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,12);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
Gotoxy(23,13);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
&lt;br /&gt;
Writeln('*****************************************
************************');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('ON OCTOBER 29th Come see Krosfyah,Beenie Man, Maxi Priest');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Third World,Kassav and Midnight Groovers!!!!');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('On October 30th We have Carimi,Beris Hammond, UB40,Red Hot Flames');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Grammacks and WCK.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('ON OCTOBER 31st Come and dance to the music of Tabou Combo');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Swinging Starz,Nazio Fontaine, Sean Paul, Jah Cure and Triple k!');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('This is all the Information that we have for the bands, thanks for');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('looking at the list.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('*****************************************
************************');&lt;br /&gt;
&lt;br /&gt;
Textcolor(RED);&lt;br /&gt;
Writeln('PRESS ANY LETTER EXCEPT B TO GO BACK TO MAIN MENU');&lt;br /&gt;
&lt;br /&gt;
Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
If Ans = 'b' then&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
&lt;br /&gt;
Advert;&lt;br /&gt;
end&lt;br /&gt;
else&lt;br /&gt;
Mainmenu;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************}&lt;br /&gt;
Procedure Add_MemberDDC;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************&lt;br /&gt;
*This Procedure is used to add members into the DDA database*&lt;br /&gt;
**************************************************
*******************}&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Assign(DDCDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
        Reset(DDCDatabasefile);&lt;br /&gt;
         {$I+}&lt;br /&gt;
&lt;br /&gt;
          If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
           Rewrite(DDCDatabasefile);&lt;br /&gt;
            {$I+}&lt;br /&gt;
             Repeat&lt;br /&gt;
             Textcolor(Green);&lt;br /&gt;
             Textbackground(Black);&lt;br /&gt;
             GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DDC database.                   ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Writeln;&lt;br /&gt;
              Writeln('Enter the Member ID.');&lt;br /&gt;
             readln(DatabaseRecDDC.Member_ID);&lt;br /&gt;
            Writeln;&lt;br /&gt;
           Writeln('Enter the Member full name.');&lt;br /&gt;
          Readln(DatabaseRecDDC.Member_Name);&lt;br /&gt;
         Writeln;&lt;br /&gt;
&lt;br /&gt;
  Writeln('Enter  the Member address.');&lt;br /&gt;
   Readln(DatabaseRecDDC.Member_Address);&lt;br /&gt;
    Writeln;&lt;br /&gt;
     Writeln('Enter the Member phone number.');&lt;br /&gt;
      Readln(DatabaseRecDDC.Member_Phone);&lt;br /&gt;
       Writeln;&lt;br /&gt;
        Writeln('Enter the Member age.');&lt;br /&gt;
         Readln(&lt;br /&gt;
&lt;br /&gt;
         DatabaseRecDDC.Member_Age);&lt;br /&gt;
          Writeln('Enter the Member Ticket Price');&lt;br /&gt;
         Readln(DatabaseRecDDC.Member_TicketPayment);&lt;br /&gt;
        Writeln;&lt;br /&gt;
      {I-}&lt;br /&gt;
     Until IOResult = 0;&lt;br /&gt;
    seek(DDCDatabasefile,filesize(DDCDatabasefile));&lt;br /&gt;
&lt;br /&gt;
     Write('Now there are ',FileSize(DDCdatabasefile),' records in the DDC Database ');&lt;br /&gt;
      ReadLn;&lt;br /&gt;
   Write(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
&lt;br /&gt;
  Close(DDCDatabasefile);&lt;br /&gt;
 Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
Procedure Add_MemberDPI;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************&lt;br /&gt;
*This procedure is used to add members into the DPI database           *&lt;br /&gt;
**************************************************
*********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Begin&lt;br /&gt;
  clrscr;&lt;br /&gt;
   Assign(DPIDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
    {$I-}&lt;br /&gt;
     Reset(DPIDatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
&lt;br /&gt;
        If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
         Rewrite(DPIDatabasefile);&lt;br /&gt;
          {$I+}&lt;br /&gt;
           Repeat&lt;br /&gt;
           Textcolor(black);&lt;br /&gt;
           Textbackground(Yellow);&lt;br /&gt;
           GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DPI database     ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Writeln;&lt;br /&gt;
            Writeln('Enter the Member ID.');&lt;br /&gt;
             Readln(DatabaseRecDPI.Member_ID);&lt;br /&gt;
              Writeln;&lt;br /&gt;
               Writeln('Enter the Member full name.');&lt;br /&gt;
                Readln(DatabaseRecDPI.Member_Name);&lt;br /&gt;
                 Writeln;&lt;br /&gt;
                  Writeln('Enter  the Member address.');&lt;br /&gt;
                 Readln(DatabaseRecDPI.Member_Address);&lt;br /&gt;
                Writeln;&lt;br /&gt;
               Writeln('Enter the Member phone number.');&lt;br /&gt;
              Readln(DatabaseRecDPI.Member_Phone);&lt;br /&gt;
             Writeln;&lt;br /&gt;
            Writeln('Enter the Member age.');&lt;br /&gt;
           Readln(DatabaseRecDPI.Member_Age);&lt;br /&gt;
          Writeln('Enter the Member Ticket Price');&lt;br /&gt;
         Readln(DatabaseRecDPI.Member_TicketPayment);&lt;br /&gt;
        Writeln;&lt;br /&gt;
       {I-}&lt;br /&gt;
     Until IOResult = 0;&lt;br /&gt;
    seek(DPIDatabasefile,filesize(DPIDatabasefile));&lt;br /&gt;
   Write(DPIDatabasefile,DatabaseRecDPI);&lt;br /&gt;
   Write('Now there are ',FileSize(DPIdatabasefile),' records in the DPI database. ');&lt;br /&gt;
      ReadLn;&lt;br /&gt;
  Close(DPIDatabasefile);&lt;br /&gt;
 Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
*********************}&lt;br /&gt;
&lt;br /&gt;
Procedure Add_MemberDSGO;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************&lt;br /&gt;
*This Procedure is used to add members to the DSGO database            *&lt;br /&gt;
**************************************************
*********************}&lt;br /&gt;
&lt;br /&gt;
  Begin&lt;br /&gt;
   clrscr;&lt;br /&gt;
    Assign(DSGODatabasefile,'MemberDatabase.dat');&lt;br /&gt;
     {$I-}&lt;br /&gt;
      Reset(DSGODatabasefile);&lt;br /&gt;
       {$I+}&lt;br /&gt;
&lt;br /&gt;
        If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
         Rewrite(DSGODatabasefile);&lt;br /&gt;
          {$I+}&lt;br /&gt;
           Repeat&lt;br /&gt;
           Textcolor(Red);&lt;br /&gt;
           Textbackground(black);&lt;br /&gt;
           GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DSGO database.                  ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Writeln;&lt;br /&gt;
            Writeln('Enter the Member ID.');&lt;br /&gt;
             readln(DatabaseRecDSGO.Member_ID);&lt;br /&gt;
              Writeln;&lt;br /&gt;
               Writeln('Enter the Member full name.');&lt;br /&gt;
                Readln(DatabaseRecDSGO.Member_Name);&lt;br /&gt;
                 Writeln;&lt;br /&gt;
                  Writeln('Enter  the Member address.');&lt;br /&gt;
                 Readln(DatabaseRecDSGO.Member_Address);&lt;br /&gt;
                Writeln;&lt;br /&gt;
               Writeln('Enter the Member phone number.');&lt;br /&gt;
              Readln(DatabaseRecDSGO.Member_Phone);&lt;br /&gt;
             Writeln ;&lt;br /&gt;
            Writeln('Enter the Member age.');&lt;br /&gt;
           Readln(DatabaseRecDSGO.Member_Age);&lt;br /&gt;
          Writeln('Enter the Member Ticket Price');&lt;br /&gt;
         Readln(DatabaseRecDSGO.Member_TicketPayment);&lt;br /&gt;
        Writeln;&lt;br /&gt;
&lt;br /&gt;
      {I-}&lt;br /&gt;
     Until IOResult = 0;&lt;br /&gt;
    seek(DSGODatabasefile,filesize(DSGODatabasefile));&lt;br /&gt;
   Write(DSGODatabasefile,DatabaseRecDSGO);&lt;br /&gt;
     Write('Now there are ',FileSize(DSGOdatabasefile),' records in the DSGO database. ');&lt;br /&gt;
      ReadLn;&lt;br /&gt;
  Close(DSGODatabasefile);&lt;br /&gt;
 Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
Procedure GrandTotals;&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure is used to identify the totals that each group pays and *&lt;br /&gt;
*the total of all three groups.                                         *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 var&lt;br /&gt;
  Ans:char;&lt;br /&gt;
  Number:Integer;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
    clrscr;&lt;br /&gt;
        Textcolor(green);&lt;br /&gt;
        Textbackground(black);&lt;br /&gt;
        GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(30,10);&lt;br /&gt;
Writeln(' Welcome to the Grand Totals Page.     ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Writeln;&lt;br /&gt;
        Writeln('ENTER the Number for the specific group to view their total.');&lt;br /&gt;
        Writeln;&lt;br /&gt;
        Writeln('If you press 1 then you have chosen to view the total of DDC');&lt;br /&gt;
        Writeln;&lt;br /&gt;
        Writeln('If you press 2 then you have chosen to view the total of DPI.');&lt;br /&gt;
        Writeln;&lt;br /&gt;
        Writeln('If you press 3 then you have chosen to view the total of DSGO.');&lt;br /&gt;
        Writeln;&lt;br /&gt;
        Writeln('If you press 4 then you will see the grand totals of all the groups');&lt;br /&gt;
        Writeln;&lt;br /&gt;
        Writeln('Press 5 to go back to the main menu.');&lt;br /&gt;
        Writeln;&lt;br /&gt;
        Readln(Number);&lt;br /&gt;
&lt;br /&gt;
        case number of&lt;br /&gt;
        1:Writeln('The Total cost for DDC MEMBERS IS $3900.00 ');&lt;br /&gt;
        2:Writeln('  The total cost for DPI Members is $2620.00');&lt;br /&gt;
        3:Writeln(' The total cost for DSGO Members is $1260');&lt;br /&gt;
        4:Writeln(' The total cost for all the groups are $7780.00');&lt;br /&gt;
        5:Mainmenu;&lt;br /&gt;
         end;&lt;br /&gt;
&lt;br /&gt;
         If Number&amp;gt;5 then&lt;br /&gt;
                Writeln('The number you have pressed is not in use, please select another number lower than that');&lt;br /&gt;
         Writeln;&lt;br /&gt;
&lt;br /&gt;
         If Number &amp;lt;1 then&lt;br /&gt;
                Writeln(' The number you have pressed is too low, please press another number');&lt;br /&gt;
                writeln;&lt;br /&gt;
     Writeln( ' Press the letter "R" then "Enter" to stay on the page and see another total.');&lt;br /&gt;
     writeln;&lt;br /&gt;
     writeln('If you are satified with your results press any letter except "r" to leave');&lt;br /&gt;
     Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
     If Ans = 'r' then&lt;br /&gt;
     Begin&lt;br /&gt;
     GrandTotals;&lt;br /&gt;
&lt;br /&gt;
     end&lt;br /&gt;
     else&lt;br /&gt;
     mainmenu;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
Procedure Add;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
* This Procedure is used to ask the user which database he would like to *&lt;br /&gt;
* use to add records to the respective groups.                           *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:integer;&lt;br /&gt;
begin&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
Textcolor(Green);&lt;br /&gt;
Textbackground(Black);&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,10);&lt;br /&gt;
Writeln(' Welcome to the Add option on this database     ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WRITELN;&lt;br /&gt;
Writeln('Here you will choose which database you want to add someone to.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press "1" to add a person to the DDC Database.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press "2" to add a person to the DPI Database.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press "3" to add a person to the DSGO Database.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press "4" if you want to go back to the main menu.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press " Enter" to continue');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
case choice of&lt;br /&gt;
&lt;br /&gt;
1:Add_MemberDDC;&lt;br /&gt;
2:Add_MemberDPI;&lt;br /&gt;
3:Add_MemberDSGO;&lt;br /&gt;
4:Mainmenu;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************}&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDDC;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This Procedure is used to view the information about the members in the *&lt;br /&gt;
*DDC Database.                                                           *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
 Var&lt;br /&gt;
  Ans: INTEGER;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    clrscr;&lt;br /&gt;
     Assign(DDCDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
      {$I-}&lt;br /&gt;
       Reset(DDCDatabasefile);&lt;br /&gt;
         {$I+}&lt;br /&gt;
&lt;br /&gt;
          For count := 0 to filesize(DDCDatabasefile) -1 do&lt;br /&gt;
&lt;br /&gt;
           Begin&lt;br /&gt;
              Seek(DDCDatabasefile,count);&lt;br /&gt;
             Read(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
              writeln;&lt;br /&gt;
              Textcolor(Red);&lt;br /&gt;
              Textbackground(Black);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              Writeln;&lt;br /&gt;
           writeln('Member Identification#:',DatabaseRecDDC.Member_ID);&lt;br /&gt;
          writeln;&lt;br /&gt;
         writeln('name of Member: ',DatabaseRecDDC.Member_Name);&lt;br /&gt;
        Writeln;&lt;br /&gt;
       Writeln('Address of Member:',DatabaseRecDDC.Member_Address);&lt;br /&gt;
      Writeln;&lt;br /&gt;
     Writeln('Phone number of member:',DatabaseRecDDC.Member_Phone);&lt;br /&gt;
    writeln;&lt;br /&gt;
   Writeln('Age of Member:',DatabaseRecDDC.Member_Age);&lt;br /&gt;
   Writeln;&lt;br /&gt;
   Writeln('Ticket Payment of member:',DatabaseRecDDC.Member_TicketPayment);&lt;br /&gt;
  Writeln;&lt;br /&gt;
 Writeln('  ***********');&lt;br /&gt;
end;&lt;br /&gt;
 close(DDCDatabasefile);&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
   Textcolor(Green);&lt;br /&gt;
   Writeln('Press 1 to stay.');&lt;br /&gt;
    Writeln('Press 2 to go back to the main menu.');&lt;br /&gt;
     readln(ans);&lt;br /&gt;
&lt;br /&gt;
  case ans of&lt;br /&gt;
  1:view_recordsDDC;&lt;br /&gt;
  2:mainmenu;&lt;br /&gt;
  else&lt;br /&gt;
  mainmenu;&lt;br /&gt;
  end;&lt;br /&gt;
  end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Procedure View_RecordsDPI;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This Procedure is used to view the information about the members in the *&lt;br /&gt;
*DPI Database.                                                           *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
 Var&lt;br /&gt;
  Ans: INTEGER;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    clrscr;&lt;br /&gt;
     Assign(DPIDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
      {$I-}&lt;br /&gt;
       Reset(DPIDatabasefile);&lt;br /&gt;
         {$I+}&lt;br /&gt;
&lt;br /&gt;
          For count := 0 to filesize(DPIDatabasefile) -1 do&lt;br /&gt;
&lt;br /&gt;
           Begin&lt;br /&gt;
              Seek(DPIDatabasefile,count);&lt;br /&gt;
             Read(DPIDatabasefile,DatabaseRecDPI);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
writeln;&lt;br /&gt;
           writeln('Member Identification#:',DatabaseRecDPI.Member_ID);&lt;br /&gt;
          writeln;&lt;br /&gt;
         writeln('name of Member: ',DatabaseRecDPI.Member_Name);&lt;br /&gt;
        Writeln;&lt;br /&gt;
       Writeln('Address of Member:',DatabaseRecDPI.Member_Address);&lt;br /&gt;
      Writeln;&lt;br /&gt;
     Writeln('Phone number of member:',DatabaseRecDPI.Member_Phone);&lt;br /&gt;
    writeln;&lt;br /&gt;
   Writeln('Age of Member:',DatabaseRecDPI.Member_Age);&lt;br /&gt;
   Writeln;&lt;br /&gt;
   Writeln('Ticket payment of member:',DatabaseRecDPI.Member_TicketPayment);&lt;br /&gt;
  Writeln;&lt;br /&gt;
 Writeln('  ***********');&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
   Textcolor(Green);&lt;br /&gt;
    Writeln('Press ANY LETTER, "except Y" to go back to the main menu.');&lt;br /&gt;
     readln(ans);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Case Ans of&lt;br /&gt;
  1:VIEW_RecordsDPI;&lt;br /&gt;
&lt;br /&gt;
  ELSE&lt;br /&gt;
  MAINMENU;&lt;br /&gt;
    end;&lt;br /&gt;
    END;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Procedure View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This Procedure is used to view the information about the members in the *&lt;br /&gt;
*DSGO Database.                                                          *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
 Var&lt;br /&gt;
  Ans: INTEGER;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    clrscr;&lt;br /&gt;
     Assign(DSGODatabasefile,'MemberDatabase.dat');&lt;br /&gt;
      {$I-}&lt;br /&gt;
       Reset(DSGODatabasefile);&lt;br /&gt;
         {$I+}&lt;br /&gt;
&lt;br /&gt;
          For count := 0 to filesize(DSGODatabasefile) -1 do&lt;br /&gt;
&lt;br /&gt;
           Begin&lt;br /&gt;
              Seek(DSGODatabasefile,count);&lt;br /&gt;
             Read(DSGODatabasefile,DatabaseRecDSGO);&lt;br /&gt;
              writeln;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              Writeln;&lt;br /&gt;
           writeln('Member Identification#:',DatabaseRecDSGO.Member_ID);&lt;br /&gt;
          writeln;&lt;br /&gt;
         writeln('name of Member: ',DatabaseRecDSGO.Member_Name);&lt;br /&gt;
        Writeln;&lt;br /&gt;
       Writeln('Address of Member:',DatabaseRecDSGO.Member_Address);&lt;br /&gt;
      Writeln;&lt;br /&gt;
     Writeln('Phone number of member:',DatabaseRecDSGO.Member_Phone);&lt;br /&gt;
    writeln;&lt;br /&gt;
   Writeln('Age of Member:',DatabaseRecDSGO.Member_Age);&lt;br /&gt;
   Writeln;&lt;br /&gt;
   Writeln('Ticket payment of member:',DatabaseRecDSGO.Member_TicketPayment);&lt;br /&gt;
  Writeln;&lt;br /&gt;
 Writeln('  ***********');&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
   Textcolor(Green);&lt;br /&gt;
   Writeln('Press 1 to stay  .');&lt;br /&gt;
    Writeln('Press 2 to go back to main menu.');&lt;br /&gt;
     readln(ans);&lt;br /&gt;
&lt;br /&gt;
  Case Ans of&lt;br /&gt;
  1:VIEW_RecordsDPI;&lt;br /&gt;
  2:Mainmenu;&lt;br /&gt;
&lt;br /&gt;
  ELSE&lt;br /&gt;
  MAINMENU;&lt;br /&gt;
    end;&lt;br /&gt;
    END;&lt;br /&gt;
&lt;br /&gt;
  {*************************************************
************************}&lt;br /&gt;
&lt;br /&gt;
Procedure Viewing;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This procedure is used to view the members in the different groups.     *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:Integer;&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,10);&lt;br /&gt;
Writeln(' Welcome to the Viewing option on this database ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Writeln('Welcome to the View option of this program');&lt;br /&gt;
Writeln('Here you have to select a number to view members in their group.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press "1" to view DDC Members.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press "2" to view DPI Members.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press "3" to view DSGO Members.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press "4" to go back to the main menu.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Select the number then press Enter.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Case choice of&lt;br /&gt;
1:View_RecordsDDC;&lt;br /&gt;
2:View_RecordsDPI;&lt;br /&gt;
3:View_RecordsDSGO;&lt;br /&gt;
4:MainMenu;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure  AboutWCMF;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure is used to give a brief synopsis about the WCMF         *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 Var&lt;br /&gt;
  Ans:char;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    Clrscr;&lt;br /&gt;
     Assign(DDCDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
      {$I-}&lt;br /&gt;
       Reset(DDCDatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
&lt;br /&gt;
     Begin&lt;br /&gt;
    Seek(DDCDatabasefile,count);&lt;br /&gt;
   Read(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
 TextBackground(black);&lt;br /&gt;
Textcolor(yellow);&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,10);&lt;br /&gt;
Writeln(' Welcome to the Brief history of WCMF.     ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('-----------------------------------------------');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Writeln('The World Creole Music Festival also known as WCMF was');&lt;br /&gt;
Writeln('established in 1997 by the Dominica Festival Commision');&lt;br /&gt;
Writeln('during the Independence celebrations. Its main aim was');&lt;br /&gt;
Writeln('to increase the country revenue from stay over visitors');&lt;br /&gt;
Writeln('coming to the island for the celebration and also to ');&lt;br /&gt;
Writeln('further broaden Dominica tourism products and to promote');&lt;br /&gt;
Writeln('the islands creole music. The WCMF has been a great and ');&lt;br /&gt;
Writeln('never disappointing  show since it has been established');&lt;br /&gt;
Writeln('15 years ago, and it is highly improbable for anything');&lt;br /&gt;
Writeln('to make it unsuccessful!');&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 Close(DDCDatabasefile);&lt;br /&gt;
  Writeln;&lt;br /&gt;
   Textcolor(red);&lt;br /&gt;
    Writeln('Press any letter except "g" to go back to the main menu');&lt;br /&gt;
     Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
      If Ans = 'g' then&lt;br /&gt;
&lt;br /&gt;
     Begin&lt;br /&gt;
    AboutWCMF;&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
 Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure exit;&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This Procedure is used merely to exit!                                  *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
Begin&lt;br /&gt;
end;&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**************************&lt;br /&gt;
*This Procedure is used to view and select the variety of options available*&lt;br /&gt;
**************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
Textcolor(Green);&lt;br /&gt;
Textbackground(Black);&lt;br /&gt;
&lt;br /&gt;
GotoXY(4,3);&lt;br /&gt;
Writeln('THIS PROGRAM PROVIDES A DATABASE OF THE MEMBERS ATTENDING THE');&lt;br /&gt;
GotoXY(15,5);&lt;br /&gt;
Writeln('16TH ANNUAL WORLD CREOLE MUSIC FESTIVAL');&lt;br /&gt;
GotoXY(24,11);&lt;br /&gt;
Writeln('1.Enter new Member into a database.');&lt;br /&gt;
GotoXY(24,13);&lt;br /&gt;
writeln('2.View members in their different groups.');&lt;br /&gt;
GotoXY(24,15);&lt;br /&gt;
Writeln('3.View the advertisement.');&lt;br /&gt;
GotoXY(24,17);&lt;br /&gt;
Writeln('4. View Grand totals.');&lt;br /&gt;
GotoXY(24,19);&lt;br /&gt;
Writeln('5.A brief history of WCMF. ');&lt;br /&gt;
GotoXY(24,21);&lt;br /&gt;
Writeln('6.Exit.');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Textcolor(Red);&lt;br /&gt;
GotoXY(32,60);&lt;br /&gt;
Writeln('Press the number of your choice , then press "Enter".QA);&lt;br /&gt;
GotoXY(70,25);&lt;br /&gt;
Readln(Choice);&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************}&lt;br /&gt;
Textcolor(blue);&lt;br /&gt;
Case choice of&lt;br /&gt;
&lt;br /&gt;
1:ADD;&lt;br /&gt;
2:Viewing;&lt;br /&gt;
3:Advert;&lt;br /&gt;
4:GrandTotals;&lt;br /&gt;
5:AboutWCMF;&lt;br /&gt;
6:Exit;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
Mainmenu&lt;br /&gt;
end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
Begin{Main program}&lt;br /&gt;
clrscr;&lt;br /&gt;
Viewmenu;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end.{End of program}&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426760/helpproject-crisis/</guid>
      <pubDate>Mon, 09 Jan 2012 12:51:48 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426805/re-helpproject-crisis/#426805</link>
      <description>Your code does not seem to have any procedure or function named "view_member."&lt;br /&gt;
&lt;br /&gt;
By the way "exit" is not a good name for an identifier because Pascal already has a procedure named "exit," which seems to do exactly what you want your procedure to do, cause an immediate exit from the current procedure.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426805/re-helpproject-crisis/#426805</guid>
      <pubDate>Fri, 13 Jan 2012 21:08:06 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426824/re-helpproject-crisis/#426824</link>
      <description>Yes there is just look for it their names' are view_memberddc..if u can give me a code to draw a scroll bar in the object code to view them all that would be great. Thanks &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426824/re-helpproject-crisis/#426824</guid>
      <pubDate>Sat, 14 Jan 2012 15:37:06 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426825/re-helpproject-crisis/#426825</link>
      <description>Yes there is just look for it their names' are view_memberddc..if u can give me a code to draw a scroll bar in the object code to view them all that would be great. Thanks &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426825/re-helpproject-crisis/#426825</guid>
      <pubDate>Sat, 14 Jan 2012 15:38:57 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426848/re-helpproject-crisis/#426848</link>
      <description>OK.  I found it.  The procedure is &lt;strong&gt; View_RecordsDDC&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
A scroll bar is not possible with Turbo Pascal.&lt;br /&gt;
&lt;br /&gt;
This should be close to what you need.  The program begins by displaying &lt;strong&gt;SIZE&lt;/strong&gt; records ending with the "current record."  &lt;strong&gt;SIZE&lt;/strong&gt; is a &lt;strong&gt;const&lt;/strong&gt; set to 2 (line 63) but can be easily changed and the program recompiled.&lt;br /&gt;
&lt;br /&gt;
The current record is initially = 1.  The operator changes this value by hitting certain keys on the keyboard.  It is not necessary to hit the ENTER key.  Hitting the "up arrow" key increments the current record by one.  Hitting the "down arrow" decrements it by one.  PageUp increments it by 10 (the value of PGVAL – line 13) and PageDown decrements it by 10.  Finally, hitting the END key returns to the main menu.&lt;br /&gt;
&lt;br /&gt;
The variable &lt;strong&gt;n&lt;/strong&gt; is the index of the last record in the database.  It is set to -1 if the database contains no records.  &lt;strong&gt;curr&lt;/strong&gt; is the index of the “current record.”  It defaults to 1 (line 76).  &lt;strong&gt;curr&lt;/strong&gt; can assume values from -1 to &lt;strong&gt;n&lt;/strong&gt;.  If set to -1 no records are displayed.&lt;br /&gt;
&lt;br /&gt;
The &lt;strong&gt;for&lt;/strong&gt; loop indices are set to display &lt;strong&gt;SIZE&lt;/strong&gt; records ending with the current record.&lt;br /&gt;
&lt;br /&gt;
Lines 81, 82 skip that particular iteration of the loop if &lt;strong&gt;count&lt;/strong&gt; is out of range.  Defensive programming.&lt;br /&gt;
&lt;br /&gt;
Lines 78 .. 108 are a &lt;strong&gt;repeat .. until&lt;/strong&gt; loop that continues until &lt;strong&gt;curr&lt;/strong&gt; becomes an extreme negative value.  The last statement in the loop (line 107) calls &lt;strong&gt;nextrec&lt;/strong&gt; to alter the value of &lt;strong&gt;curr&lt;/strong&gt;.  &lt;strong&gt;nextrec&lt;/strong&gt; does not allow &lt;strong&gt;curr&lt;/strong&gt; outside the range -1 .. &lt;strong&gt;n&lt;/strong&gt; unless the END key is hit.&lt;br /&gt;
&lt;br /&gt;
The procedure &lt;strong&gt;nextrec&lt;/strong&gt; uses the Turbo Pascal procedure &lt;strong&gt;exit&lt;/strong&gt; so I have commented out your procedure &lt;strong&gt;exit&lt;/strong&gt; to avoid a collision.  Really no other choice.  Pascal’s &lt;strong&gt;exit&lt;/strong&gt; procedure seems to be what you need anyway.&lt;br /&gt;
&lt;br /&gt;
I have commented out lines 111 .. 122 since they are not needed.&lt;br /&gt;
&lt;br /&gt;
Your use of recursive calls to end procedures is disturbing.  When a procedure or function calls itself recursively like this it creates a new copy of itself and consumes more memory.  As far as I can tell all of your procedures, except &lt;strong&gt;mainmenu&lt;/strong&gt;, end with a recursive call, consuming more memory each time.  None of them ever seem to return from these recursive calls meaning that if an operator were to have a long enough session the program must inevitably consume all of memory and crash, possibly corrupting files when it does.  This is the sort of bug that programmer testing is unlikely to reveal, and it may even get past beta testers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I’ll leave it to you to figure out how &lt;strong&gt;nextrec&lt;/strong&gt; works.  Let me know if you need it explained.&lt;br /&gt;
&lt;br /&gt;
Sorry, but I have not had time to test any of this code.  All I can say is that it compiles and that I have used this technique many times in the past.&lt;br /&gt;
&lt;br /&gt;
Good luck.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
{  1}	   function nextrec(curr, n : longint) : longint ;
{  2}	   {
{  3}	      "scrolls" the value of curr
{  4}	   }
{  5}	   CONST
{  6}	      NUL      = chr(0) ;
{  7}	      UP       = chr(72) ;    { UP arrow }
{  8}	      DOWN     = chr(80) ;    { DOWN arrow }
{  9}	      PGUP     = chr(73) ;
{ 10}	      PGDN     = chr(81) ;
{ 11}	      QUIT     = chr(79) ;    { "END" key }
{ 12}	      KEYSET   = [UP, DOWN, PGUP, PGDN, QUIT] ;
{ 13}	      PGVAL    = 10 ;
{ 14}	
{ 15}	   var
{ 16}	      key   : char ;
{ 17}	
{ 18}	   begin
{ 19}	      while TRUE do begin  { infinite loop }
{ 20}	         key := readkey ;
{ 21}	         if key = NUL then begin
{ 21.5}             key := readkey ; 
{ 22}	            case key of
{ 23}	               UP    :  begin
{ 24}	                           if curr &amp;lt; n then
{ 25}	                              curr := curr + 1 ;
{ 26}	                           nextrec := curr ;
{ 27}	                           exit
{ 28}	                        end ;
{ 29}	               DOWN  :  begin
{ 30}	                           if curr &amp;gt; -1 then
{ 31}	                              curr := curr - 1 ;
{ 32}	                           nextrec := curr ;
{ 33}	                           exit
{ 34}	                        end ;
{ 35}	               PGUP  :  begin
{ 36}	                           if curr + PGVAL &amp;lt;= n then
{ 37}	                              curr := curr + PGVAL ;
{ 38}	                           nextrec := curr ;
{ 39}	                           exit
{ 40}	                        end ;
{ 41}	               PGDN  :  begin  
{ 42}	                           if curr - PGVAL &amp;gt;= -1 then
{ 43}	                              curr := curr - PGVAL ;
{ 44}	                           nextrec := curr ;
{ 45}	                           exit
{ 46}	                        end ;
{ 47}	               QUIT  :  begin
{ 48}	                           nextrec := -100 ;
{ 49}	                           exit
{ 50}	                        end
{ 51}	            end { case }
{ 52}	         end
{ 53}	      end
{ 54}	   end ;
{ 55}	
{ 56}	   Procedure View_RecordsDDC;
{ 57}	
{ 58}	   {*************************************************
**
{ 59}	   *  This Procedure is used to view the information  * 
{ 60}	   *  about the members in the DDC Database.          *
{ 61}	   **************************************************
*}
{ 62}	   CONST
{ 63}	      SIZE  = 2 ;    { max number or records to be displayed }
{ 64}	   Var
{ 65}	      Ans   : INTEGER;
{ 66}	      count,            { loop counter }
{ 67}	      n,                { index of last record in database file }
{ 68}	      curr  : longint ; { index of current record in database file }
{ 69}	
{ 70}	   Begin
{ 71}	      Assign(DDCDatabasefile,'MemberDatabase.dat');
{ 72}	      {$I-}
{ 73}	      Reset(DDCDatabasefile);
{ 74}	      {$I+}
{ 75}	         n     := filesize(DDCDatabasefile) - 1 ;
{ 76}	         curr  := 1 ;   { default value }
{ 77}	
{ 78}	         repeat
{ 79}	            clrscr ;
{ 80}	            For count := curr - (SIZE - 1) to curr do Begin
{ 81}	               if (count &amp;lt; 0) or (count &amp;gt; n) then 
{ 82}	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
{ 83}	               
{ 84}	               Seek(DDCDatabasefile,count);
{ 85}	               Read(DDCDatabasefile,DatabaseRecDDC);
{ 86}	               writeln;
{ 87}	               Textcolor(Red);
{ 88}	               Textbackground(Black);
{ 89}	               
{ 90}	               with DatabaseRecDDC do begin
{ 91}	                  Writeln;
{ 92}	                  writeln('Member Identification#:', Member_ID);
{ 93}	                  writeln;
{ 94}	                  writeln('name of Member: ', Member_Name);
{ 95}	                  Writeln;
{ 96}	                  Writeln('Address of Member:', Member_Address);
{ 97}	                  Writeln;
{ 98}	                  Writeln('Phone number of member:', Member_Phone);
{ 99}	                  writeln;
{100}	                  Writeln('Age of Member:', Member_Age);
{101}	                  Writeln;
{102}	                  Writeln('Ticket Payment of member:', Member_TicketPayment);
{103}	                  Writeln;
{104}	                  Writeln(' ***********');
{105}	               end
{106}	            end;
{107}	            curr := nextrec(curr, n)
{108}	         until curr &amp;lt; -99 ;
{109}	      close(DDCDatabasefile);
{110}	      (*
{111}	      Writeln;
{112}	      Textcolor(Green);
{113}	      Writeln('Press 1 to stay.');
{114}	      Writeln('Press 2 to go back to the main menu.');
{115}	      readln(ans);
{116}	
{117}	      case ans of
{118}	         1 : view_recordsDDC;
{119}	         2 : mainmenu;
{120}	         else
{121}	             mainmenu;
{122}	      end;
{123}	      *)
{124}	   end;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426848/re-helpproject-crisis/#426848</guid>
      <pubDate>Mon, 16 Jan 2012 09:38:08 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426883/re-helpproject-crisis/#426883</link>
      <description>OMG thank you very much ......it worked ..your a genius . I just executed the program and it is working good i just finished putting the same codes for the other views' i have. i just have to change the function name.&lt;br /&gt;
&lt;br /&gt;
so you were saying that i have recursive calls ..can u enlighten me on them so i can make my program alot better.&lt;br /&gt;
&lt;br /&gt;
O and if you still have a copy of my program i sent you i was wondering if you could get some codes for some animation in it...not too much but just enough to get a great mark.&lt;br /&gt;
&lt;br /&gt;
And the last thing is do you know codes to edit the info i added. cuz someone could put wrong information and have to change it . this would be deeply appreciated.&lt;br /&gt;
&lt;br /&gt;
And again thanks a Trillion........&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426883/re-helpproject-crisis/#426883</guid>
      <pubDate>Thu, 19 Jan 2012 12:41:30 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426911/re-helpproject-crisis/#426911</link>
      <description>: so you were saying that i have recursive calls ..can u enlighten me &lt;br /&gt;
: on them so i can make my program a lot better.&lt;br /&gt;
&lt;br /&gt;
Taking your questions one at a time, I'll respond to the others in later posts.  Right now I'll try to handle recursion.&lt;br /&gt;
&lt;br /&gt;
Recursion is the term used when a procedure or function calls itself.  The classic example is the factorial function.  In mathematics the factorial of an integer &lt;strong&gt;n&lt;/strong&gt; is the cumulative product of all integers from 1 to n.  Mathematicians use an exclamation point, &lt;strong&gt;!&lt;/strong&gt; for the factorial of an integer.  Thus:&lt;br /&gt;
&lt;br /&gt;
5! = 5 * 4 * 3 * 2 * 1 = 120&lt;br /&gt;
&lt;br /&gt;
Note that n! = n * (n - 1)!  e.g.  5! = 5 * n!&lt;br /&gt;
&lt;br /&gt;
This program computes the factorial of an integer.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
program nfact ;
{
   compute the factorial of a number
}
   function fact(n : longint) : longint ;
   {
      if n &amp;gt; 1 compute n(n - 1)!
   }
   begin
      if n = 1 then
         fact := 1
      else
         fact := n * fact(n - 1)
   end ;
var
   f,n : longint ;
begin
   write('Enter a number  ') ;
   readln(n) ;
   f := fact(n) ;
   writeln(n:0, '! = ', f:0)
end.
&lt;/pre&gt;&lt;br /&gt;
The function &lt;strong&gt;fact&lt;/strong&gt; works by repeatedly multiplying &lt;strong&gt;n&lt;/strong&gt; by the the factorial of &lt;strong&gt;n - 1&lt;/strong&gt;, unless &lt;strong&gt;n&lt;/strong&gt; = 1.  1! is, by definition, 1.  If &lt;strong&gt;n&lt;/strong&gt; = 5 then &lt;strong&gt;fact&lt;/strong&gt; calls itself four times, a [i]depth[/i] of 4.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;n&lt;/strong&gt; is passed to &lt;strong&gt;fact&lt;/strong&gt; by value, not by reference, so each time &lt;strong&gt;fact&lt;/strong&gt; is called it has to make room in memory for &lt;strong&gt;n&lt;/strong&gt;, since it cannot use the same space as the previous instance.  Since we are invoking &lt;strong&gt;fact&lt;/strong&gt; 5 times (for &lt;strong&gt;n&lt;/strong&gt; = 5) and a longint takes up 4 bytes, the program takes 20 bytes of memory for &lt;strong&gt;n&lt;/strong&gt; = 5.  If &lt;strong&gt;n&lt;/strong&gt; = 100 it would take up 400 bytes.&lt;br /&gt;
&lt;br /&gt;
Once &lt;strong&gt;n&lt;/strong&gt; = 1 the program begins to retreat our of the recursive hole.  Each time it goes up a level it releases memory until it gets out of the hole.&lt;br /&gt;
&lt;br /&gt;
Every procedure or function that uses recursion should have some condition where is does not call itself, allowing it to retreat from the hole.&lt;br /&gt;
&lt;br /&gt;
There is a bug in the program &lt;strong&gt;nfact&lt;/strong&gt;.  I left it there on purpose.  If &lt;strong&gt;n&lt;/strong&gt; is zero or negative &lt;strong&gt;n&lt;/strong&gt; will never be equal to one.  &lt;strong&gt;fact&lt;/strong&gt; will be called repeatedly until memory is used up and the program crashes.&lt;br /&gt;
&lt;br /&gt;
Recursion also occurs when a procedure calls a procedure that called it, e.g., &lt;strong&gt;mainmenu&lt;/strong&gt; calls &lt;strong&gt;add&lt;/strong&gt; which in turn calls &lt;strong&gt;mainmenu&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
In theory, anything that can be done with recursion can be done with &lt;em&gt;iteration&lt;/em&gt;, i.e., &lt;em&gt;looping&lt;/em&gt;.  For instance:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
program nfact ;
{
   compute the factorial of a number -- looping version
}
var
   i,f,n : longint ;
begin
   write('Enter a number  ') ;
   readln(n) ;
   f := 0 ;
   for i := n downto 1 do
      f := f * i ;
   writeln(n:0, '! = ', f:0)
end.
&lt;/pre&gt;&lt;br /&gt;
You're probably thinking that the looping version is simpler than the recursive version, and you're right.  Some problems are simpler using loops, others are simpler using recursion.  The &lt;em&gt;quicksort&lt;/em&gt; algorithm is simpler using recursion, complex using looping.&lt;br /&gt;
&lt;br /&gt;
Now let's consider one of your procedures.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Procedure Add;

var
   Ans : char;
   choice:integer;
begin
   clrscr;

   Textcolor(Green);
   Textbackground(Black);
   {
      yatta ...
      yatta ...
      yatta ...
   }
   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;
&lt;/pre&gt;&lt;br /&gt;
After the user makes his "choice" the program either invokes one of the Add_MemberXXX procedures or else invokes another instance of &lt;strong&gt;Mainmenu&lt;/strong&gt;.  Is this what you want?  I think not.  I think what you want is to return to the previous instance of &lt;strong&gt;Mainmenu&lt;/strong&gt;, not create another one.&lt;br /&gt;
&lt;br /&gt;
There are two ways to return to the previous instance.  One is to simply reach the end of the procedure, the "END;" in this case.  The other way is to invoke the Pascal procedure &lt;strong&gt;exit&lt;/strong&gt;.  Thus:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Procedure Add;

var
   Ans : char;
   choice:integer;
begin
   clrscr;

   Textcolor(Green);
   Textbackground(Black);
   {
      yatta ...
      yatta ...
      yatta ...
   }
   Writeln('Press the respective number then press " Enter" to  continue');
   Readln(choice);

   case choice of
      1 : Add_MemberDDC;
      2 : Add_MemberDPI;
      3 : Add_MemberDSGO;
   end;
END;
&lt;/pre&gt;&lt;br /&gt;
or&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Procedure Add;

var
   Ans : char;
   choice:integer;
begin
   clrscr;

   Textcolor(Green);
   Textbackground(Black);
   {
      yatta ...
      yatta ...
      yatta ...
   }
   Writeln('Press the respective number then press " Enter" to  continue');
   Readln(choice);

   case choice of
      1 : Add_MemberDDC;
      2 : Add_MemberDPI;
      3 : Add_MemberDSGO;
      else
         exit ;
   end;
END;
&lt;/pre&gt;&lt;br /&gt;
 &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426911/re-helpproject-crisis/#426911</guid>
      <pubDate>Sat, 21 Jan 2012 22:35:11 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426927/re-helpproject-crisis/#426927</link>
      <description>: &lt;br /&gt;
: And the last thing is do you know codes to edit the info i added. &lt;br /&gt;
: cuz someone could put wrong information and have to change it . this &lt;br /&gt;
: would be deeply appreciated.&lt;br /&gt;
: &lt;br /&gt;
Here's a program I wrote that relates to your problem.  Unfortunately it's so big that I won't be able to properly discuss it without running out of the space allotted for a single post so I'll discuss it in a separate post.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
{  1}	program file_editor ; uses crt ;
{  2}	{
{  3}	   simple file editor  -- records student id, name, sex, age, class and grade point average
{  4}	}
{  5}	CONST
{  6}	   NUL      = chr(0) ;
{  7}	   BLANK    = ' ' ;
{  8}	   ID_LEN   = 9 ;
{  9}	   NAME_LEN = 20 ;
{ 10}	
{ 11}	   FILENAME = 'student.dat' ;
{ 12}	   SCRATCH  = 'scratch' ;
{ 13}	
{ 14}	type
{ 15}	   studenttype = record
{ 16}	      id         : string[ID_LEN] ;
{ 17}	      lastname   : string[NAME_LEN] ;
{ 18}	      firstname  : string[NAME_LEN] ;
{ 19}	      mid_init   : char ;
{ 20}	      sex        : char ;
{ 21}	      age        : byte ;
{ 22}	      class      : 0 .. 12 ;
{ 23}	      gpa        : real
{ 24}	   end ;
{ 25}	
{ 26}	   file_of_studenttype = file of studenttype ;
{ 27}	
{ 28}	   procedure brag ;
{ 29}	   {
{ 30}	      introduction
{ 31}	   }
{ 32}	   CONST
{ 33}	      BRAGTEXT = 'A computer program by J. Delano Actor!' ;
{ 34}	      MIDLINE  = 12 ;
{ 35}	
{ 36}	   begin { brag }
{ 37}	      clrscr ;
{ 38}	      gotoxy((80 - length(BRAGTEXT)) div 2, MIDLINE) ;
{ 39}	      write(BRAGTEXT) ;    { centered }
{ 40}	      readkey
{ 41}	   end ; { brag }
{ 42}	
{ 43}	   procedure app ;
{ 44}	   {
{ 45}	      appends a new record to the file
{ 46}	   }
{ 47}	   CONST      
{ 48}	      ID_ROW    = 3 ; 
{ 49}	      LNAME_ROW = ID_ROW + 2 ;
{ 50}	      FNAME_ROW = ID_ROW + 4 ;
{ 51}	      MI_ROW    = ID_ROW + 6 ;
{ 52}	      SEX_ROW   = ID_ROW + 8 ;
{ 53}	      AGE_ROW   = ID_ROW + 10 ;
{ 54}	      CLASS_ROW = ID_ROW + 12 ;
{ 55}	      GPA_ROW   = ID_ROW + 14 ;
{ 56}	      SPACES    = '                                                ' ;  
{ 57}	      
{ 58}	      procedure app_menu ;
{ 59}	      {
{ 60}	         writes append menu to screen
{ 61}	      }
{ 62}	      begin { app_menu }
{ 63}	         clrscr ;
{ 64}	         writeln ;
{ 65}	         writeln ;
{ 66}	         writeln('1. IDENTIFICATION      :':30) ;
{ 67}	         writeln ;
{ 68}	         writeln('2. LAST NAME           :':30) ;
{ 69}	         writeln ;
{ 70}	         writeln('3. FIRST NAME          :':30) ;
{ 71}	         writeln ;
{ 72}	         writeln('4. MIDDLE INITIAL      :':30) ;
{ 73}	         writeln ;
{ 74}	         writeln('5. GENDER              :':30) ;
{ 75}	         writeln ;
{ 76}	         writeln('6. AGE                 :':30) ;
{ 77}	         writeln ;
{ 78}	         writeln('7. CLASS               :':30) ;
{ 79}	         writeln ;
{ 80}	         writeln('8. GRADE POINT AVERAGE :':30) ;
{ 81}	         writeln ;
{ 82}	         writeln ;
{ 83}	         writeln('A. APPEND TO FILE AND QUIT APPEND MODE':44) ;
{ 84}	         writeln ;
{ 85}	         writeln('Q. QUIT APPEND MODE WITHOUT SAVING DATA':45)
{ 86}	      end ; { app_menu }
{ 87}	
{ 88}	      procedure clear (var student : studenttype) ;
{ 89}	      {
{ 90}	         clear student record
{ 91}	      }
{ 92}	      begin { clear }
{ 93}	         with student do begin
{ 94}	            id         := '' ;
{ 95}	            lastname   := '' ;
{ 96}	            firstname  := '' ;
{ 97}	            mid_init   := NUL ;
{ 98}	            sex        := NUL ;
{ 99}	            age        := 0 ;
{100}	            class      := 0 ;
{101}	            gpa        := 0.0
{102}	         end
{103}	      end ; { clear }
{104}	
{105}	      procedure show (const student : studenttype) ;
{106}	      {
{107}	         show record on screen
{108}	      }
{109}	      begin { show }
{110}	            with student do begin
{111}	               gotoxy(32, ID_ROW) ;    write(id) ;
{112}	               gotoxy(32, LNAME_ROW) ; write(lastname) ;   
{113}	               gotoxy(32, FNAME_ROW) ; write(firstname) ;  
{114}	               gotoxy(32, MI_ROW) ;    write(mid_init) ;   
{115}	               gotoxy(32, SEX_ROW) ;   write(sex) ;        
{116}	               gotoxy(32, AGE_ROW) ;   write(age) ;
{117}	               gotoxy(32, CLASS_ROW) ; write(class) ;
{118}	               gotoxy(32, GPA_ROW) ;   write(gpa:0:3) ; { avoid E formatting }
{119}	
{120}	               gotoxy(79, 24)    { move cursor out of the way }
{121}	            end
{122}	      end ; { show }
{123}	
{124}	      function getstr (row : byte) : string ;
{125}	      {
{126}	         get a string from a defined place on the screen
{127}	      }
{128}	      var
{129}	         str : string ;
{130}	      begin { getstr }
{131}	         gotoxy(32,row) ;
{132}	         write(SPACES) ;   { erase previous contents from screen }
{133}	         gotoxy(32,row) ;
{134}	         readln(str) ;
{135}	         getstr := str
{136}	      end ; { getstr }
{137}	
{138}	      function getch (row : byte) : char ;
{139}	      {
{140}	         get a character from a defined place on the screen
{141}	      }
{142}	      var
{143}	         str : string ;
{144}	      begin { getch }
{145}	         str := getstr(row) ;
{146}	         if length(str) &amp;gt; 0 then
{147}	            getch := str[1]
{148}	         else
{149}	            getch := NUL
{150}	      end ; { getch }
{151}	
{152}	      function getint (row : byte) : integer ;
{153}	      {
{154}	         get an integer from a defined place on the screen
{155}	      }
{156}	      var
{157}	         i : integer ;
{158}	      begin { getint }
{159}	         {$I-}
{160}	            gotoxy(32,row) ;
{161}	            write(SPACES) ;   { erase previous contents from screen }
{162}	            gotoxy(32,row) ;
{163}	            readln(i) ;
{164}	            if ioresult = 0 then
{165}	               getint := i
{166}	            else
{167}	               getint := 0
{168}	         {$I+}
{169}	      end ; { getint }
{170}	
{171}	      function getreal (row : byte) : real ;
{172}	      {
{173}	         get a real number from a defined place on the screen
{174}	      }
{175}	      var
{176}	         x : real ;
{177}	      begin { getreal }
{178}	         {$I-}
{179}	            gotoxy(32,row) ;
{180}	            write(SPACES) ;   { erase previous contents from screen }
{181}	            gotoxy(32,row) ;
{182}	            readln(x) ;
{183}	            if ioresult = 0 then
{184}	               getreal := x
{185}	            else
{186}	               getreal := 0.0
{187}	         {$I+}
{188}	      end ; { getreal }
{189}	
{190}	      procedure save (student : studenttype) ;
{191}	      {
{192}	         append a record to the file
{193}	      }
{194}	         procedure open (var f : file_of_studenttype) ;
{195}	         {
{196}	            open a typed file for appending
{197}	         }
{198}	         begin { open }
{199}	            {$I-}
{200}	               reset(f) ;
{201}	               if ioresult &amp;gt; 0 then begin
{202}	                  rewrite(f) ;
{203}	                  if ioresult &amp;gt; 0 then begin
{204}	                     write('Cannot open file ', FILENAME) ;
{205}	                     halt  { give up and quit program }
{206}	                  end
{207}	               end
{208}	            {$I+}
{209}	         end ; { open }
{210}	
{211}	      var
{212}	         f : file_of_studenttype ;
{213}	         n : longint ;
{214}	      begin { save }
{215}	         assign(f, FILENAME) ;
{216}	         open(f) ;
{217}	            n := filesize(f) ;
{218}	            seek(f,n) ;
{219}	            write(f, student) ;
{220}	         close(f)
{221}	      end ; { save }
{222}	       
{223}	   var
{224}	      student : studenttype ;
{225}	      key     : char ; 
{226}	   begin { app }
{227}	      clear(student) ;
{228}	      repeat
{229}	         app_menu ;
{230}	         show(student) ;
{231}	
{232}	         repeat
{233}	            key := upcase(readkey)
{234}	         until key in ['1' .. '8', 'A', 'Q'] ;
{235}	
{236}	         with student do begin
{237}	            case key of
{238}	               '1' : id         := getstr(ID_ROW) ;
{239}	               '2' : lastname   := getstr(LNAME_ROW) ;
{240}	               '3' : firstname  := getstr(FNAME_ROW) ;
{241}	               '4' : mid_init   := getch(MI_ROW) ;
{242}	               '5' : sex        := getch(SEX_ROW) ;
{243}	               '6' : age        := getint(AGE_ROW) ;
{244}	               '7' : class      := getint(CLASS_ROW) ;
{245}	               '8' : gpa        := getreal(GPA_ROW) ;
{246}	               'A' : begin
{247}	                        save(student) ;
{248}	                        key := 'Q'
{249}	                     end
{250}	            end { case }
{251}	         end
{252}	      until key = 'Q'
{253}	   end ; { app }
{254}	
{255}	   procedure view ;
{256}	   {
{257}	      view the database
{258}	   }
{259}	      procedure heading ;
{260}	      {
{261}	         header for the 'view' screen
{262}	      }
{263}	      begin { heading }
{264}	         write('Rec #') ;
{265}	         write('ID #':ID_LEN + 1) ;
{266}	         write('LAST NAME':NAME_LEN + 1) ;
{267}	         write('FIRST NAME':NAME_LEN + 1) ;
{268}	         write('MI':3) ;
{269}	         write('SEX':4) ;
{270}	         write('AGE':4) ;
{271}	         write('CLS':4) ;
{272}	         write('GPA':7) ;
{273}	         writeln ;
{274}	
{275}	         write('-----') ;                    { record number }
{276}	         write(' ---------') ;               { id }
{277}	         write(' --------------------') ;    { last name }
{278}	         write(' --------------------') ;    { first name }
{279}	         write(' --') ;                      { middle initial }
{280}	         write('   -') ;                     { sex }
{281}	         write('  --') ;                     { age }
{282}	         write('  --') ;                     { class }
{283}	         write('  -----') ;                 { grade point average }
{284}	         writeln
{285}	      end ; { heading }
{286}	
{287}	      procedure open (var f : file_of_studenttype) ;
{288}	      {
{289}	         open file for reading -- one way or another
{290}	      }
{291}	      begin { open }
{292}	         {$I-}
{293}	            reset(f) ;
{294}	            if ioresult &amp;gt; 0 then begin
{295}	               assign(f, 'NUL') ;   { the bit bucket -- always empty }
{296}	               reset(f)
{297}	            end
{298}	         {$I+}
{299}	      end ; { open }
{300}	   var
{301}	      student  : studenttype ;
{302}	      f        : file_of_studenttype ;
{303}	      i,n      : longint ;
{304}	
{305}	   begin { view }
{306}	      clrscr ;
{307}	      heading ;
{308}	      assign(f, FILENAME) ;
{309}	      open(f) ;
{310}	         n := filesize(f) - 1 ;  { index of last record }
{311}	         for i := 0 to n do begin
{312}	            seek(f, i) ;
{313}	            read(f, student) ;
{314}	            with student do begin
{315}	               write(i:5) ;
{316}	               write(id:ID_LEN + 1) ;
{317}	               write(lastname:NAME_LEN + 1) ;
{318}	               write(firstname:NAME_LEN + 1) ;
{319}	               write(mid_init:3) ;
{320}	               write(sex:4) ;
{321}	               write(age:4) ;
{322}	               write(class:4) ;
{323}	               write(gpa:7:3) ;
{324}	               writeln
{325}	            end
{326}	         end ;
{327}	      close(f) ;
{328}	      writeln ;
{329}	      writeln ;
{330}	      writeln ;
{331}	      writeln('Hit any key to continue') ;
{332}	      readkey
{333}	   end ; { view }
{334}	
{335}	   procedure menu ;
{336}	   {
{337}	      shows the top level menu
{338}	   }
{339}	   begin { menu }
{340}	      clrscr ;
{341}	      writeln ;
{342}	      writeln ;
{343}	      writeln ;
{344}	      writeln ;
{345}	      writeln ;
{346}	      writeln ;
{347}	      writeln ;
{348}	      writeln ;
{349}	      writeln(BLANK:25, 'A. Append new record to file') ;
{350}	      writeln ;
{351}	      writeln(BLANK:25, 'V. View the file') ;
{352}	      writeln ;
{353}	      writeln(BLANK:25, 'Q. Quit program')
{354}	   end ; { menu }
{355}	
{356}	var
{357}	   key : char ;
{358}	
{359}	begin { file_editor }
{360}	   brag ;
{361}	   repeat
{362}	      menu ;
{363}	      repeat
{364}	         key := upcase(readkey)
{365}	      until key in ['A', 'V', 'Q'] ;
{366}	      case key of
{367}	         'A' : app ;
{368}	         'V' : view ;
{369}	      end { case }
{370}	   until key = 'Q' ;
{371}	   clrscr
{372}	end.  { file_editor }
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426927/re-helpproject-crisis/#426927</guid>
      <pubDate>Sun, 22 Jan 2012 20:35:36 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426931/re-helpproject-crisis/#426931</link>
      <description>The program I posted above is a simple file editor similar to the one you're writing.  A file editor should be able to do at least three things.&lt;br /&gt;
&lt;br /&gt;
*      Append (i.e., add) records to the file&lt;br /&gt;
*      Delete records from the file&lt;br /&gt;
*      Edit (i.e., change) records in the file&lt;br /&gt;
&lt;br /&gt;
The program I posted above only appends, which may not seem to helpful, but bear with me.  Even though it only appends, it allows you to see your data and correct it before committing yourself to adding it to your file.&lt;br /&gt;
&lt;br /&gt;
Let's begin by examining the main body of the program, lines 359 .. 372.  After displaying the &lt;strong&gt;brag&lt;/strong&gt; screen the program goes into a repeat .. until loop which terminates when &lt;strong&gt;key = 'Q'&lt;/strong&gt;, i.e., the operator hits the 'Q' key at an appropriate time.&lt;br /&gt;
&lt;br /&gt;
This looping behavior makes the program "event driven" like most Windows applications.  The program responds to events (keystrokes).  The main routine only responds to 'A', 'V' and 'Q'.  Anything else is ignored.  Lines 363 .. 365.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;brag&lt;/strong&gt; and &lt;strong&gt;menu&lt;/strong&gt; are set apart in their own procedures rather than included in the main procedure.  This is done mainly to keep the main routing uncluttered.  At only 14 lines it is clean and easy to read and understand.&lt;br /&gt;
&lt;br /&gt;
Hitting 'V' invokes &lt;strong&gt;view&lt;/strong&gt;, lines 255 .. 333, which displays the database.  I kept &lt;strong&gt;view&lt;/strong&gt; simple because a record can be displayed on only one line and I don't foresee my test file getting big enough to require scrolling.  However, there is one part of &lt;strong&gt;view&lt;/strong&gt; that I want to point out, the procedure &lt;strong&gt;open&lt;/strong&gt;.  I wrote &lt;strong&gt;open&lt;/strong&gt; to keep the code for &lt;strong&gt;view&lt;/strong&gt; uncluttered.  All the stuff about turning error detection off/on and testing &lt;strong&gt;ioresult&lt;/strong&gt; is shuffled off to a corner where we deal with it separately.&lt;br /&gt;
&lt;br /&gt;
Note that &lt;strong&gt;open&lt;/strong&gt; is nested inside &lt;strong&gt;view&lt;/strong&gt;.  Other procedures cannot see it.  I'll explain why that's important shortly.&lt;br /&gt;
&lt;br /&gt;
Meanwhile, if &lt;strong&gt;reset&lt;/strong&gt; fails, &lt;strong&gt;open&lt;/strong&gt; reassigns the file to 'NUL', the DOS/Windows bit bucket.  'NUL' is always empty.  &lt;strong&gt;eof&lt;/strong&gt; is always TRUE for 'NUL'.  &lt;strong&gt;view&lt;/strong&gt; will display an empty screen, hopefully gently reminding the operator that he has not entered any data yet, or that something is wrong.&lt;br /&gt;
&lt;br /&gt;
On to &lt;strong&gt;app&lt;/strong&gt;, the procedure you are really interested in (I hope).  I named it &lt;strong&gt;app&lt;/strong&gt; instead of &lt;strong&gt;append&lt;/strong&gt; to avoid a collision with the Pascal procedure &lt;strong&gt;append&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
Note that &lt;strong&gt;app&lt;/strong&gt; has it's own &lt;strong&gt;open&lt;/strong&gt; procedure nested within it.  &lt;strong&gt;view&lt;/strong&gt; cannot see &lt;strong&gt;app&lt;/strong&gt;'s &lt;strong&gt;open&lt;/strong&gt; procedure, and vice versa, so each uses the correct procedure.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;By the way, some people may object to different procedures having the same name in the same program, even though nesting makes it clear which one is called.  They argue that it makes the code harder to read, and would name one &lt;strong&gt;open_read&lt;/strong&gt; and the other &lt;strong&gt;open_write&lt;/strong&gt; or some such.  I respectfully disagree.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;app&lt;/strong&gt;'s &lt;strong&gt;open&lt;/strong&gt; procedure tries to &lt;strong&gt;reset&lt;/strong&gt; the file, if that fails it tries &lt;strong&gt;rewrite&lt;/strong&gt;, then if that fails it gives up, writes and error message and terminates the program.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;app&lt;/strong&gt; is event driven, just like the main body.  Hopefully you can see how it allows you to access each field of the record and enter data.  If it's wrong you can redo it.  When you finally think you have it right you hit 'A' and it gets appended to the file.&lt;br /&gt;
&lt;br /&gt;
Note that the procedures &lt;strong&gt;getint&lt;/strong&gt; and &lt;strong&gt;getreal&lt;/strong&gt; turn off error checking and use &lt;strong&gt;ioresult&lt;/strong&gt; to test for success.  That's because &lt;strong&gt;readln&lt;/strong&gt; will return an "invalid numeric format" if the data you enter cannot be converted to a number, e.g., "3..14159" has too many decimal points and "one" is not recognized as an integer.  In that event &lt;strong&gt;getint&lt;/strong&gt; returns 0 and &lt;strong&gt;getreal&lt;/strong&gt; returns 0.0  Hopefully the operator will recognize that something is wrong.&lt;br /&gt;
&lt;br /&gt;
One last thing: the program has the operator hit 'A' to append.  Some programmers suggest that '^' or '&amp;amp;' should be used.  The reason has to do with human engineering.  Both '^' and '&amp;amp;' require that the shift key be held down, requiring two hands or an awkward one-hand operation.  Either way it's less likely that the operator would do it accidentally and cause the data to be saved before he's finished.&lt;br /&gt;
&lt;br /&gt;
Hope this helps.  Give me a day or so and I'll work on &lt;strong&gt;del&lt;/strong&gt; (don't want to collide with &lt;strong&gt;delete&lt;/strong&gt;) and &lt;strong&gt;change&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
Good luck.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426931/re-helpproject-crisis/#426931</guid>
      <pubDate>Sun, 22 Jan 2012 22:31:23 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426972/re-helpproject-crisis/#426972</link>
      <description>Here is the code for the &lt;strong&gt;del&lt;/strong&gt; procedure.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   procedure del ;
   {
      deletes a record from the file
   }
      procedure open (var f : file_of_studenttype) ;
      {
         opens file for possible deletion of records
      }
      begin { open }
         {$I-}
            reset(f) ;
            if ioresult &amp;gt; 0 then begin
               assign(f, 'NUL') ;   { the bit bucket }
               reset(f)
            end
         {$I+}
      end ; { open }

      procedure delete_rec (var f : file_of_studenttype ; n : longint) ;
      {
         delete designated record
      }
         procedure open (var g : file_of_studenttype ; var success : boolean) ;
         {
            open a scratch file
         }
         begin { open }
            {$I-}
               rewrite(g) ;
               success := (ioresult = 0)
            {$I+}
         end ; { open }
      var
         student  : studenttype ;
         g        : file_of_studenttype ;
         i        : longint ;
         success  : boolean ;
      begin { delete_rec }
         assign(g, SCRATCH) ;
         open(g, success) ;
            if success then begin
               for i := 0 to filesize(f) - 1 do begin
                  seek(f,i) ;
                  read(f,student) ;
                  if i &amp;lt;&amp;gt; n then
                     write(g, student)
               end
            end
            else begin
               writeln(BLANK:15, 'unable to create scratch file ') ;
               readln ;
            end ;
         {$I-}
            close(g) ;
         
            erase(f) ;
            rename(g, FILENAME)
         {$I+}
      end ; { delete_rec }

   var
      n        : longint ;
      f        : file_of_studenttype ;
      student  : studenttype ;
      ch       : char ;
   begin { del }
      clrscr ;
      gotoxy(1,12) ;

      write(BLANK:15, 'Enter the number of the record you wish to delete ') ;
      {$I-}
         readln(n) ;
         if ioresult &amp;gt; 0 then
            n := -1 ;
      {$I+}
      assign(f, FILENAME) ;
      open(f) ;
         if (n &amp;gt;= 0) and (n &amp;lt; filesize(f)) then begin
            seek(f,n) ;
            read(f, student) ;
            writeln ;
            writeln ;
            write(BLANK:15, 'Are you sure you want to delete record# ', n:0, '?') ;
            repeat
               ch := upcase(readkey)
            until ch in ['N', 'Y'] ;
            if ch = 'Y' then
               delete_rec(f,n) ;
         end
         else begin
            write(BLANK:15, 'record # ', n:0, ' does not exist') ;
            readln
         end ;
      close(f)
   end ; { del }
&lt;/pre&gt;&lt;br /&gt;
The procedure asks for the number of the record to be deleted, retrieves that record from the file, displays it and then asks for confirmation that you want it deleted.&lt;br /&gt;
&lt;br /&gt;
The &lt;strong&gt;open&lt;/strong&gt; procedure for &lt;strong&gt;del&lt;/strong&gt; attempts to reset the file and opens the bit bucket if it fails.  If the record you specify is out of range it tells you so.&lt;br /&gt;
&lt;br /&gt;
A record is deleted by copying the file to a scratch file, skipping the record to be deleted.  Afterward the file is erased and the scratch file renamed.&lt;br /&gt;
&lt;br /&gt;
The procedure is crude in that it asks the operator for a record number, requiring the operator to find the record via &lt;strong&gt;view&lt;/strong&gt; and either remembering it or writing it down.  A good enhancement would be to be able to search the file for the required record, for example, by searching for an &lt;strong&gt;id&lt;/strong&gt; number.  For this to work &lt;strong&gt;app&lt;/strong&gt; would need to be modified to prevent duplicate records with the same &lt;strong&gt;id&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
Next post will be the code for the &lt;strong&gt;edit&lt;/strong&gt; procedure.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426972/re-helpproject-crisis/#426972</guid>
      <pubDate>Tue, 24 Jan 2012 19:58:59 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/426973/re-helpproject-crisis/#426973</link>
      <description>Here is the code for the &lt;strong&gt;del&lt;/strong&gt; procedure.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   procedure del ;
   {
      deletes a record from the file
   }
      procedure open (var f : file_of_studenttype) ;
      {
         opens file for possible deletion of records
      }
      begin { open }
         {$I-}
            reset(f) ;
            if ioresult &amp;gt; 0 then begin
               assign(f, 'NUL') ;   { the bit bucket }
               reset(f)
            end
         {$I+}
      end ; { open }

      procedure delete_rec (var f : file_of_studenttype ; n : longint) ;
      {
         delete designated record
      }
         procedure open (var g : file_of_studenttype ; var success : boolean) ;
         {
            open a scratch file
         }
         begin { open }
            {$I-}
               rewrite(g) ;
               success := (ioresult = 0)
            {$I+}
         end ; { open }
      var
         student  : studenttype ;
         g        : file_of_studenttype ;
         i        : longint ;
         success  : boolean ;
      begin { delete_rec }
         assign(g, SCRATCH) ;
         open(g, success) ;
            if success then begin
               for i := 0 to filesize(f) - 1 do begin
                  seek(f,i) ;
                  read(f,student) ;
                  if i &amp;lt;&amp;gt; n then
                     write(g, student)
               end
            end
            else begin
               writeln(BLANK:15, 'unable to create scratch file ') ;
               readln ;
            end ;
         {$I-}
            close(g) ;
         
            erase(f) ;
            rename(g, FILENAME)
         {$I+}
      end ; { delete_rec }

   var
      n        : longint ;
      f        : file_of_studenttype ;
      student  : studenttype ;
      ch       : char ;
   begin { del }
      clrscr ;
      gotoxy(1,12) ;

      write(BLANK:15, 'Enter the number of the record you wish to delete ') ;
      {$I-}
         readln(n) ;
         if ioresult &amp;gt; 0 then
            n := -1 ;
      {$I+}
      assign(f, FILENAME) ;
      open(f) ;
         if (n &amp;gt;= 0) and (n &amp;lt; filesize(f)) then begin
            seek(f,n) ;
            read(f, student) ;
            writeln ;
            writeln ;
            write(BLANK:15, 'Are you sure you want to delete record# ', n:0, '?') ;
            repeat
               ch := upcase(readkey)
            until ch in ['N', 'Y'] ;
            if ch = 'Y' then
               delete_rec(f,n) ;
         end
         else begin
            write(BLANK:15, 'record # ', n:0, ' does not exist') ;
            readln
         end ;
      close(f)
   end ; { del }
&lt;/pre&gt;&lt;br /&gt;
The procedure asks for the number of the record to be deleted, retrieves that record from the file, displays it and then asks for confirmation that you want it deleted.&lt;br /&gt;
&lt;br /&gt;
The &lt;strong&gt;open&lt;/strong&gt; procedure for &lt;strong&gt;del&lt;/strong&gt; attempts to reset the file and opens the bit bucket if it fails.  If the record you specify is out of range it tells you so.&lt;br /&gt;
&lt;br /&gt;
A record is deleted by copying the file to a scratch file, skipping the record to be deleted.  Afterward the file is erased and the scratch file renamed.&lt;br /&gt;
&lt;br /&gt;
The procedure is crude in that it asks the operator for a record number, requiring the operator to find the record via &lt;strong&gt;view&lt;/strong&gt; and either remembering it or writing it down.  A good enhancement would be to be able to search the file for the required record, for example, by searching for an &lt;strong&gt;id&lt;/strong&gt; number.  For this to work &lt;strong&gt;app&lt;/strong&gt; would need to be modified to prevent duplicate records with the same &lt;strong&gt;id&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
Next post will be the code for the &lt;strong&gt;edit&lt;/strong&gt; procedure.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/426973/re-helpproject-crisis/#426973</guid>
      <pubDate>Tue, 24 Jan 2012 20:01:33 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427044/re-helpproject-crisis/#427044</link>
      <description>Hey i tried the del procedure and i failed. the file_studenttype thing is messing me up. so i was wondering if you could just put it in my program just like how u did the scroll thing.&lt;br /&gt;
&lt;br /&gt;
A problem was found when i viewed the members in the groups other than DDC..like when i am viewing members in dpi and DSGO databases they give me people who are in the ddc database. i overlooked my codes but there seemed to be no error. so i was also wondering if you could check that out for me too.&lt;br /&gt;
&lt;br /&gt;
Um, is it possible to add variables or have a variable that adds it's content..like for the ticket_payment..it would be irrelevant to have a writeln for this as someone could add varying amounts of prices and the writeln part might not match it when they go to view it in the Grand totals procedure..so if you can help out in this part then i would appreciate it alot.&lt;br /&gt;
&lt;br /&gt;
I tried alot to fix the viewing problem.&lt;br /&gt;
&lt;br /&gt;
im going to send my updated program and you can add a person in add_memberddc then you can do the same for the other add procedures in the ADD procedure, then go to view on the main menu&lt;br /&gt;
click "2" to view dpi members if you see members from ddc then that's the problem...so this is a major setback to making my program unique..so please help me.&lt;br /&gt;
&lt;br /&gt;
the edit procedure would be great to but fixing the viewing problem + the adding of the tickets are more important..&lt;br /&gt;
so please help me&lt;br /&gt;
&lt;br /&gt;
thanks......&lt;br /&gt;
&lt;br /&gt;
HERE'S THE UPDATED ONE..PLEASE DON'T THINK OF ME AS A LAZY PERSON..BUT AS YOU ARE AN EXPERT IN TURBO PASCAL I JUST GOT HOOKED ON YOUR ADVISE&lt;br /&gt;
&lt;br /&gt;
AND AGAIN THANKS...A MILLION &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Program schoolSBA;&lt;br /&gt;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}&lt;br /&gt;
&lt;br /&gt;
uses crt, dos,graph;&lt;br /&gt;
&lt;br /&gt;
Type&lt;br /&gt;
MemberDatabaseDDC = record {declaration of record}&lt;br /&gt;
&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
   Member_TicketPayment:integer;&lt;br /&gt;
    Advert:string;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
 MemberDatabaseDPI=record&lt;br /&gt;
 Member_IDdpi : string[10];&lt;br /&gt;
  Member_Namedpi:String[30];&lt;br /&gt;
    Member_TicketPaymentdpi:integer;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
MemberDatabaseDSGO = record&lt;br /&gt;
 Member_IDdsgo : string[10];&lt;br /&gt;
  Member_Namedsgo:String[30];&lt;br /&gt;
    Member_TicketPaymentdsgo:integer;&lt;br /&gt;
      end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
 DDCDatabasefile : file of MemberDatabaseDDC;&lt;br /&gt;
  DatabaseRecDDC: MemberDatabaseDDC; {variable for DDC record}&lt;br /&gt;
&lt;br /&gt;
  DPIDatabasefile: file of MemberDatabaseDPI;&lt;br /&gt;
  DatabaseRecDPI: MemberDatabaseDPI;{variable for DPI record}&lt;br /&gt;
&lt;br /&gt;
  DSGODatabasefile : file of MemberDatabaseDSGO;&lt;br /&gt;
  DatabaseRecDSGO :MemberDatabaseDSGO; {variable for DSGO record}&lt;br /&gt;
&lt;br /&gt;
   Choice, count,i: integer;&lt;br /&gt;
&lt;br /&gt;
    Databasename : String;&lt;br /&gt;
   Var Gd, Gm,&lt;br /&gt;
    Radius, Grow, IncP, IncQ : Integer;&lt;br /&gt;
    DecrP, DecrQ : Boolean;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu; Forward;&lt;br /&gt;
&lt;br /&gt;
{*************************************************&lt;br /&gt;
*This Procedure is used to display the Main Menu *&lt;br /&gt;
*of the program.                                 *&lt;br /&gt;
**************************************************
}&lt;br /&gt;
&lt;br /&gt;
     Procedure Viewmenu;&lt;br /&gt;
    {Procedure to display intro}&lt;br /&gt;
   Begin&lt;br /&gt;
 clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  TextColor(white);&lt;br /&gt;
  Textbackground(Black);&lt;br /&gt;
  Clrscr;&lt;br /&gt;
GotoXY (1,4);&lt;br /&gt;
 WriteLn(    'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
     WriteLn('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼ º');&lt;br /&gt;
     WriteLn('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
     GoToXY(23,23);&lt;br /&gt;
&lt;br /&gt;
     GotoXY (16,6);&lt;br /&gt;
      Writeln('* Welcome to the Member database program.*');&lt;br /&gt;
        TextColor(Green);&lt;br /&gt;
          GotoXY(17,8);&lt;br /&gt;
          Writeln('This program was written by Michael L. Jarvis');&lt;br /&gt;
         GotoXY (17,10);&lt;br /&gt;
        writeln('a student of the Saint Mary`s Academy.');&lt;br /&gt;
      GotoXY(17,12);&lt;br /&gt;
    Writeln('Press "ENTER" to access the main menu.');&lt;br /&gt;
  readln;&lt;br /&gt;
 end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Function File_exist:integer;&lt;br /&gt;
    Begin&lt;br /&gt;
      clrscr;&lt;br /&gt;
        Assign(DDCdatabasefile,'Memberdatabase.dat');&lt;br /&gt;
          {$I-}&lt;br /&gt;
            Reset (DDCDatabasefile);&lt;br /&gt;
           {$I+}&lt;br /&gt;
        If IOResult&amp;lt;&amp;gt;0 then&lt;br /&gt;
          Rewrite(DDCDatabasefile);&lt;br /&gt;
        {$I+}&lt;br /&gt;
      File_Exist := IOResult;&lt;br /&gt;
Close(DDCDatabasefile);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 {*************************************************
**************************}&lt;br /&gt;
 function nextrec(curr, n : longint) : longint ;&lt;br /&gt;
{This function pertains to the view procedures for DDC, DPI and DSGO}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	   CONST&lt;br /&gt;
	      NUL      = chr(0) ;&lt;br /&gt;
	      UP       = chr(72) ;    { UP arrow }&lt;br /&gt;
	      DOWN     = chr(80) ;    { DOWN arrow }&lt;br /&gt;
	      PGUP     = chr(73) ;&lt;br /&gt;
	      PGDN     = chr(81) ;&lt;br /&gt;
	      QUIT     = chr(79) ;    { "END" key }&lt;br /&gt;
	      KEYSET   = [UP, DOWN, PGUP, PGDN, QUIT] ;&lt;br /&gt;
        PGVAL    = 10 ;&lt;br /&gt;
&lt;br /&gt;
	   var&lt;br /&gt;
	      key   : char ;&lt;br /&gt;
&lt;br /&gt;
	   begin&lt;br /&gt;
	      while TRUE do begin  { infinite loop }&lt;br /&gt;
	         key := readkey ;&lt;br /&gt;
	         if key = NUL then begin&lt;br /&gt;
             key := readkey ;&lt;br /&gt;
	            case key of&lt;br /&gt;
	               UP    :  begin&lt;br /&gt;
	                           if curr &amp;lt; n then&lt;br /&gt;
	                              curr := curr + 1 ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               DOWN  :  begin&lt;br /&gt;
	                           if curr &amp;gt; -1 then&lt;br /&gt;
	                              curr := curr - 1 ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               PGUP  :  begin&lt;br /&gt;
	                           if curr + PGVAL &amp;lt;= n then&lt;br /&gt;
	                              curr := curr + PGVAL ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               PGDN  :  begin&lt;br /&gt;
	                           if curr - PGVAL &amp;gt;= -1 then&lt;br /&gt;
	                              curr := curr - PGVAL ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               QUIT  :  begin&lt;br /&gt;
	                           nextrec := -100 ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end&lt;br /&gt;
	            end { case }&lt;br /&gt;
	         end&lt;br /&gt;
	      end&lt;br /&gt;
	   end ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
procedure advert;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure Provides a list of the bands which will be performing   *&lt;br /&gt;
*at the 16th annual World Creole Music Festival.                        *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   var&lt;br /&gt;
   ans:integer;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Begin&lt;br /&gt;
 Gd := Detect;&lt;br /&gt;
 InitGraph(Gd, Gm, 'c:\tp\bgi');&lt;br /&gt;
&lt;br /&gt;
 if GraphResult &amp;lt;&amp;gt; grOk then&lt;br /&gt;
  Halt(1);&lt;br /&gt;
 Randomize;&lt;br /&gt;
 SetColor(White);&lt;br /&gt;
&lt;br /&gt;
OutTextXY(20,20,'On October 29th we have bands like Krosfyah, Beenie Man, Maxi Priest,');&lt;br /&gt;
 OutTextXY(20,30,'Third World, Kassav, and Midnight Groovers!');&lt;br /&gt;
   OutTextXY(25,60,'On October 30th Come see bands like Carimi, Beris Hammond,UB40');&lt;br /&gt;
     OutTextXY(25,70,'Red Hot Flames, Grammacks and WCK.');&lt;br /&gt;
        OutTextXY(30,85,'On October 31st Come see Tabou Combo, Swinging Starz, Triple K');&lt;br /&gt;
         OutTextXY(30,95,'Nasio Fontaine, Sean Paul and Jah Cure.');&lt;br /&gt;
        OutTextXY(40,210,'Press "Enter" to continue.');&lt;br /&gt;
       Readln;&lt;br /&gt;
     CloseGraph;&lt;br /&gt;
   Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************}&lt;br /&gt;
Procedure Add_MemberDDC;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************&lt;br /&gt;
*This Procedure is used to add members into the DDA database*&lt;br /&gt;
**************************************************
*******************}&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Assign(DDCDatabasefile,'MemberDatabase.datDDC');&lt;br /&gt;
       {$I-}&lt;br /&gt;
        Reset(DDCDatabasefile);&lt;br /&gt;
         {$I+}&lt;br /&gt;
          If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
           Rewrite(DDCDatabasefile);&lt;br /&gt;
          {$I+}&lt;br /&gt;
        Repeat&lt;br /&gt;
     Textcolor(Black);&lt;br /&gt;
   Textbackground(White);&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DDC database.                   ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
 Writeln('Enter the Member ID.');&lt;br /&gt;
  readln(DatabaseRecDDC.Member_ID);&lt;br /&gt;
   Writeln;&lt;br /&gt;
    writeln('Enter the Member full name.');&lt;br /&gt;
      Readln(DatabaseRecDDC.Member_Name);&lt;br /&gt;
       Writeln;&lt;br /&gt;
         Writeln('Enter the Member Ticket Price');&lt;br /&gt;
          Readln(DatabaseRecDDC.Member_TicketPayment);&lt;br /&gt;
           Writeln;&lt;br /&gt;
          {I-}&lt;br /&gt;
          Until IOResult = 0;&lt;br /&gt;
        seek(DDCDatabasefile,filesize(DDCDatabasefile));&lt;br /&gt;
      Write(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
   Write('Now there are ',FileSize(DDCdatabasefile),' records in the DDC Database ');&lt;br /&gt;
  ReadLn;&lt;br /&gt;
Close(DDCDatabasefile);&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 {*************************************************
********************}&lt;br /&gt;
Procedure Add_MemberDPI;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************&lt;br /&gt;
*This Procedure is used to add members into the DDA database*&lt;br /&gt;
**************************************************
*******************}&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Assign(DPIDatabasefile,'MemberDatabase.datDPI');&lt;br /&gt;
{$I-}&lt;br /&gt;
Reset(DPIDatabasefile);&lt;br /&gt;
{$I+}&lt;br /&gt;
If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
Rewrite(DPIDatabasefile);&lt;br /&gt;
{$I+}&lt;br /&gt;
Repeat&lt;br /&gt;
Textcolor(Black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DPI database.                   ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member ID.');&lt;br /&gt;
readln(DatabaseRecDPI.Member_IDDPI);&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member full name.');&lt;br /&gt;
Readln(DatabaseRecDPI.Member_NameDPI);&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member Ticket Price');&lt;br /&gt;
Readln(DatabaseRecDPI.Member_TicketPaymentDPI);&lt;br /&gt;
Writeln;&lt;br /&gt;
{I-}&lt;br /&gt;
Until IOResult = 0;&lt;br /&gt;
seek(DPIDatabasefile,filesize(DPIDatabasefile));&lt;br /&gt;
Write(DPIDatabasefile,DatabaseRecDPI);&lt;br /&gt;
Write('Now there are ',FileSize(DPIdatabasefile),' records in the DPI Database ');&lt;br /&gt;
ReadLn;&lt;br /&gt;
Close(DPIDatabasefile);&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
  {*************************************************
********************}&lt;br /&gt;
Procedure Add_MemberDSGO;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************&lt;br /&gt;
*This Procedure is used to add members into the DDA database*&lt;br /&gt;
**************************************************
*******************}&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Assign(DSGODatabasefile,'MemberDatabase.datDSGO');&lt;br /&gt;
{$I-}&lt;br /&gt;
Reset(DSGODatabasefile);&lt;br /&gt;
{$I+}&lt;br /&gt;
If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
Rewrite(DSGODatabasefile);&lt;br /&gt;
{$I+}&lt;br /&gt;
Repeat&lt;br /&gt;
Textcolor(Black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DSGO database.                  ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member ID.');&lt;br /&gt;
readln(DatabaseRecDSGO.Member_IDDSGO);&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member full name.');&lt;br /&gt;
Readln(DatabaseRecDSGO.Member_NameDSGO);&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member Ticket Price');&lt;br /&gt;
Readln(DatabaseRecDSGO.Member_TicketPaymentDSGO);&lt;br /&gt;
Writeln;&lt;br /&gt;
{I-}&lt;br /&gt;
Until IOResult = 0;&lt;br /&gt;
seek(DSGODatabasefile,filesize(DSGODatabasefile));&lt;br /&gt;
Write(DSGODatabasefile,DatabaseRecDSGO);&lt;br /&gt;
Write('Now there are ',FileSize(DSGOdatabasefile),' records in the DSGO Database ');&lt;br /&gt;
ReadLn;&lt;br /&gt;
Close(DSGODatabasefile);&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
Procedure GrandTotals;&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure is used to identify the totals that each group pays and *&lt;br /&gt;
*the total of all three groups.                                         *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 var&lt;br /&gt;
&lt;br /&gt;
  Ans:Char;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
    clrscr;&lt;br /&gt;
        Textcolor(Black);&lt;br /&gt;
        Textbackground(White);&lt;br /&gt;
        GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the Grand totals option on the database. º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can view the members grand totals.          º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Writeln(' The Total cost for DDC MEMBERS IS $3900.00 ');&lt;br /&gt;
       Writeln(' The total cost for DPI Members is $2620.00');&lt;br /&gt;
       Writeln(' The total cost for DSGO Members is $1260');&lt;br /&gt;
       Writeln(' The total cost for all the groups are $7780.00');&lt;br /&gt;
       Writeln;&lt;br /&gt;
       Writeln(' Press "s" to stay.');&lt;br /&gt;
       Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
       If ans = 's' then&lt;br /&gt;
        Begin&lt;br /&gt;
        GrandTotals;&lt;br /&gt;
        end&lt;br /&gt;
        Else&lt;br /&gt;
        Mainmenu;&lt;br /&gt;
        end;&lt;br /&gt;
        end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
Procedure Add;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
* This Procedure is used to ask the user which database he would like to *&lt;br /&gt;
* use to add records to the respective groups.                           *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:integer;&lt;br /&gt;
begin&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
Textcolor(Black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the Add option of this database.         º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can add members in different groups .       º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
WRITELN;&lt;br /&gt;
Writeln('Here you will choose which database you want to add someone to.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('1-Add person to DDC database.');&lt;br /&gt;
Writeln('2-Add person to DPI database.');&lt;br /&gt;
Writeln('3-Add person to DSGO database.');&lt;br /&gt;
Writeln('Press any number more than "3" to go to main menu');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press Enter to continue.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
case choice of&lt;br /&gt;
&lt;br /&gt;
1:Add_MemberDDC;&lt;br /&gt;
2:Add_MemberDPI;&lt;br /&gt;
3:Add_MemberDSGO;&lt;br /&gt;
&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Readln;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDDC;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1 ;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DDCDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
	      {$I-}&lt;br /&gt;
	      Reset(DDCDatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DDCDatabasefile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
               Seek(DDCDatabasefile,count);&lt;br /&gt;
	               Read(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               With DatabaseRecDDC do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_ID);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Name);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
                          Writeln('Ticket Payment of member:', Member_TicketPayment);&lt;br /&gt;
                         Textcolor(Black + blink);&lt;br /&gt;
                         Writeln('Press Up arrow to go up,  Down arrow to go down and End to exit.');&lt;br /&gt;
                  Writeln(' ***********');&lt;br /&gt;
	               end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DDCDatabasefile);&lt;br /&gt;
   end;&lt;br /&gt;
{*************************************************
*********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDPI;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DPIDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
	      Reset(DPIDatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DPIDatabasefile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
               Seek(DPIDatabasefile,count);&lt;br /&gt;
	               Read(DPIDatabasefile,DatabaseRecDPI);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               with DatabaseRecDPI do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_IDdpi);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Namedpi);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln('Ticket Payment of member:', Member_TicketPaymentdpi);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
                          Textcolor(Black + blink);&lt;br /&gt;
                         Writeln('Press Up arrow to go up,  Down arrow to go down and End to exit.');&lt;br /&gt;
                  Writeln('********************');&lt;br /&gt;
	               end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DPIDatabasefile);&lt;br /&gt;
&lt;br /&gt;
	   end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              Procedure View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
	   {*************************************************
**&lt;br /&gt;
	   *  This Procedure is used to view the information  *&lt;br /&gt;
	   *  about the members in the DDC Database.          *&lt;br /&gt;
	   **************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DSGODatabasefile,'MemberDatabase.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
	      Reset(DSGODatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DSGODatabasefile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
               Seek(DSGODatabasefile,count);&lt;br /&gt;
	               Read(DSGODatabasefile,DatabaseRecDSGO);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(White);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               With DatabaseRecDSGO do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_IDdsgo);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Namedsgo);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln('Ticket Payment of member:', Member_TicketPaymentdsgo);&lt;br /&gt;
                          Writeln;&lt;br /&gt;
                         Textcolor(Black + blink);&lt;br /&gt;
                         Writeln('Press Up arrow to go up,  Down arrow to go down and End to exit.');&lt;br /&gt;
                 end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DSGODatabasefile);&lt;br /&gt;
&lt;br /&gt;
	   end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  {*************************************************
************************}&lt;br /&gt;
&lt;br /&gt;
Procedure Viewing;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This procedure is used to view the members in the different groups.     *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:Integer;&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the a Viewing option on this database.   º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can select which group to add members.      º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Welcome to the View option of this program');&lt;br /&gt;
Writeln('Here you have to select a number to view members in their group.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('1-View DDC members.');&lt;br /&gt;
Writeln('2-View DPI members.');&lt;br /&gt;
Writeln('3-View DSGO members.');&lt;br /&gt;
Writeln('Press any number bigger than "3" to go to main menu.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press Enter.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Case choice of&lt;br /&gt;
1:View_RecordsDDC;&lt;br /&gt;
2:View_RecordsDPI;&lt;br /&gt;
3:View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure  AboutWCMF;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure is used to give a brief synopsis about the WCMF         *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 Var&lt;br /&gt;
  Ans:char;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    Clrscr;&lt;br /&gt;
     Assign(DDCDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
      {$I-}&lt;br /&gt;
       Reset(DDCDatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
&lt;br /&gt;
     Begin&lt;br /&gt;
    Seek(DDCDatabasefile,count);&lt;br /&gt;
   Read(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
 TextBackground(White);&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the brief synopsis about the WCMF.       º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can view a brief history of the WCMF.       º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Gotoxy(9,10);&lt;br /&gt;
Writeln('The World Creole Music Festival also known as WCMF was');&lt;br /&gt;
GOTOXY(9,11);&lt;br /&gt;
Writeln('established in 1997 by the Dominica Festival Commision');&lt;br /&gt;
GOTOXY(9,12);&lt;br /&gt;
Writeln('during the Independence celebrations. Its main aim was');&lt;br /&gt;
GOTOXY(9,12);&lt;br /&gt;
Writeln('to increase the country revenue from stay over visitors');&lt;br /&gt;
GOTOXY(9,13);&lt;br /&gt;
Writeln('coming to the island for the celebration and also to ');&lt;br /&gt;
GOTOXY(9,14);&lt;br /&gt;
Writeln('further broaden Dominica tourism products and to promote');&lt;br /&gt;
GOTOXY(9,15);&lt;br /&gt;
Writeln('the islands creole music. The WCMF has been a great and ');&lt;br /&gt;
GOTOXY(9,16);&lt;br /&gt;
Writeln('never disappointing  show since it has been established');&lt;br /&gt;
GOTOXY(9,17);&lt;br /&gt;
Writeln('15 years ago, and it is highly improbable for anything');&lt;br /&gt;
GOTOXY(9,18);&lt;br /&gt;
Writeln('to make it unsuccessful!');&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 Close(DDCDatabasefile);&lt;br /&gt;
  Writeln;&lt;br /&gt;
   Textcolor(black);&lt;br /&gt;
   GOTOXY(1,24);&lt;br /&gt;
    Writeln('Press any letter except "g" to go back to the main menu');&lt;br /&gt;
     Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
      If Ans = 'g' then&lt;br /&gt;
&lt;br /&gt;
     Begin&lt;br /&gt;
    AboutWCMF;&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
 Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
    {*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure exit;&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This Procedure is used merely to exit!                                  *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
Begin&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**************************&lt;br /&gt;
*This Procedure is used to view and select the variety of options available*&lt;br /&gt;
**************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º Welcome  to the Member database. It Provides features for   º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º         people attending the festival from the diaspora.    º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                          Enjoy!                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GotoXY(24,11);&lt;br /&gt;
Writeln('1.Enter new Member into a database.');&lt;br /&gt;
GotoXY(24,13);&lt;br /&gt;
writeln('2.View members in their different groups.');&lt;br /&gt;
GotoXY(24,15);&lt;br /&gt;
Writeln('3.View the advertisement.');&lt;br /&gt;
GotoXY(24,17);&lt;br /&gt;
Writeln('4. View Grand totals.');&lt;br /&gt;
GotoXY(24,19);&lt;br /&gt;
Writeln('5.A brief history of WCMF. ');&lt;br /&gt;
GotoXY(24,21);&lt;br /&gt;
Writeln('6.Exit.');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
GotoXY(32,60);&lt;br /&gt;
Textcolor(black + blink);&lt;br /&gt;
Writeln('Press the number of your choice , then press "Enter".');&lt;br /&gt;
GotoXY(70,25);&lt;br /&gt;
Readln(Choice);&lt;br /&gt;
Textcolor(blue);&lt;br /&gt;
Case choice of&lt;br /&gt;
&lt;br /&gt;
1:ADD;&lt;br /&gt;
2:Viewing;&lt;br /&gt;
3:Advert;&lt;br /&gt;
4:GrandTotals;&lt;br /&gt;
5:AboutWCMF;&lt;br /&gt;
6:Exit;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
Begin{Main program}&lt;br /&gt;
clrscr;&lt;br /&gt;
Viewmenu;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end.{End of program}&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427044/re-helpproject-crisis/#427044</guid>
      <pubDate>Thu, 26 Jan 2012 14:59:01 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427045/re-helpproject-crisis/#427045</link>
      <description>Hey i tried the del procedure and i failed. the file_studenttype thing is messing me up. so i was wondering if you could just put it in my program just like how u did the scroll thing.&lt;br /&gt;
&lt;br /&gt;
A problem was found when i viewed the members in the groups other than DDC..like when i am viewing members in dpi and DSGO databases they give me people who are in the ddc database. i overlooked my codes but there seemed to be no error. so i was also wondering if you could check that out for me too.&lt;br /&gt;
&lt;br /&gt;
Um, is it possible to add variables or have a variable that adds it's content..like for the ticket_payment..it would be irrelevant to have a writeln for this as someone could add varying amounts of prices and the writeln part might not match it when they go to view it in the Grand totals procedure..so if you can help out in this part then i would appreciate it alot.&lt;br /&gt;
&lt;br /&gt;
I tried alot to fix the viewing problem.&lt;br /&gt;
&lt;br /&gt;
im going to send my updated program and you can add a person in add_memberddc then you can do the same for the other add procedures in the ADD procedure, then go to view on the main menu&lt;br /&gt;
click "2" to view dpi members if you see members from ddc then that's the problem...so this is a major setback to making my program unique..so please help me.&lt;br /&gt;
&lt;br /&gt;
the edit procedure would be great to but fixing the viewing problem + the adding of the tickets are more important..&lt;br /&gt;
so please help me&lt;br /&gt;
&lt;br /&gt;
thanks......&lt;br /&gt;
&lt;br /&gt;
HERE'S THE UPDATED ONE..PLEASE DON'T THINK OF ME AS A LAZY PERSON..BUT AS YOU ARE AN EXPERT IN TURBO PASCAL I JUST GOT HOOKED ON YOUR ADVISE&lt;br /&gt;
&lt;br /&gt;
AND AGAIN THANKS...A MILLION &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Program schoolSBA;&lt;br /&gt;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}&lt;br /&gt;
&lt;br /&gt;
uses crt, dos,graph;&lt;br /&gt;
&lt;br /&gt;
Type&lt;br /&gt;
MemberDatabaseDDC = record {declaration of record}&lt;br /&gt;
&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
   Member_TicketPayment:integer;&lt;br /&gt;
    Advert:string;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
 MemberDatabaseDPI=record&lt;br /&gt;
 Member_IDdpi : string[10];&lt;br /&gt;
  Member_Namedpi:String[30];&lt;br /&gt;
    Member_TicketPaymentdpi:integer;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
MemberDatabaseDSGO = record&lt;br /&gt;
 Member_IDdsgo : string[10];&lt;br /&gt;
  Member_Namedsgo:String[30];&lt;br /&gt;
    Member_TicketPaymentdsgo:integer;&lt;br /&gt;
      end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
 DDCDatabasefile : file of MemberDatabaseDDC;&lt;br /&gt;
  DatabaseRecDDC: MemberDatabaseDDC; {variable for DDC record}&lt;br /&gt;
&lt;br /&gt;
  DPIDatabasefile: file of MemberDatabaseDPI;&lt;br /&gt;
  DatabaseRecDPI: MemberDatabaseDPI;{variable for DPI record}&lt;br /&gt;
&lt;br /&gt;
  DSGODatabasefile : file of MemberDatabaseDSGO;&lt;br /&gt;
  DatabaseRecDSGO :MemberDatabaseDSGO; {variable for DSGO record}&lt;br /&gt;
&lt;br /&gt;
   Choice, count,i: integer;&lt;br /&gt;
&lt;br /&gt;
    Databasename : String;&lt;br /&gt;
   Var Gd, Gm,&lt;br /&gt;
    Radius, Grow, IncP, IncQ : Integer;&lt;br /&gt;
    DecrP, DecrQ : Boolean;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu; Forward;&lt;br /&gt;
&lt;br /&gt;
{*************************************************&lt;br /&gt;
*This Procedure is used to display the Main Menu *&lt;br /&gt;
*of the program.                                 *&lt;br /&gt;
**************************************************
}&lt;br /&gt;
&lt;br /&gt;
     Procedure Viewmenu;&lt;br /&gt;
    {Procedure to display intro}&lt;br /&gt;
   Begin&lt;br /&gt;
 clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  TextColor(white);&lt;br /&gt;
  Textbackground(Black);&lt;br /&gt;
  Clrscr;&lt;br /&gt;
GotoXY (1,4);&lt;br /&gt;
 WriteLn(    'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
     WriteLn('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼ º');&lt;br /&gt;
     WriteLn('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
     GoToXY(23,23);&lt;br /&gt;
&lt;br /&gt;
     GotoXY (16,6);&lt;br /&gt;
      Writeln('* Welcome to the Member database program.*');&lt;br /&gt;
        TextColor(Green);&lt;br /&gt;
          GotoXY(17,8);&lt;br /&gt;
          Writeln('This program was written by Michael L. Jarvis');&lt;br /&gt;
         GotoXY (17,10);&lt;br /&gt;
        writeln('a student of the Saint Mary`s Academy.');&lt;br /&gt;
      GotoXY(17,12);&lt;br /&gt;
    Writeln('Press "ENTER" to access the main menu.');&lt;br /&gt;
  readln;&lt;br /&gt;
 end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Function File_exist:integer;&lt;br /&gt;
    Begin&lt;br /&gt;
      clrscr;&lt;br /&gt;
        Assign(DDCdatabasefile,'Memberdatabase.dat');&lt;br /&gt;
          {$I-}&lt;br /&gt;
            Reset (DDCDatabasefile);&lt;br /&gt;
           {$I+}&lt;br /&gt;
        If IOResult&amp;lt;&amp;gt;0 then&lt;br /&gt;
          Rewrite(DDCDatabasefile);&lt;br /&gt;
        {$I+}&lt;br /&gt;
      File_Exist := IOResult;&lt;br /&gt;
Close(DDCDatabasefile);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 {*************************************************
**************************}&lt;br /&gt;
 function nextrec(curr, n : longint) : longint ;&lt;br /&gt;
{This function pertains to the view procedures for DDC, DPI and DSGO}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	   CONST&lt;br /&gt;
	      NUL      = chr(0) ;&lt;br /&gt;
	      UP       = chr(72) ;    { UP arrow }&lt;br /&gt;
	      DOWN     = chr(80) ;    { DOWN arrow }&lt;br /&gt;
	      PGUP     = chr(73) ;&lt;br /&gt;
	      PGDN     = chr(81) ;&lt;br /&gt;
	      QUIT     = chr(79) ;    { "END" key }&lt;br /&gt;
	      KEYSET   = [UP, DOWN, PGUP, PGDN, QUIT] ;&lt;br /&gt;
        PGVAL    = 10 ;&lt;br /&gt;
&lt;br /&gt;
	   var&lt;br /&gt;
	      key   : char ;&lt;br /&gt;
&lt;br /&gt;
	   begin&lt;br /&gt;
	      while TRUE do begin  { infinite loop }&lt;br /&gt;
	         key := readkey ;&lt;br /&gt;
	         if key = NUL then begin&lt;br /&gt;
             key := readkey ;&lt;br /&gt;
	            case key of&lt;br /&gt;
	               UP    :  begin&lt;br /&gt;
	                           if curr &amp;lt; n then&lt;br /&gt;
	                              curr := curr + 1 ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               DOWN  :  begin&lt;br /&gt;
	                           if curr &amp;gt; -1 then&lt;br /&gt;
	                              curr := curr - 1 ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               PGUP  :  begin&lt;br /&gt;
	                           if curr + PGVAL &amp;lt;= n then&lt;br /&gt;
	                              curr := curr + PGVAL ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               PGDN  :  begin&lt;br /&gt;
	                           if curr - PGVAL &amp;gt;= -1 then&lt;br /&gt;
	                              curr := curr - PGVAL ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               QUIT  :  begin&lt;br /&gt;
	                           nextrec := -100 ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end&lt;br /&gt;
	            end { case }&lt;br /&gt;
	         end&lt;br /&gt;
	      end&lt;br /&gt;
	   end ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
procedure advert;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure Provides a list of the bands which will be performing   *&lt;br /&gt;
*at the 16th annual World Creole Music Festival.                        *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   var&lt;br /&gt;
   ans:integer;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Begin&lt;br /&gt;
 Gd := Detect;&lt;br /&gt;
 InitGraph(Gd, Gm, 'c:\tp\bgi');&lt;br /&gt;
&lt;br /&gt;
 if GraphResult &amp;lt;&amp;gt; grOk then&lt;br /&gt;
  Halt(1);&lt;br /&gt;
 Randomize;&lt;br /&gt;
 SetColor(White);&lt;br /&gt;
&lt;br /&gt;
OutTextXY(20,20,'On October 29th we have bands like Krosfyah, Beenie Man, Maxi Priest,');&lt;br /&gt;
 OutTextXY(20,30,'Third World, Kassav, and Midnight Groovers!');&lt;br /&gt;
   OutTextXY(25,60,'On October 30th Come see bands like Carimi, Beris Hammond,UB40');&lt;br /&gt;
     OutTextXY(25,70,'Red Hot Flames, Grammacks and WCK.');&lt;br /&gt;
        OutTextXY(30,85,'On October 31st Come see Tabou Combo, Swinging Starz, Triple K');&lt;br /&gt;
         OutTextXY(30,95,'Nasio Fontaine, Sean Paul and Jah Cure.');&lt;br /&gt;
        OutTextXY(40,210,'Press "Enter" to continue.');&lt;br /&gt;
       Readln;&lt;br /&gt;
     CloseGraph;&lt;br /&gt;
   Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************}&lt;br /&gt;
Procedure Add_MemberDDC;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************&lt;br /&gt;
*This Procedure is used to add members into the DDA database*&lt;br /&gt;
**************************************************
*******************}&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Assign(DDCDatabasefile,'MemberDatabase.datDDC');&lt;br /&gt;
       {$I-}&lt;br /&gt;
        Reset(DDCDatabasefile);&lt;br /&gt;
         {$I+}&lt;br /&gt;
          If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
           Rewrite(DDCDatabasefile);&lt;br /&gt;
          {$I+}&lt;br /&gt;
        Repeat&lt;br /&gt;
     Textcolor(Black);&lt;br /&gt;
   Textbackground(White);&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DDC database.                   ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
 Writeln('Enter the Member ID.');&lt;br /&gt;
  readln(DatabaseRecDDC.Member_ID);&lt;br /&gt;
   Writeln;&lt;br /&gt;
    writeln('Enter the Member full name.');&lt;br /&gt;
      Readln(DatabaseRecDDC.Member_Name);&lt;br /&gt;
       Writeln;&lt;br /&gt;
         Writeln('Enter the Member Ticket Price');&lt;br /&gt;
          Readln(DatabaseRecDDC.Member_TicketPayment);&lt;br /&gt;
           Writeln;&lt;br /&gt;
          {I-}&lt;br /&gt;
          Until IOResult = 0;&lt;br /&gt;
        seek(DDCDatabasefile,filesize(DDCDatabasefile));&lt;br /&gt;
      Write(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
   Write('Now there are ',FileSize(DDCdatabasefile),' records in the DDC Database ');&lt;br /&gt;
  ReadLn;&lt;br /&gt;
Close(DDCDatabasefile);&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 {*************************************************
********************}&lt;br /&gt;
Procedure Add_MemberDPI;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************&lt;br /&gt;
*This Procedure is used to add members into the DDA database*&lt;br /&gt;
**************************************************
*******************}&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Assign(DPIDatabasefile,'MemberDatabase.datDPI');&lt;br /&gt;
{$I-}&lt;br /&gt;
Reset(DPIDatabasefile);&lt;br /&gt;
{$I+}&lt;br /&gt;
If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
Rewrite(DPIDatabasefile);&lt;br /&gt;
{$I+}&lt;br /&gt;
Repeat&lt;br /&gt;
Textcolor(Black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DPI database.                   ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member ID.');&lt;br /&gt;
readln(DatabaseRecDPI.Member_IDDPI);&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member full name.');&lt;br /&gt;
Readln(DatabaseRecDPI.Member_NameDPI);&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member Ticket Price');&lt;br /&gt;
Readln(DatabaseRecDPI.Member_TicketPaymentDPI);&lt;br /&gt;
Writeln;&lt;br /&gt;
{I-}&lt;br /&gt;
Until IOResult = 0;&lt;br /&gt;
seek(DPIDatabasefile,filesize(DPIDatabasefile));&lt;br /&gt;
Write(DPIDatabasefile,DatabaseRecDPI);&lt;br /&gt;
Write('Now there are ',FileSize(DPIdatabasefile),' records in the DPI Database ');&lt;br /&gt;
ReadLn;&lt;br /&gt;
Close(DPIDatabasefile);&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
  {*************************************************
********************}&lt;br /&gt;
Procedure Add_MemberDSGO;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************&lt;br /&gt;
*This Procedure is used to add members into the DDA database*&lt;br /&gt;
**************************************************
*******************}&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Assign(DSGODatabasefile,'MemberDatabase.datDSGO');&lt;br /&gt;
{$I-}&lt;br /&gt;
Reset(DSGODatabasefile);&lt;br /&gt;
{$I+}&lt;br /&gt;
If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
Rewrite(DSGODatabasefile);&lt;br /&gt;
{$I+}&lt;br /&gt;
Repeat&lt;br /&gt;
Textcolor(Black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
GotoXY(23,8);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(23,9);&lt;br /&gt;
Writeln('------------------------------------------------');&lt;br /&gt;
GotoXY(32,10);&lt;br /&gt;
Writeln(' Welcome to the DSGO database.                  ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('                                                ');&lt;br /&gt;
GOTOXY(23,11);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
Gotoxy(23,12);&lt;br /&gt;
Writeln('----------------------------------------------- ');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member ID.');&lt;br /&gt;
readln(DatabaseRecDSGO.Member_IDDSGO);&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member full name.');&lt;br /&gt;
Readln(DatabaseRecDSGO.Member_NameDSGO);&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Enter the Member Ticket Price');&lt;br /&gt;
Readln(DatabaseRecDSGO.Member_TicketPaymentDSGO);&lt;br /&gt;
Writeln;&lt;br /&gt;
{I-}&lt;br /&gt;
Until IOResult = 0;&lt;br /&gt;
seek(DSGODatabasefile,filesize(DSGODatabasefile));&lt;br /&gt;
Write(DSGODatabasefile,DatabaseRecDSGO);&lt;br /&gt;
Write('Now there are ',FileSize(DSGOdatabasefile),' records in the DSGO Database ');&lt;br /&gt;
ReadLn;&lt;br /&gt;
Close(DSGODatabasefile);&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
Procedure GrandTotals;&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure is used to identify the totals that each group pays and *&lt;br /&gt;
*the total of all three groups.                                         *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 var&lt;br /&gt;
&lt;br /&gt;
  Ans:Char;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
    clrscr;&lt;br /&gt;
        Textcolor(Black);&lt;br /&gt;
        Textbackground(White);&lt;br /&gt;
        GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the Grand totals option on the database. º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can view the members grand totals.          º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Writeln(' The Total cost for DDC MEMBERS IS $3900.00 ');&lt;br /&gt;
       Writeln(' The total cost for DPI Members is $2620.00');&lt;br /&gt;
       Writeln(' The total cost for DSGO Members is $1260');&lt;br /&gt;
       Writeln(' The total cost for all the groups are $7780.00');&lt;br /&gt;
       Writeln;&lt;br /&gt;
       Writeln(' Press "s" to stay.');&lt;br /&gt;
       Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
       If ans = 's' then&lt;br /&gt;
        Begin&lt;br /&gt;
        GrandTotals;&lt;br /&gt;
        end&lt;br /&gt;
        Else&lt;br /&gt;
        Mainmenu;&lt;br /&gt;
        end;&lt;br /&gt;
        end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
Procedure Add;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
* This Procedure is used to ask the user which database he would like to *&lt;br /&gt;
* use to add records to the respective groups.                           *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:integer;&lt;br /&gt;
begin&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
Textcolor(Black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the Add option of this database.         º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can add members in different groups .       º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
WRITELN;&lt;br /&gt;
Writeln('Here you will choose which database you want to add someone to.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('1-Add person to DDC database.');&lt;br /&gt;
Writeln('2-Add person to DPI database.');&lt;br /&gt;
Writeln('3-Add person to DSGO database.');&lt;br /&gt;
Writeln('Press any number more than "3" to go to main menu');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press Enter to continue.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
case choice of&lt;br /&gt;
&lt;br /&gt;
1:Add_MemberDDC;&lt;br /&gt;
2:Add_MemberDPI;&lt;br /&gt;
3:Add_MemberDSGO;&lt;br /&gt;
&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Readln;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDDC;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1 ;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DDCDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
	      {$I-}&lt;br /&gt;
	      Reset(DDCDatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DDCDatabasefile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
               Seek(DDCDatabasefile,count);&lt;br /&gt;
	               Read(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               With DatabaseRecDDC do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_ID);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Name);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
                          Writeln('Ticket Payment of member:', Member_TicketPayment);&lt;br /&gt;
                         Textcolor(Black + blink);&lt;br /&gt;
                         Writeln('Press Up arrow to go up,  Down arrow to go down and End to exit.');&lt;br /&gt;
                  Writeln(' ***********');&lt;br /&gt;
	               end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DDCDatabasefile);&lt;br /&gt;
   end;&lt;br /&gt;
{*************************************************
*********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDPI;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DPIDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
	      Reset(DPIDatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DPIDatabasefile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
               Seek(DPIDatabasefile,count);&lt;br /&gt;
	               Read(DPIDatabasefile,DatabaseRecDPI);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               with DatabaseRecDPI do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_IDdpi);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Namedpi);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln('Ticket Payment of member:', Member_TicketPaymentdpi);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
                          Textcolor(Black + blink);&lt;br /&gt;
                         Writeln('Press Up arrow to go up,  Down arrow to go down and End to exit.');&lt;br /&gt;
                  Writeln('********************');&lt;br /&gt;
	               end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DPIDatabasefile);&lt;br /&gt;
&lt;br /&gt;
	   end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              Procedure View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
	   {*************************************************
**&lt;br /&gt;
	   *  This Procedure is used to view the information  *&lt;br /&gt;
	   *  about the members in the DDC Database.          *&lt;br /&gt;
	   **************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DSGODatabasefile,'MemberDatabase.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
	      Reset(DSGODatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DSGODatabasefile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
               Seek(DSGODatabasefile,count);&lt;br /&gt;
	               Read(DSGODatabasefile,DatabaseRecDSGO);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(White);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               With DatabaseRecDSGO do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_IDdsgo);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Namedsgo);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln('Ticket Payment of member:', Member_TicketPaymentdsgo);&lt;br /&gt;
                          Writeln;&lt;br /&gt;
                         Textcolor(Black + blink);&lt;br /&gt;
                         Writeln('Press Up arrow to go up,  Down arrow to go down and End to exit.');&lt;br /&gt;
                 end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DSGODatabasefile);&lt;br /&gt;
&lt;br /&gt;
	   end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  {*************************************************
************************}&lt;br /&gt;
&lt;br /&gt;
Procedure Viewing;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This procedure is used to view the members in the different groups.     *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:Integer;&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the a Viewing option on this database.   º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can select which group to add members.      º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Welcome to the View option of this program');&lt;br /&gt;
Writeln('Here you have to select a number to view members in their group.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('1-View DDC members.');&lt;br /&gt;
Writeln('2-View DPI members.');&lt;br /&gt;
Writeln('3-View DSGO members.');&lt;br /&gt;
Writeln('Press any number bigger than "3" to go to main menu.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press Enter.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Case choice of&lt;br /&gt;
1:View_RecordsDDC;&lt;br /&gt;
2:View_RecordsDPI;&lt;br /&gt;
3:View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure  AboutWCMF;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure is used to give a brief synopsis about the WCMF         *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 Var&lt;br /&gt;
  Ans:char;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    Clrscr;&lt;br /&gt;
     Assign(DDCDatabasefile,'MemberDatabase.dat');&lt;br /&gt;
      {$I-}&lt;br /&gt;
       Reset(DDCDatabasefile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
&lt;br /&gt;
     Begin&lt;br /&gt;
    Seek(DDCDatabasefile,count);&lt;br /&gt;
   Read(DDCDatabasefile,DatabaseRecDDC);&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
 TextBackground(White);&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the brief synopsis about the WCMF.       º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can view a brief history of the WCMF.       º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Gotoxy(9,10);&lt;br /&gt;
Writeln('The World Creole Music Festival also known as WCMF was');&lt;br /&gt;
GOTOXY(9,11);&lt;br /&gt;
Writeln('established in 1997 by the Dominica Festival Commision');&lt;br /&gt;
GOTOXY(9,12);&lt;br /&gt;
Writeln('during the Independence celebrations. Its main aim was');&lt;br /&gt;
GOTOXY(9,12);&lt;br /&gt;
Writeln('to increase the country revenue from stay over visitors');&lt;br /&gt;
GOTOXY(9,13);&lt;br /&gt;
Writeln('coming to the island for the celebration and also to ');&lt;br /&gt;
GOTOXY(9,14);&lt;br /&gt;
Writeln('further broaden Dominica tourism products and to promote');&lt;br /&gt;
GOTOXY(9,15);&lt;br /&gt;
Writeln('the islands creole music. The WCMF has been a great and ');&lt;br /&gt;
GOTOXY(9,16);&lt;br /&gt;
Writeln('never disappointing  show since it has been established');&lt;br /&gt;
GOTOXY(9,17);&lt;br /&gt;
Writeln('15 years ago, and it is highly improbable for anything');&lt;br /&gt;
GOTOXY(9,18);&lt;br /&gt;
Writeln('to make it unsuccessful!');&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 Close(DDCDatabasefile);&lt;br /&gt;
  Writeln;&lt;br /&gt;
   Textcolor(black);&lt;br /&gt;
   GOTOXY(1,24);&lt;br /&gt;
    Writeln('Press any letter except "g" to go back to the main menu');&lt;br /&gt;
     Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
      If Ans = 'g' then&lt;br /&gt;
&lt;br /&gt;
     Begin&lt;br /&gt;
    AboutWCMF;&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
 Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
    {*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure exit;&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This Procedure is used merely to exit!                                  *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
Begin&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**************************&lt;br /&gt;
*This Procedure is used to view and select the variety of options available*&lt;br /&gt;
**************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º Welcome  to the Member database. It Provides features for   º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º         people attending the festival from the diaspora.    º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                          Enjoy!                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GotoXY(24,11);&lt;br /&gt;
Writeln('1.Enter new Member into a database.');&lt;br /&gt;
GotoXY(24,13);&lt;br /&gt;
writeln('2.View members in their different groups.');&lt;br /&gt;
GotoXY(24,15);&lt;br /&gt;
Writeln('3.View the advertisement.');&lt;br /&gt;
GotoXY(24,17);&lt;br /&gt;
Writeln('4. View Grand totals.');&lt;br /&gt;
GotoXY(24,19);&lt;br /&gt;
Writeln('5.A brief history of WCMF. ');&lt;br /&gt;
GotoXY(24,21);&lt;br /&gt;
Writeln('6.Exit.');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
GotoXY(32,60);&lt;br /&gt;
Textcolor(black + blink);&lt;br /&gt;
Writeln('Press the number of your choice , then press "Enter".');&lt;br /&gt;
GotoXY(70,25);&lt;br /&gt;
Readln(Choice);&lt;br /&gt;
Textcolor(blue);&lt;br /&gt;
Case choice of&lt;br /&gt;
&lt;br /&gt;
1:ADD;&lt;br /&gt;
2:Viewing;&lt;br /&gt;
3:Advert;&lt;br /&gt;
4:GrandTotals;&lt;br /&gt;
5:AboutWCMF;&lt;br /&gt;
6:Exit;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
Begin{Main program}&lt;br /&gt;
clrscr;&lt;br /&gt;
Viewmenu;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end.{End of program}&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427045/re-helpproject-crisis/#427045</guid>
      <pubDate>Thu, 26 Jan 2012 15:06:09 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427061/re-helpproject-crisis/#427061</link>
      <description>&lt;span style="color: Blue;"&gt;&lt;br /&gt;
: &lt;br /&gt;
: A problem was found when i viewed the members in the groups other &lt;br /&gt;
: than DDC..like when i am viewing members in dpi and DSGO databases &lt;br /&gt;
: they give me people who are in the ddc database. i overlooked my &lt;br /&gt;
: codes but there seemed to be no error. so i was also wondering if &lt;br /&gt;
: you could check that out for me too.&lt;br /&gt;
:&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Turbo Pascal cannot handle long file names.  It expects the old 8.3 file name format used in the old DOS operating system.  Under this system a file name could be up to 8 characters long, followed by an optional DOT followed by an optional extension of up to 3 characters.  &lt;br /&gt;
&lt;br /&gt;
When you give Turbo Pascal a long file name it will throw away any characters after the 8th in the file name proper, and also throw away any characters after the 3rd in the extension.  Thus 'MemberDatabase.datDSGO' becomes 'MemberDa.dat' .&lt;br /&gt;
&lt;br /&gt;
I count 8 assign statements in your program. &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   Assign(DDCdatabasefile,  'Memberdatabase.dat');
   Assign(DDCDatabasefile,  'MemberDatabase.datDDC');
   Assign(DPIDatabasefile,  'MemberDatabase.datDPI');
   Assign(DSGODatabasefile, 'MemberDatabase.datDSGO');
   Assign(DDCDatabasefile,  'MemberDatabase.dat');
   Assign(DPIDatabasefile,  'MemberDatabase.dat');
   Assign(DSGODatabasefile, 'MemberDatabase.dat');
   Assign(DDCDatabasefile,  'MemberDatabase.dat');
&lt;/pre&gt;&lt;br /&gt;
While it looks like you are creating 4 files you are actually creating just one: 'MemberDa.dat' .  You need to create 4 distinct 8.3 file names such as &lt;strong&gt;'MemberDB.dat', 'MemberDB.DDC', 'MemberDB.DPI', 'MemberDB.DSG'&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
By the way, and this is not critical, you seem to have 3 file variables: &lt;strong&gt;DDCdatabasefile, DPIDatabasefile, DSGODatabasefile&lt;/strong&gt;.  I suggest you create a 4th, say &lt;strong&gt;Databasefile&lt;/strong&gt;, then have four assign statements in the main body of your program.  viz&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Begin{Main program}
   assign(Databasefile,     'MemberDB.dat') ;
   assign(DDCdatabasefile,  'MemberDB.DDC') ;
   assign(DPIdatabasefile,  'MemberDB.DPI') ;
   assign(DSGOdatabasefile, 'MemberDB.DGO') ;

   clrscr;
   Viewmenu;
   Mainmenu;
end.{End of program}
&lt;/pre&gt;&lt;br /&gt;
This will associate each file with a definite file variable and you will need no assign statements anywhere else in your program.  You can reset, rewrite and close to your heart's content.  Just a suggestion.&lt;br /&gt;
&lt;br /&gt;
I'll try to get back to you on your other questions ASAP.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427061/re-helpproject-crisis/#427061</guid>
      <pubDate>Fri, 27 Jan 2012 12:26:09 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427159/re-helpproject-crisis/#427159</link>
      <description>&lt;pre class="sourcecode"&gt;
(*  1*) Program schoolSBA;
(*  2*) {This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}
(*  3*) 
(*  4*) uses crt, dos,graph;
(*  5*) 
(*  6*) Type
(*  7*)    MemberDatabaseDDC = record {declaration of record}
(*  8*)       Member_ID : string[10];
(*  9*)       Member_Name:String[30];
(* 10*)       Member_TicketPayment:integer;
(* 11*)       Advert:string;
(* 12*)    end;
(* 13*) 
(* 14*)    MemberDatabaseDPI=record
(* 15*)       Member_IDdpi : string[10];
(* 16*)       Member_Namedpi:String[30];
(* 17*)       Member_TicketPaymentdpi:integer;
(* 18*)    end;
(* 19*) 
(* 20*)    MemberDatabaseDSGO = record
(* 21*)       Member_IDdsgo : string[10];
(* 22*)       Member_Namedsgo:String[30];
(* 23*)       Member_TicketPaymentdsgo:integer;
(* 24*)    end;
(* 25*) 
(* 26*) var
(* 27*)    DDCDatabasefile : file of MemberDatabaseDDC;
(* 28*)    DatabaseRecDDC: MemberDatabaseDDC; {variable for DDC record}
(* 29*) 
(* 30*)    DPIDatabasefile: file of MemberDatabaseDPI;
(* 31*)    DatabaseRecDPI: MemberDatabaseDPI;{variable for DPI record}
(* 32*) 
(* 33*)    DSGODatabasefile : file of MemberDatabaseDSGO;
(* 34*)    DatabaseRecDSGO :MemberDatabaseDSGO; {variable for DSGO record}
(* 35*) 
(* 36*)    Choice, count,i: integer;
(* 37*) 
(* 38*)    Databasename : String;
(* 39*)    Var Gd, Gm,
(* 40*)    Radius, Grow, IncP, IncQ : Integer;
(* 41*)    DecrP, DecrQ : Boolean;
(* 42*) 
(* 43*)       Procedure Mainmenu; Forward;  &lt;span style="color: Red;"&gt;{ Get rid of recursive calls and you won't need this "forward". }&lt;/span&gt;
(* 44*)
(* 45*)       {*************************************************
(* 46*)       *This Procedure is used to display the Main Menu *
(* 47*)       *of the program. *
(* 48*)       **************************************************
}
(* 49*) 
(* 50*)       Procedure Viewmenu;
(* 51*)       {Procedure to display intro}
(* 52*)       Begin
(* 53*)          clrscr;
(* 54*) 
(* 55*)          TextColor(white);
(* 56*)          Textbackground(Black);
(* 57*)          Clrscr;
(* 58*)          GotoXY (1,4);
(* 59*)          WriteLn( 'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(* 60*)          WriteLn('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º');
(* 61*)          WriteLn('º º º º');
(* 62*)          WriteLn('º º º º');
(* 63*)          WriteLn('º º º º');
(* 64*)          WriteLn('º º º º');
(* 65*)          WriteLn('º º º º');
(* 66*)          WriteLn('º º º º');
(* 67*)          WriteLn('º º º º');
(* 68*)          WriteLn('º º º º');
(* 69*)          WriteLn('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼ º');
(* 70*)          WriteLn('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(* 71*)          GoToXY(23,23);
(* 72*) 
(* 73*)          GotoXY (16,6);
(* 74*)          Writeln('* Welcome to the Member database program.*');
(* 75*)          TextColor(Green);
(* 76*)          GotoXY(17,8);
(* 77*)          Writeln('This program was written by Michael L. Jarvis');
(* 78*)          GotoXY (17,10);
(* 79*)          writeln('a student of the Saint Mary`s Academy.');
(* 80*)          GotoXY(17,12);
(* 81*)          Writeln('Press "ENTER" to access the main menu.');
(* 82*)          readln;
(* 83*)       end;
(* 84*) 
(* 85*) 
(* 86*)       Function File_exist:integer;
(* 87*)       Begin
(* 88*)          clrscr;
(* 89*)          Assign(DDCdatabasefile,'Memberdatabase.dat');
(* 90*)          {$I-}
(* 91*)          Reset (DDCDatabasefile);
(* 92*)          {$I+}
(* 93*)          If IOResult&amp;lt;&amp;gt;0 then
(* 94*)          Rewrite(DDCDatabasefile);
(* 95*)          {$I+}
(* 96*)          File_Exist := IOResult;
(* 97*)          Close(DDCDatabasefile);
(* 98*)       end;
(* 99*) 
(*100*)       {*************************************************
**************************}
(*101*)       function nextrec(curr, n : longint) : longint ;
(*102*)       {This function pertains to the view procedures for DDC, DPI and DSGO}
(*103*) 
(*104*)       CONST
(*105*)          NUL = chr(0) ;
(*106*)          UP = chr(72) ; { UP arrow }
(*107*)          DOWN = chr(80) ; { DOWN arrow }
(*108*)          PGUP = chr(73) ;
(*109*)          PGDN = chr(81) ;
(*110*)          QUIT = chr(79) ; { "END" key }
(*111*)          KEYSET = [UP, DOWN, PGUP, PGDN, QUIT] ;
(*112*)          PGVAL = 10 ;
(*113*) 
(*114*)       var
(*115*)          key : char ;
(*116*) 
(*117*)       begin
(*118*)          while TRUE do begin { infinite loop }
(*119*)             key := readkey ;
(*120*)             if key = NUL then begin
(*121*)                key := readkey ;
(*122*)                case key of
(*123*)                   UP :     begin
(*124*)                               if curr &amp;lt; n then
(*125*)                                  curr := curr + 1 ;
(*126*)                               nextrec := curr ;
(*127*)                               exit
(*128*)                            end ;
(*129*)                   DOWN :   begin
(*130*)                               if curr &amp;gt; -1 then
(*131*)                                  curr := curr - 1 ;
(*132*)                               nextrec := curr ;
(*133*)                               exit
(*134*)                            end ;
(*135*)                   PGUP :   begin
(*136*)                               if curr + PGVAL &amp;lt;= n then
(*137*)                                  curr := curr + PGVAL ;
(*138*)                               nextrec := curr ;
(*139*)                               exit
(*140*)                            end ;
(*141*)                   PGDN :   begin
(*142*)                               if curr - PGVAL &amp;gt;= -1 then
(*143*)                                  curr := curr - PGVAL ;
(*144*)                               nextrec := curr ;
(*145*)                               exit
(*146*)                            end ;
(*147*)                   QUIT :   begin
(*148*)                               nextrec := -100 ;
(*149*)                               exit
(*150*)                            end
(*151*)                end { case }
(*152*)             end
(*153*)          end
(*154*)       end ;
(*155*) 
(*156*)       procedure advert;
(*157*)       {*************************************************
***********************
(*158*)       *This Procedure Provides a list of the bands which will be performing *
(*159*)       *at the 16th annual World Creole Music Festival. *
(*160*)       **************************************************
**********************}
(*161*)       var
(*162*)          ans:integer;
(*163*)       
(*164*)       Begin
(*165*)          Gd := Detect;
(*166*)          InitGraph(Gd, Gm, 'c:\tp\bgi');
(*167*) 
(*168*)          if GraphResult &amp;lt;&amp;gt; grOk then
(*169*)             Halt(1);
(*170*)          Randomize;
(*171*)          SetColor(White);
(*172*) 
(*173*)          OutTextXY(20,20,'On October 29th we have bands like Krosfyah, Beenie Man, Maxi Priest,');
(*174*)          OutTextXY(20,30,'Third World, Kassav, and Midnight Groovers!');
(*175*)          OutTextXY(25,60,'On October 30th Come see bands like Carimi, Beris Hammond,UB40');
(*176*)          OutTextXY(25,70,'Red Hot Flames, Grammacks and WCK.');
(*177*)          OutTextXY(30,85,'On October 31st Come see Tabou Combo, Swinging Starz, Triple K');
(*178*)          OutTextXY(30,95,'Nasio Fontaine, Sean Paul and Jah Cure.');
(*179*)          OutTextXY(40,210,'Press "Enter" to continue.');
(*180*)          Readln;
(*181*)          CloseGraph;
(*182*)          Mainmenu;    &lt;span style="color: Red;"&gt;{ Recursive call! }&lt;/span&gt;
(*183*)       end;
(*184*) 
(*185*)       {*************************************************
********************}
(*186*)       Procedure Add_MemberDDC;
(*187*)       {*************************************************
********************
(*188*)       *This Procedure is used to add members into the DDA database*
(*189*)       **************************************************
*******************}
(*190*)       BEGIN
(*191*)          clrscr;
(*192*) 
(*193*)          Assign(DDCDatabasefile,'MemberDatabase.datDDC');
(*194*)          {$I-}
(*195*)          Reset(DDCDatabasefile);
(*196*)             {$I+}
(*197*)             If IOResult &amp;lt;&amp;gt;0 then
(*198*)                Rewrite(DDCDatabasefile);
(*199*)             {$I+}     &lt;span style="color: Red;"&gt;{ Why repeat switch of 3 lines previous? }&lt;/span&gt;
(*200*)             Repeat
(*201*)                Textcolor(Black);
(*202*)                Textbackground(White);
(*203*)                GotoXY(23,8);
(*204*) 
(*205*)                Writeln('------------------------------------------------');
(*206*)                GotoXY(23,9);
(*207*)                Writeln('------------------------------------------------');
(*208*)                GotoXY(32,10);
(*209*)                Writeln(' Welcome to the DDC database. ');
(*210*)                GOTOXY(23,11);
(*211*)                Writeln(' ');
(*212*)                GOTOXY(23,11);
(*213*)                Writeln('----------------------------------------------- ');
(*214*)                Gotoxy(23,12);
(*215*)                Writeln('----------------------------------------------- ');
(*216*) 
(*217*)                Writeln;
(*218*)                Writeln('Enter the Member ID.');
(*219*)                readln(DatabaseRecDDC.Member_ID);
(*220*)                Writeln;
(*221*)                writeln('Enter the Member full name.');
(*222*)                Readln(DatabaseRecDDC.Member_Name);
(*223*)                Writeln;
(*224*)                Writeln('Enter the Member Ticket Price');
(*225*)                Readln(DatabaseRecDDC.Member_TicketPayment);
(*226*)                Writeln;
(*227*)                {I-}   &lt;span style="color: Red;"&gt;{ Why turn off error checking at this point?
                                     When is it turned back on?
                                     Do you have the switches of lines 199
                                     and 227 reversed? }&lt;/span&gt;
(*228*)             Until IOResult = 0;
(*229*)             seek(DDCDatabasefile,filesize(DDCDatabasefile));
(*230*)             Write(DDCDatabasefile,DatabaseRecDDC);
(*231*)             Write('Now there are ',FileSize(DDCdatabasefile),' records in the DDC Database ');
(*232*)             ReadLn;
(*233*)          Close(DDCDatabasefile);
(*234*)          Mainmenu;    &lt;span style="color: Red;"&gt;{ Recursive call! }&lt;/span&gt;
(*235*)       end;
(*236*) 
{*************************************************
***********************}
(*386*)       Procedure Add;
(*387*)       {*************************************************
************************
(*388*)       * This Procedure is used to ask the user which database he would like to *
(*389*)       * use to add records to the respective groups. *
(*390*)       **************************************************
***********************}
(*391*)       var
(*392*)          Ans : char;
(*393*)          choice:integer;
(*394*)       begin
(*395*)          clrscr;
(*396*) 
(*397*)          Textcolor(Black);
(*398*)          Textbackground(White);
(*399*)          GotoXY(8,2);
(*400*)          Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*401*)          Gotoxy(8,3);
(*402*)          Writeln ('º º');
(*403*)          Gotoxy(8,4);
(*404*)          Writeln ('º Welcome to the Add option of this database. º');
(*405*)          Gotoxy(8,5);
(*406*)          Writeln ('º Here you can add members in different groups . º');
(*407*)          Gotoxy(8,6);
(*408*)          Writeln ('º Enjoy! º');
(*409*)          Gotoxy(8,7);
(*410*)          Writeln ('º º');
(*411*)          Gotoxy(8,8);
(*412*)          Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*413*) 
(*414*)          WRITELN;
(*415*)          Writeln('Here you will choose which database you want to add someone to.');
(*416*)          Writeln;
(*417*)          Writeln('1-Add person to DDC database.');
(*418*)          Writeln('2-Add person to DPI database.');
(*419*)          Writeln('3-Add person to DSGO database.');
(*420*)          Writeln('Press any number more than "3" to go to main menu');
(*421*)          Writeln;
(*422*)          Writeln('Press the respective number then press Enter to continue.');
(*423*)          Readln(choice);
(*424*) 
(*425*)          case choice of
(*426*)             1:Add_MemberDDC;
(*427*)             2:Add_MemberDPI;
(*428*)             3:Add_MemberDSGO;
(*429*)          END;
(*430*) 
(*431*)          Readln;
(*432*)          Mainmenu;    &lt;span style="color: Red;"&gt;{ Recursive call }&lt;/span&gt;
(*433*)       end;
(*434*) 
(*435*)       {*************************************************
*************************}
(*436*)       Procedure View_RecordsDDC;
(*437*)       {*************************************************
**
(*438*)       * This Procedure is used to view the information *
(*439*)       * about the members in the DDC Database. *
(*440*)       **************************************************
*}
(*441*)       CONST
(*442*)          SIZE = 1 ; { max number or records to be displayed }
(*443*)       Var
(*444*)          Ans : INTEGER;
(*445*)          count, { loop counter }
(*446*)          n, { index of last record in database file }
(*447*)          curr : longint ; { index of current record in database file }
(*448*) 
(*449*)       Begin
(*450*)          Assign(DDCDatabasefile,'MemberDatabase.dat');
(*451*)          {$I-}
(*452*)          Reset(DDCDatabasefile);
(*453*)             {$I+}
(*454*)             n := filesize(DDCDatabasefile) - 1 ;
(*455*)             curr := 1 ; { default value }
(*456*) 
(*457*)             repeat
(*458*)                clrscr ;
(*459*)                For count := curr - (SIZE - 1) to curr do Begin
(*460*)                   if (count &amp;lt; 0) or (count &amp;gt; n) then
(*461*)                      continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
(*462*) 
(*463*)                   Seek(DDCDatabasefile,count);
(*464*)                   Read(DDCDatabasefile,DatabaseRecDDC);
(*465*)                   writeln;
(*466*)                   Textcolor(Black);
(*467*)                   Textbackground(White);
(*468*) 
(*469*)                   With DatabaseRecDDC do begin
(*470*)                      Writeln;
(*471*)                      writeln('Member Identification#:', Member_ID);
(*472*)                      writeln;
(*473*)                      writeln('name of Member: ', Member_Name);
(*474*)                      Writeln;
(*475*)                      Writeln;
(*476*)                      Writeln('Ticket Payment of member:', Member_TicketPayment);
(*477*)                      Textcolor(Black + blink);
(*478*)                      Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
(*479*)                      Writeln(' ***********');
(*480*)                   end
(*481*)                end;
(*482*)                curr := nextrec(curr, n)
(*483*)             until curr &amp;lt; -99 ;
(*484*)          close(DDCDatabasefile);
(*485*)       end;
(*486*)       {*************************************************
*********************}
(*487*) 
(*488*)       {*************************************************
**********************}
(*489*)       Procedure View_RecordsDPI;
(*490*)       {*************************************************
**
(*491*)       * This Procedure is used to view the information *
(*492*)       * about the members in the DDC Database. *
(*493*)       **************************************************
*}
(*494*)       CONST
(*495*)          SIZE = 1; { max number or records to be displayed }
(*496*)       Var
(*497*)          Ans : INTEGER;
(*498*)          count, { loop counter }
(*499*)          n, { index of last record in database file }
(*500*)          curr : longint ; { index of current record in database file }
(*501*) 
(*502*)       Begin
(*503*)          Assign(DPIDatabasefile,'MemberDatabase.dat');
(*504*)          {$I-}
(*505*)          Reset(DPIDatabasefile);
(*506*)             {$I+}
(*507*)             n := filesize(DPIDatabasefile) - 1 ;
(*508*)             curr := 1 ; { default value }
(*509*) 
(*510*)             repeat
(*511*)                clrscr ;
(*512*)                For count := curr - (SIZE - 1) to curr do Begin
(*513*)                   if (count &amp;lt; 0) or (count &amp;gt; n) then
(*514*)                      continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
(*515*) 
(*516*)                   Seek(DPIDatabasefile,count);
(*517*)                   Read(DPIDatabasefile,DatabaseRecDPI);
(*518*)                   writeln;
(*519*)                   Textcolor(Black);
(*520*)                   Textbackground(White);
(*521*) 
(*522*)                   with DatabaseRecDPI do begin
(*523*)                      Writeln;
(*524*)                      writeln('Member Identification#:', Member_IDdpi);
(*525*)                      writeln;
(*526*)                      writeln('name of Member: ', Member_Namedpi);
(*527*)                      Writeln;
(*528*)                      Writeln('Ticket Payment of member:', Member_TicketPaymentdpi);
(*529*)                      Writeln;
(*530*)                      Textcolor(Black + blink);
(*531*)                      Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
(*532*)                      Writeln('********************');
(*533*)                   end
(*534*)                end;
(*535*)                curr := nextrec(curr, n)
(*536*)             until curr &amp;lt; -99 ;
(*537*)          close(DPIDatabasefile);
(*538*)       end;
(*539*) 
(*540*)       {*************************************************
**********************}
(*541*)       Procedure View_RecordsDSGO;
(*542*)       {*************************************************
**
(*543*)       * This Procedure is used to view the information *
(*544*)       * about the members in the DDC Database. *
(*545*)       **************************************************
*}
(*546*)       CONST
(*547*)          SIZE = 1; { max number or records to be displayed }
(*548*)       Var
(*549*)          Ans : INTEGER;
(*550*)          count, { loop counter }
(*551*)          n, { index of last record in database file }
(*552*)          curr : longint ; { index of current record in database file }
(*553*) 
(*554*)       Begin
(*555*)          Assign(DSGODatabasefile,'MemberDatabase.dat');
(*556*)          {$I-}
(*557*)          Reset(DSGODatabasefile);
(*558*)             {$I+}
(*559*)             n := filesize(DSGODatabasefile) - 1 ;
(*560*)             curr := 1 ; { default value }
(*561*) 
(*562*)             repeat
(*563*)                clrscr ;
(*564*)                For count := curr - (SIZE - 1) to curr do Begin
(*565*)                   if (count &amp;lt; 0) or (count &amp;gt; n) then
(*566*)                      continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
(*567*) 
(*568*)                   Seek(DSGODatabasefile,count);
(*569*)                   Read(DSGODatabasefile,DatabaseRecDSGO);
(*570*)                   writeln;
(*571*)                   Textcolor(White);
(*572*)                   Textbackground(White);
(*573*) 
(*574*)                   With DatabaseRecDSGO do begin
(*575*)                      Writeln;
(*576*)                      writeln('Member Identification#:', Member_IDdsgo);
(*577*)                      writeln;
(*578*)                      writeln('name of Member: ', Member_Namedsgo);
(*579*)                      Writeln;
(*580*)                      Writeln('Ticket Payment of member:', Member_TicketPaymentdsgo);
(*581*)                      Writeln;
(*582*)                      Textcolor(Black + blink);
(*583*)                      Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
(*584*)                   end
(*585*)                end;
(*586*)                curr := nextrec(curr, n)
(*587*)             until curr &amp;lt; -99 ;
(*588*)          close(DSGODatabasefile);
(*589*)       end;
(*590*)       {*************************************************
**********************}
(*591*) 
(*592*)       {*************************************************
************************}
(*593*)       Procedure Viewing;
(*594*)       {*************************************************
************************
(*595*)       *This procedure is used to view the members in the different groups. *
(*596*)       **************************************************
***********************}
(*597*)       Var
(*598*)          Ans : char;
(*599*)          choice:Integer;
(*600*) 
(*601*)       Begin
(*602*)          clrscr;
(*603*)          GotoXY(8,2);
(*604*)          Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*605*)          Gotoxy(8,3);
(*606*)          Writeln ('º º');
(*607*)          Gotoxy(8,4);
(*608*)          Writeln ('º Welcome to the a Viewing option on this database. º');
(*609*)          Gotoxy(8,5);
(*610*)          Writeln ('º Here you can select which group to add members. º');
(*611*)          Gotoxy(8,6);
(*612*)          Writeln ('º Enjoy! º');
(*613*)          Gotoxy(8,7);
(*614*)          Writeln ('º º');
(*615*)          Gotoxy(8,8);
(*616*)          Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*617*) 
(*618*)          Writeln;
(*619*)          Writeln('Welcome to the View option of this program');
(*620*)          Writeln('Here you have to select a number to view members in their group.');
(*621*)          Writeln;
(*622*)          Writeln('1-View DDC members.');
(*623*)          Writeln('2-View DPI members.');
(*624*)          Writeln('3-View DSGO members.');
(*625*)          Writeln('Press any number bigger than "3" to go to main menu.');
(*626*)          Writeln;
(*627*)          Writeln('Press the respective number then press Enter.');
(*628*)          Readln(choice);
(*629*)          
(*630*)          Case choice of
(*631*)             1:View_RecordsDDC;
(*632*)             2:View_RecordsDPI;
(*633*)             3:View_RecordsDSGO;
(*634*)          end;
(*635*) 
(*636*)          mainmenu;    &lt;span style="color: Red;"&gt;{ Recursive call }&lt;/span&gt;
(*637*)       end;
(*638*) 
(*639*)       Procedure AboutWCMF;
(*640*)       {*************************************************
***********************
(*641*)       *This Procedure is used to give a brief synopsis about the WCMF *
(*642*)       **************************************************
**********************}
(*643*)       Var
(*644*)          Ans:char;
(*645*) 
(*646*)       Begin
(*647*)          Clrscr;
(*648*)          Assign(DDCDatabasefile,'MemberDatabase.dat');
(*649*)          {$I-}
(*650*)          Reset(DDCDatabasefile);
(*651*)             {$I+}     &lt;span style="color: Red;"&gt;{ Why does this procedure access a file? }&lt;/span&gt;
(*652*) 
(*653*)             Begin
(*654*)                Seek(DDCDatabasefile,count);
(*655*)                Read(DDCDatabasefile,DatabaseRecDDC);
(*656*) 
(*657*)                Writeln;
(*658*)                TextBackground(White);
(*659*)                Textcolor(black);
(*660*) 
(*661*)                GotoXY(8,2);
(*662*)                Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*663*)                Gotoxy(8,3);
(*664*)                Writeln ('º º');
(*665*)                Gotoxy(8,4);
(*666*)                Writeln ('º Welcome to the brief synopsis about the WCMF. º');
(*667*)                Gotoxy(8,5);
(*668*)                Writeln ('º Here you can view a brief history of the WCMF. º');
(*669*)                Gotoxy(8,6);
(*670*)                Writeln ('º Enjoy! º');
(*671*)                Gotoxy(8,7);
(*672*)                Writeln ('º º');
(*673*)                Gotoxy(8,8);
(*674*)                Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*675*) 
(*676*)                Writeln;
(*677*)                Gotoxy(9,10);
(*678*)                Writeln('The World Creole Music Festival also known as WCMF was');
(*679*)                GOTOXY(9,11);
(*680*)                Writeln('established in 1997 by the Dominica Festival Commision');
(*681*)                GOTOXY(9,12);
(*682*)                Writeln('during the Independence celebrations. Its main aim was');
(*683*)                GOTOXY(9,12);
(*684*)                Writeln('to increase the country revenue from stay over visitors');
(*685*)                GOTOXY(9,13);
(*686*)                Writeln('coming to the island for the celebration and also to ');
(*687*)                GOTOXY(9,14);
(*688*)                Writeln('further broaden Dominica tourism products and to promote');
(*689*)                GOTOXY(9,15);
(*690*)                Writeln('the islands creole music. The WCMF has been a great and ');
(*691*)                GOTOXY(9,16);
(*692*)                Writeln('never disappointing show since it has been established');
(*693*)                GOTOXY(9,17);
(*694*)                Writeln('15 years ago, and it is highly improbable for anything');
(*695*)                GOTOXY(9,18);
(*696*)                Writeln('to make it unsuccessful!');
(*697*)             end;
(*698*)          Close(DDCDatabasefile);
(*699*)          Writeln;
(*700*)          Textcolor(black);
(*701*)          GOTOXY(1,24);
(*702*)          Writeln('Press any letter except "g" to go back to the main menu');
(*703*)          Readln(Ans);
(*704*) 
(*705*)          If Ans = 'g' then
(*706*)          Begin
(*707*)             AboutWCMF;      &lt;span style="color: Red;"&gt;{ Why "begin .. end" for just one statement? }&lt;/span&gt;
(*708*)          end
(*709*)          else
(*710*)             Mainmenu;
(*711*)       end;
(*712*)       {*************************************************
***********************}
(*713*)       
(*714*)       {*************************************************
***********************}
(*715*)       Procedure exit;       &lt;span style="color: Red;"&gt;{ Do nothing procedure - not needed. 
                                           Name collides with standard Pascal procedure. }&lt;/span&gt;
(*716*)       {*************************************************
************************
(*717*)       *This Procedure is used merely to exit! *
(*718*)       **************************************************
***********************}
(*719*)       Begin
(*720*) 
(*721*)       end;
(*722*)       {*************************************************
***********************}
(*723*)       
(*724*)       {*************************************************
***********************}
(*725*)       Procedure Mainmenu;
(*726*)       {*************************************************
**************************
(*727*)       *This Procedure is used to view and select the variety of options available*
(*728*)       **************************************************
*************************}
(*729*)       Begin
(*730*)          clrscr;
(*731*)          Textcolor(black);
(*732*)          Textbackground(White);
(*733*) 
(*734*)          GotoXY(8,2);
(*735*)          Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*736*)          Gotoxy(8,3);
(*737*)          Writeln ('º º');
(*738*)          Gotoxy(8,4);
(*739*)          Writeln ('º Welcome to the Member database. It Provides features for º');
(*740*)          Gotoxy(8,5);
(*741*)          Writeln ('º people attending the festival from the diaspora. º');
(*742*)          Gotoxy(8,6);
(*743*)          Writeln ('º º');
(*744*)          Gotoxy(8,7);
(*745*)          Writeln ('º Enjoy! º');
(*746*)          Gotoxy(8,8);
(*747*)          Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*748*) 
(*749*)          GotoXY(24,11);
(*750*)          Writeln('1.Enter new Member into a database.');
(*751*)          GotoXY(24,13);
(*752*)          writeln('2.View members in their different groups.');
(*753*)          GotoXY(24,15);
(*754*)          Writeln('3.View the advertisement.');
(*755*)          GotoXY(24,17);
(*756*)          Writeln('4. View Grand totals.');
(*757*)          GotoXY(24,19);
(*758*)          Writeln('5.A brief history of WCMF. ');
(*759*)          GotoXY(24,21);
(*760*)          Writeln('6.Exit.');
(*761*) 
(*762*)          Textcolor(black);
(*763*)          GotoXY(32,60);
(*764*)          Textcolor(black + blink);
(*765*)          Writeln('Press the number of your choice , then press "Enter".');
(*766*)          GotoXY(70,25);
(*767*)          Readln(Choice);
(*768*)          Textcolor(blue);
(*769*)          Case choice of
(*770*)             1:ADD;
(*771*)             2:Viewing;
(*772*)             3:Advert;
(*773*)             4:GrandTotals;
(*774*)             5:AboutWCMF;
(*775*)             6:Exit;         &lt;span style="color: Red;"&gt;{ Try "6 : ;"}&lt;/span&gt;
(*776*)          end;
(*777*)       end;
(*778*) 
(*779*) Begin {Main program}
(*780*)    clrscr;
(*781*)    Viewmenu;
(*782*)    Mainmenu;    &lt;span style="color: Red;"&gt;{ Uh... }&lt;/span&gt;
(*783*) end.  {End of program &lt;span style="color: Red;"&gt;(* No closing "}" 
                              Not really needed here 
                              ( compiler ignores everything after "end." )
                              but its omission makes my auto
                              formatter unhappy. &lt;img src="http://www.programmersheaven.com/images/Community/frown.gif" width="15" height="15" alt="" /&gt;   *)&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427159/re-helpproject-crisis/#427159</guid>
      <pubDate>Wed, 01 Feb 2012 19:28:10 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Help(Project crisis)</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427160/re-helpproject-crisis/#427160</link>
      <description>&lt;pre class="sourcecode"&gt;
(*  1*) Program schoolSBA;
(*  2*) {This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}
(*  3*) 
(*  4*) uses crt, dos,graph;
(*  5*) 
(*  6*) Type
(*  7*)    MemberDatabaseDDC = record {declaration of record}
(*  8*)       Member_ID : string[10];
(*  9*)       Member_Name:String[30];
(* 10*)       Member_TicketPayment:integer;
(* 11*)       Advert:string;
(* 12*)    end;
(* 13*) 
(* 14*)    MemberDatabaseDPI=record
(* 15*)       Member_IDdpi : string[10];
(* 16*)       Member_Namedpi:String[30];
(* 17*)       Member_TicketPaymentdpi:integer;
(* 18*)    end;
(* 19*) 
(* 20*)    MemberDatabaseDSGO = record
(* 21*)       Member_IDdsgo : string[10];
(* 22*)       Member_Namedsgo:String[30];
(* 23*)       Member_TicketPaymentdsgo:integer;
(* 24*)    end;
(* 25*) 
(* 26*) var
(* 27*)    DDCDatabasefile : file of MemberDatabaseDDC;
(* 28*)    DatabaseRecDDC: MemberDatabaseDDC; {variable for DDC record}
(* 29*) 
(* 30*)    DPIDatabasefile: file of MemberDatabaseDPI;
(* 31*)    DatabaseRecDPI: MemberDatabaseDPI;{variable for DPI record}
(* 32*) 
(* 33*)    DSGODatabasefile : file of MemberDatabaseDSGO;
(* 34*)    DatabaseRecDSGO :MemberDatabaseDSGO; {variable for DSGO record}
(* 35*) 
(* 36*)    Choice, count,i: integer;
(* 37*) 
(* 38*)    Databasename : String;
(* 39*)    Var Gd, Gm,
(* 40*)    Radius, Grow, IncP, IncQ : Integer;
(* 41*)    DecrP, DecrQ : Boolean;
(* 42*) 
(* 43*)       Procedure Mainmenu; Forward;  &lt;span style="color: Red;"&gt;{ Get rid of recursive calls and you won't need this "forward". }&lt;/span&gt;
(* 44*)
(* 45*)       {*************************************************
(* 46*)       *This Procedure is used to display the Main Menu *
(* 47*)       *of the program. *
(* 48*)       **************************************************
}
(* 49*) 
(* 50*)       Procedure Viewmenu;
(* 51*)       {Procedure to display intro}
(* 52*)       Begin
(* 53*)          clrscr;
(* 54*) 
(* 55*)          TextColor(white);
(* 56*)          Textbackground(Black);
(* 57*)          Clrscr;
(* 58*)          GotoXY (1,4);
(* 59*)          WriteLn( 'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(* 60*)          WriteLn('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º');
(* 61*)          WriteLn('º º º º');
(* 62*)          WriteLn('º º º º');
(* 63*)          WriteLn('º º º º');
(* 64*)          WriteLn('º º º º');
(* 65*)          WriteLn('º º º º');
(* 66*)          WriteLn('º º º º');
(* 67*)          WriteLn('º º º º');
(* 68*)          WriteLn('º º º º');
(* 69*)          WriteLn('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼ º');
(* 70*)          WriteLn('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(* 71*)          GoToXY(23,23);
(* 72*) 
(* 73*)          GotoXY (16,6);
(* 74*)          Writeln('* Welcome to the Member database program.*');
(* 75*)          TextColor(Green);
(* 76*)          GotoXY(17,8);
(* 77*)          Writeln('This program was written by Michael L. Jarvis');
(* 78*)          GotoXY (17,10);
(* 79*)          writeln('a student of the Saint Mary`s Academy.');
(* 80*)          GotoXY(17,12);
(* 81*)          Writeln('Press "ENTER" to access the main menu.');
(* 82*)          readln;
(* 83*)       end;
(* 84*) 
(* 85*) 
(* 86*)       Function File_exist:integer;
(* 87*)       Begin
(* 88*)          clrscr;
(* 89*)          Assign(DDCdatabasefile,'Memberdatabase.dat');
(* 90*)          {$I-}
(* 91*)          Reset (DDCDatabasefile);
(* 92*)          {$I+}
(* 93*)          If IOResult&amp;lt;&amp;gt;0 then
(* 94*)          Rewrite(DDCDatabasefile);
(* 95*)          {$I+}
(* 96*)          File_Exist := IOResult;
(* 97*)          Close(DDCDatabasefile);
(* 98*)       end;
(* 99*) 
(*100*)       {*************************************************
**************************}
(*101*)       function nextrec(curr, n : longint) : longint ;
(*102*)       {This function pertains to the view procedures for DDC, DPI and DSGO}
(*103*) 
(*104*)       CONST
(*105*)          NUL = chr(0) ;
(*106*)          UP = chr(72) ; { UP arrow }
(*107*)          DOWN = chr(80) ; { DOWN arrow }
(*108*)          PGUP = chr(73) ;
(*109*)          PGDN = chr(81) ;
(*110*)          QUIT = chr(79) ; { "END" key }
(*111*)          KEYSET = [UP, DOWN, PGUP, PGDN, QUIT] ;
(*112*)          PGVAL = 10 ;
(*113*) 
(*114*)       var
(*115*)          key : char ;
(*116*) 
(*117*)       begin
(*118*)          while TRUE do begin { infinite loop }
(*119*)             key := readkey ;
(*120*)             if key = NUL then begin
(*121*)                key := readkey ;
(*122*)                case key of
(*123*)                   UP :     begin
(*124*)                               if curr &amp;lt; n then
(*125*)                                  curr := curr + 1 ;
(*126*)                               nextrec := curr ;
(*127*)                               exit
(*128*)                            end ;
(*129*)                   DOWN :   begin
(*130*)                               if curr &amp;gt; -1 then
(*131*)                                  curr := curr - 1 ;
(*132*)                               nextrec := curr ;
(*133*)                               exit
(*134*)                            end ;
(*135*)                   PGUP :   begin
(*136*)                               if curr + PGVAL &amp;lt;= n then
(*137*)                                  curr := curr + PGVAL ;
(*138*)                               nextrec := curr ;
(*139*)                               exit
(*140*)                            end ;
(*141*)                   PGDN :   begin
(*142*)                               if curr - PGVAL &amp;gt;= -1 then
(*143*)                                  curr := curr - PGVAL ;
(*144*)                               nextrec := curr ;
(*145*)                               exit
(*146*)                            end ;
(*147*)                   QUIT :   begin
(*148*)                               nextrec := -100 ;
(*149*)                               exit
(*150*)                            end
(*151*)                end { case }
(*152*)             end
(*153*)          end
(*154*)       end ;
(*155*) 
(*156*)       procedure advert;
(*157*)       {*************************************************
***********************
(*158*)       *This Procedure Provides a list of the bands which will be performing *
(*159*)       *at the 16th annual World Creole Music Festival. *
(*160*)       **************************************************
**********************}
(*161*)       var
(*162*)          ans:integer;
(*163*)       
(*164*)       Begin
(*165*)          Gd := Detect;
(*166*)          InitGraph(Gd, Gm, 'c:\tp\bgi');
(*167*) 
(*168*)          if GraphResult &amp;lt;&amp;gt; grOk then
(*169*)             Halt(1);
(*170*)          Randomize;
(*171*)          SetColor(White);
(*172*) 
(*173*)          OutTextXY(20,20,'On October 29th we have bands like Krosfyah, Beenie Man, Maxi Priest,');
(*174*)          OutTextXY(20,30,'Third World, Kassav, and Midnight Groovers!');
(*175*)          OutTextXY(25,60,'On October 30th Come see bands like Carimi, Beris Hammond,UB40');
(*176*)          OutTextXY(25,70,'Red Hot Flames, Grammacks and WCK.');
(*177*)          OutTextXY(30,85,'On October 31st Come see Tabou Combo, Swinging Starz, Triple K');
(*178*)          OutTextXY(30,95,'Nasio Fontaine, Sean Paul and Jah Cure.');
(*179*)          OutTextXY(40,210,'Press "Enter" to continue.');
(*180*)          Readln;
(*181*)          CloseGraph;
(*182*)          Mainmenu;    &lt;span style="color: Red;"&gt;{ Recursive call! }&lt;/span&gt;
(*183*)       end;
(*184*) 
(*185*)       {*************************************************
********************}
(*186*)       Procedure Add_MemberDDC;
(*187*)       {*************************************************
********************
(*188*)       *This Procedure is used to add members into the DDA database*
(*189*)       **************************************************
*******************}
(*190*)       BEGIN
(*191*)          clrscr;
(*192*) 
(*193*)          Assign(DDCDatabasefile,'MemberDatabase.datDDC');
(*194*)          {$I-}
(*195*)          Reset(DDCDatabasefile);
(*196*)             {$I+}
(*197*)             If IOResult &amp;lt;&amp;gt;0 then
(*198*)                Rewrite(DDCDatabasefile);
(*199*)             {$I+}     &lt;span style="color: Red;"&gt;{ Why repeat switch of 3 lines previous? }&lt;/span&gt;
(*200*)             Repeat
(*201*)                Textcolor(Black);
(*202*)                Textbackground(White);
(*203*)                GotoXY(23,8);
(*204*) 
(*205*)                Writeln('------------------------------------------------');
(*206*)                GotoXY(23,9);
(*207*)                Writeln('------------------------------------------------');
(*208*)                GotoXY(32,10);
(*209*)                Writeln(' Welcome to the DDC database. ');
(*210*)                GOTOXY(23,11);
(*211*)                Writeln(' ');
(*212*)                GOTOXY(23,11);
(*213*)                Writeln('----------------------------------------------- ');
(*214*)                Gotoxy(23,12);
(*215*)                Writeln('----------------------------------------------- ');
(*216*) 
(*217*)                Writeln;
(*218*)                Writeln('Enter the Member ID.');
(*219*)                readln(DatabaseRecDDC.Member_ID);
(*220*)                Writeln;
(*221*)                writeln('Enter the Member full name.');
(*222*)                Readln(DatabaseRecDDC.Member_Name);
(*223*)                Writeln;
(*224*)                Writeln('Enter the Member Ticket Price');
(*225*)                Readln(DatabaseRecDDC.Member_TicketPayment);
(*226*)                Writeln;
(*227*)                {I-}   &lt;span style="color: Red;"&gt;{ Why turn off error checking at this point?
                                     When is it turned back on?
                                     Do you have the switches of lines 199
                                     and 227 reversed? }&lt;/span&gt;
(*228*)             Until IOResult = 0;
(*229*)             seek(DDCDatabasefile,filesize(DDCDatabasefile));
(*230*)             Write(DDCDatabasefile,DatabaseRecDDC);
(*231*)             Write('Now there are ',FileSize(DDCdatabasefile),' records in the DDC Database ');
(*232*)             ReadLn;
(*233*)          Close(DDCDatabasefile);
(*234*)          Mainmenu;    &lt;span style="color: Red;"&gt;{ Recursive call! }&lt;/span&gt;
(*235*)       end;
(*236*) 
{*************************************************
***********************}
(*386*)       Procedure Add;
(*387*)       {*************************************************
************************
(*388*)       * This Procedure is used to ask the user which database he would like to *
(*389*)       * use to add records to the respective groups. *
(*390*)       **************************************************
***********************}
(*391*)       var
(*392*)          Ans : char;
(*393*)          choice:integer;
(*394*)       begin
(*395*)          clrscr;
(*396*) 
(*397*)          Textcolor(Black);
(*398*)          Textbackground(White);
(*399*)          GotoXY(8,2);
(*400*)          Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*401*)          Gotoxy(8,3);
(*402*)          Writeln ('º º');
(*403*)          Gotoxy(8,4);
(*404*)          Writeln ('º Welcome to the Add option of this database. º');
(*405*)          Gotoxy(8,5);
(*406*)          Writeln ('º Here you can add members in different groups . º');
(*407*)          Gotoxy(8,6);
(*408*)          Writeln ('º Enjoy! º');
(*409*)          Gotoxy(8,7);
(*410*)          Writeln ('º º');
(*411*)          Gotoxy(8,8);
(*412*)          Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*413*) 
(*414*)          WRITELN;
(*415*)          Writeln('Here you will choose which database you want to add someone to.');
(*416*)          Writeln;
(*417*)          Writeln('1-Add person to DDC database.');
(*418*)          Writeln('2-Add person to DPI database.');
(*419*)          Writeln('3-Add person to DSGO database.');
(*420*)          Writeln('Press any number more than "3" to go to main menu');
(*421*)          Writeln;
(*422*)          Writeln('Press the respective number then press Enter to continue.');
(*423*)          Readln(choice);
(*424*) 
(*425*)          case choice of
(*426*)             1:Add_MemberDDC;
(*427*)             2:Add_MemberDPI;
(*428*)             3:Add_MemberDSGO;
(*429*)          END;
(*430*) 
(*431*)          Readln;
(*432*)          Mainmenu;    &lt;span style="color: Red;"&gt;{ Recursive call }&lt;/span&gt;
(*433*)       end;
(*434*) 
(*435*)       {*************************************************
*************************}
(*436*)       Procedure View_RecordsDDC;
(*437*)       {*************************************************
**
(*438*)       * This Procedure is used to view the information *
(*439*)       * about the members in the DDC Database. *
(*440*)       **************************************************
*}
(*441*)       CONST
(*442*)          SIZE = 1 ; { max number or records to be displayed }
(*443*)       Var
(*444*)          Ans : INTEGER;
(*445*)          count, { loop counter }
(*446*)          n, { index of last record in database file }
(*447*)          curr : longint ; { index of current record in database file }
(*448*) 
(*449*)       Begin
(*450*)          Assign(DDCDatabasefile,'MemberDatabase.dat');
(*451*)          {$I-}
(*452*)          Reset(DDCDatabasefile);
(*453*)             {$I+}
(*454*)             n := filesize(DDCDatabasefile) - 1 ;
(*455*)             curr := 1 ; { default value }
(*456*) 
(*457*)             repeat
(*458*)                clrscr ;
(*459*)                For count := curr - (SIZE - 1) to curr do Begin
(*460*)                   if (count &amp;lt; 0) or (count &amp;gt; n) then
(*461*)                      continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
(*462*) 
(*463*)                   Seek(DDCDatabasefile,count);
(*464*)                   Read(DDCDatabasefile,DatabaseRecDDC);
(*465*)                   writeln;
(*466*)                   Textcolor(Black);
(*467*)                   Textbackground(White);
(*468*) 
(*469*)                   With DatabaseRecDDC do begin
(*470*)                      Writeln;
(*471*)                      writeln('Member Identification#:', Member_ID);
(*472*)                      writeln;
(*473*)                      writeln('name of Member: ', Member_Name);
(*474*)                      Writeln;
(*475*)                      Writeln;
(*476*)                      Writeln('Ticket Payment of member:', Member_TicketPayment);
(*477*)                      Textcolor(Black + blink);
(*478*)                      Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
(*479*)                      Writeln(' ***********');
(*480*)                   end
(*481*)                end;
(*482*)                curr := nextrec(curr, n)
(*483*)             until curr &amp;lt; -99 ;
(*484*)          close(DDCDatabasefile);
(*485*)       end;
(*486*)       {*************************************************
*********************}
(*487*) 
(*488*)       {*************************************************
**********************}
(*489*)       Procedure View_RecordsDPI;
(*490*)       {*************************************************
**
(*491*)       * This Procedure is used to view the information *
(*492*)       * about the members in the DDC Database. *
(*493*)       **************************************************
*}
(*494*)       CONST
(*495*)          SIZE = 1; { max number or records to be displayed }
(*496*)       Var
(*497*)          Ans : INTEGER;
(*498*)          count, { loop counter }
(*499*)          n, { index of last record in database file }
(*500*)          curr : longint ; { index of current record in database file }
(*501*) 
(*502*)       Begin
(*503*)          Assign(DPIDatabasefile,'MemberDatabase.dat');
(*504*)          {$I-}
(*505*)          Reset(DPIDatabasefile);
(*506*)             {$I+}
(*507*)             n := filesize(DPIDatabasefile) - 1 ;
(*508*)             curr := 1 ; { default value }
(*509*) 
(*510*)             repeat
(*511*)                clrscr ;
(*512*)                For count := curr - (SIZE - 1) to curr do Begin
(*513*)                   if (count &amp;lt; 0) or (count &amp;gt; n) then
(*514*)                      continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
(*515*) 
(*516*)                   Seek(DPIDatabasefile,count);
(*517*)                   Read(DPIDatabasefile,DatabaseRecDPI);
(*518*)                   writeln;
(*519*)                   Textcolor(Black);
(*520*)                   Textbackground(White);
(*521*) 
(*522*)                   with DatabaseRecDPI do begin
(*523*)                      Writeln;
(*524*)                      writeln('Member Identification#:', Member_IDdpi);
(*525*)                      writeln;
(*526*)                      writeln('name of Member: ', Member_Namedpi);
(*527*)                      Writeln;
(*528*)                      Writeln('Ticket Payment of member:', Member_TicketPaymentdpi);
(*529*)                      Writeln;
(*530*)                      Textcolor(Black + blink);
(*531*)                      Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
(*532*)                      Writeln('********************');
(*533*)                   end
(*534*)                end;
(*535*)                curr := nextrec(curr, n)
(*536*)             until curr &amp;lt; -99 ;
(*537*)          close(DPIDatabasefile);
(*538*)       end;
(*539*) 
(*540*)       {*************************************************
**********************}
(*541*)       Procedure View_RecordsDSGO;
(*542*)       {*************************************************
**
(*543*)       * This Procedure is used to view the information *
(*544*)       * about the members in the DDC Database. *
(*545*)       **************************************************
*}
(*546*)       CONST
(*547*)          SIZE = 1; { max number or records to be displayed }
(*548*)       Var
(*549*)          Ans : INTEGER;
(*550*)          count, { loop counter }
(*551*)          n, { index of last record in database file }
(*552*)          curr : longint ; { index of current record in database file }
(*553*) 
(*554*)       Begin
(*555*)          Assign(DSGODatabasefile,'MemberDatabase.dat');
(*556*)          {$I-}
(*557*)          Reset(DSGODatabasefile);
(*558*)             {$I+}
(*559*)             n := filesize(DSGODatabasefile) - 1 ;
(*560*)             curr := 1 ; { default value }
(*561*) 
(*562*)             repeat
(*563*)                clrscr ;
(*564*)                For count := curr - (SIZE - 1) to curr do Begin
(*565*)                   if (count &amp;lt; 0) or (count &amp;gt; n) then
(*566*)                      continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
(*567*) 
(*568*)                   Seek(DSGODatabasefile,count);
(*569*)                   Read(DSGODatabasefile,DatabaseRecDSGO);
(*570*)                   writeln;
(*571*)                   Textcolor(White);
(*572*)                   Textbackground(White);
(*573*) 
(*574*)                   With DatabaseRecDSGO do begin
(*575*)                      Writeln;
(*576*)                      writeln('Member Identification#:', Member_IDdsgo);
(*577*)                      writeln;
(*578*)                      writeln('name of Member: ', Member_Namedsgo);
(*579*)                      Writeln;
(*580*)                      Writeln('Ticket Payment of member:', Member_TicketPaymentdsgo);
(*581*)                      Writeln;
(*582*)                      Textcolor(Black + blink);
(*583*)                      Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
(*584*)                   end
(*585*)                end;
(*586*)                curr := nextrec(curr, n)
(*587*)             until curr &amp;lt; -99 ;
(*588*)          close(DSGODatabasefile);
(*589*)       end;
(*590*)       {*************************************************
**********************}
(*591*) 
(*592*)       {*************************************************
************************}
(*593*)       Procedure Viewing;
(*594*)       {*************************************************
************************
(*595*)       *This procedure is used to view the members in the different groups. *
(*596*)       **************************************************
***********************}
(*597*)       Var
(*598*)          Ans : char;
(*599*)          choice:Integer;
(*600*) 
(*601*)       Begin
(*602*)          clrscr;
(*603*)          GotoXY(8,2);
(*604*)          Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*605*)          Gotoxy(8,3);
(*606*)          Writeln ('º º');
(*607*)          Gotoxy(8,4);
(*608*)          Writeln ('º Welcome to the a Viewing option on this database. º');
(*609*)          Gotoxy(8,5);
(*610*)          Writeln ('º Here you can select which group to add members. º');
(*611*)          Gotoxy(8,6);
(*612*)          Writeln ('º Enjoy! º');
(*613*)          Gotoxy(8,7);
(*614*)          Writeln ('º º');
(*615*)          Gotoxy(8,8);
(*616*)          Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*617*) 
(*618*)          Writeln;
(*619*)          Writeln('Welcome to the View option of this program');
(*620*)          Writeln('Here you have to select a number to view members in their group.');
(*621*)          Writeln;
(*622*)          Writeln('1-View DDC members.');
(*623*)          Writeln('2-View DPI members.');
(*624*)          Writeln('3-View DSGO members.');
(*625*)          Writeln('Press any number bigger than "3" to go to main menu.');
(*626*)          Writeln;
(*627*)          Writeln('Press the respective number then press Enter.');
(*628*)          Readln(choice);
(*629*)          
(*630*)          Case choice of
(*631*)             1:View_RecordsDDC;
(*632*)             2:View_RecordsDPI;
(*633*)             3:View_RecordsDSGO;
(*634*)          end;
(*635*) 
(*636*)          mainmenu;    &lt;span style="color: Red;"&gt;{ Recursive call }&lt;/span&gt;
(*637*)       end;
(*638*) 
(*639*)       Procedure AboutWCMF;
(*640*)       {*************************************************
***********************
(*641*)       *This Procedure is used to give a brief synopsis about the WCMF *
(*642*)       **************************************************
**********************}
(*643*)       Var
(*644*)          Ans:char;
(*645*) 
(*646*)       Begin
(*647*)          Clrscr;
(*648*)          Assign(DDCDatabasefile,'MemberDatabase.dat');
(*649*)          {$I-}
(*650*)          Reset(DDCDatabasefile);
(*651*)             {$I+}     &lt;span style="color: Red;"&gt;{ Why does this procedure access a file? }&lt;/span&gt;
(*652*) 
(*653*)             Begin     &lt;span style="color: Red;"&gt;{ Why the block within a block? }&lt;/span&gt;
(*654*)                Seek(DDCDatabasefile,count);
(*655*)                Read(DDCDatabasefile,DatabaseRecDDC);
(*656*) 
(*657*)                Writeln;
(*658*)                TextBackground(White);
(*659*)                Textcolor(black);
(*660*) 
(*661*)                GotoXY(8,2);
(*662*)                Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*663*)                Gotoxy(8,3);
(*664*)                Writeln ('º º');
(*665*)                Gotoxy(8,4);
(*666*)                Writeln ('º Welcome to the brief synopsis about the WCMF. º');
(*667*)                Gotoxy(8,5);
(*668*)                Writeln ('º Here you can view a brief history of the WCMF. º');
(*669*)                Gotoxy(8,6);
(*670*)                Writeln ('º Enjoy! º');
(*671*)                Gotoxy(8,7);
(*672*)                Writeln ('º º');
(*673*)                Gotoxy(8,8);
(*674*)                Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*675*) 
(*676*)                Writeln;
(*677*)                Gotoxy(9,10);
(*678*)                Writeln('The World Creole Music Festival also known as WCMF was');
(*679*)                GOTOXY(9,11);
(*680*)                Writeln('established in 1997 by the Dominica Festival Commision');
(*681*)                GOTOXY(9,12);
(*682*)                Writeln('during the Independence celebrations. Its main aim was');
(*683*)                GOTOXY(9,12);
(*684*)                Writeln('to increase the country revenue from stay over visitors');
(*685*)                GOTOXY(9,13);
(*686*)                Writeln('coming to the island for the celebration and also to ');
(*687*)                GOTOXY(9,14);
(*688*)                Writeln('further broaden Dominica tourism products and to promote');
(*689*)                GOTOXY(9,15);
(*690*)                Writeln('the islands creole music. The WCMF has been a great and ');
(*691*)                GOTOXY(9,16);
(*692*)                Writeln('never disappointing show since it has been established');
(*693*)                GOTOXY(9,17);
(*694*)                Writeln('15 years ago, and it is highly improbable for anything');
(*695*)                GOTOXY(9,18);
(*696*)                Writeln('to make it unsuccessful!');
(*697*)             end;
(*698*)          Close(DDCDatabasefile);
(*699*)          Writeln;
(*700*)          Textcolor(black);
(*701*)          GOTOXY(1,24);
(*702*)          Writeln('Press any letter except "g" to go back to the main menu');
(*703*)          Readln(Ans);
(*704*) 
(*705*)          If Ans = 'g' then
(*706*)          Begin
(*707*)             AboutWCMF;      &lt;span style="color: Red;"&gt;{ Why "begin .. end" for just one statement? }&lt;/span&gt;
(*708*)          end
(*709*)          else
(*710*)             Mainmenu;
(*711*)       end;
(*712*)       {*************************************************
***********************}
(*713*)       
(*714*)       {*************************************************
***********************}
(*715*)       Procedure exit;       &lt;span style="color: Red;"&gt;{ Do nothing procedure - not needed. 
                                           Name collides with standard Pascal procedure. }&lt;/span&gt;
(*716*)       {*************************************************
************************
(*717*)       *This Procedure is used merely to exit! *
(*718*)       **************************************************
***********************}
(*719*)       Begin
(*720*) 
(*721*)       end;
(*722*)       {*************************************************
***********************}
(*723*)       
(*724*)       {*************************************************
***********************}
(*725*)       Procedure Mainmenu;
(*726*)       {*************************************************
**************************
(*727*)       *This Procedure is used to view and select the variety of options available*
(*728*)       **************************************************
*************************}
(*729*)       Begin
(*730*)          clrscr;
(*731*)          Textcolor(black);
(*732*)          Textbackground(White);
(*733*) 
(*734*)          GotoXY(8,2);
(*735*)          Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*736*)          Gotoxy(8,3);
(*737*)          Writeln ('º º');
(*738*)          Gotoxy(8,4);
(*739*)          Writeln ('º Welcome to the Member database. It Provides features for º');
(*740*)          Gotoxy(8,5);
(*741*)          Writeln ('º people attending the festival from the diaspora. º');
(*742*)          Gotoxy(8,6);
(*743*)          Writeln ('º º');
(*744*)          Gotoxy(8,7);
(*745*)          Writeln ('º Enjoy! º');
(*746*)          Gotoxy(8,8);
(*747*)          Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*748*) 
(*749*)          GotoXY(24,11);
(*750*)          Writeln('1.Enter new Member into a database.');
(*751*)          GotoXY(24,13);
(*752*)          writeln('2.View members in their different groups.');
(*753*)          GotoXY(24,15);
(*754*)          Writeln('3.View the advertisement.');
(*755*)          GotoXY(24,17);
(*756*)          Writeln('4. View Grand totals.');
(*757*)          GotoXY(24,19);
(*758*)          Writeln('5.A brief history of WCMF. ');
(*759*)          GotoXY(24,21);
(*760*)          Writeln('6.Exit.');
(*761*) 
(*762*)          Textcolor(black);
(*763*)          GotoXY(32,60);
(*764*)          Textcolor(black + blink);
(*765*)          Writeln('Press the number of your choice , then press "Enter".');
(*766*)          GotoXY(70,25);
(*767*)          Readln(Choice);
(*768*)          Textcolor(blue);
(*769*)          Case choice of
(*770*)             1:ADD;
(*771*)             2:Viewing;
(*772*)             3:Advert;
(*773*)             4:GrandTotals;
(*774*)             5:AboutWCMF;
(*775*)             6:Exit;         &lt;span style="color: Red;"&gt;{ Try "6 : ;"}&lt;/span&gt;
(*776*)          end;
(*777*)       end;
(*778*) 
(*779*) Begin {Main program}
(*780*)    clrscr;
(*781*)    Viewmenu;
(*782*)    Mainmenu;    &lt;span style="color: Red;"&gt;{ Uh... }&lt;/span&gt;
(*783*) end.  {End of program &lt;span style="color: Red;"&gt;(* No closing "}" 
                              Not really needed here 
                              ( compiler ignores everything after "end." )
                              but its omission makes my auto
                              formatter unhappy. &lt;img src="http://www.programmersheaven.com/images/Community/frown.gif" width="15" height="15" alt="" /&gt;   *)&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427160/re-helpproject-crisis/#427160</guid>
      <pubDate>Wed, 01 Feb 2012 19:35:59 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Getting rid of recursive calls</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427198/getting-rid-of-recursive-calls/#427198</link>
      <description>Forgive me for messing with your code but I really think some things need to be fixed before I can show you how to do some of the things you need to do.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
{&lt;span style="color: Red;"&gt;
   this modification of the program attempts to improve the code
   by eliminating recursive calls
&lt;/span&gt;}

Program schoolSBA;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}

uses crt ; (*, dos,graph; *)
{&lt;span style="color: Red;"&gt;
   "dos" and "graph" have been commented out.
   "dos" does not appear to be needed.
   I do not have "graph" so I have comment it out also and have substituted
   your previous version of "advert"
&lt;/span&gt;}

Type
   MemberDatabaseDDC = record {declaration of record}
      Member_ID : string[10];
      Member_Name:String[30];
      Member_TicketPayment:integer;
      Advert:string;
   end;

   MemberDatabaseDPI=record
      Member_IDdpi : string[10];
      Member_Namedpi:String[30];
      Member_TicketPaymentdpi:integer;
   end;

   MemberDatabaseDSGO = record
      Member_IDdsgo : string[10];
      Member_Namedsgo:String[30];
      Member_TicketPaymentdsgo:integer;
   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;

   Databasename : String;
   Var Gd, Gm,
   Radius, Grow, IncP, IncQ : Integer;
   DecrP, DecrQ : Boolean;

      {&lt;span style="color: Red;"&gt;
         the forward declaration for the procedure mainmenu
         was at this point.  it is eleminated as no longer needed
      &lt;/span&gt;}

      Procedure Viewmenu;
      {Procedure to display intro}
      {&lt;span style="color: Red;"&gt;
         this is a well written procedure
      &lt;/span&gt;}
      Begin
         clrscr;

         TextColor(white);
         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(17,8);
         Writeln('This program was written by Michael L. Jarvis');
         GotoXY (17,10);
         writeln('a student of the Saint Mary`s Academy.');
         GotoXY(17,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&amp;lt;&amp;gt;0 then
         Rewrite(DDCDatabasefile);
         {$I+}
         File_Exist := IOResult;
         Close(DDCDatabasefile);
      end;
      {*************************************************
**************************}
      
      function nextrec(curr, n : longint) : longint ;
      {This function pertains to the view procedures for DDC, DPI and DSGO}

      CONST
         NUL = chr(0) ;
         UP = chr(72) ; { UP arrow }
         DOWN = chr(80) ; { DOWN arrow }
         PGUP = chr(73) ;
         PGDN = chr(81) ;
         QUIT = chr(79) ; { "END" key }
         KEYSET = [UP, DOWN, PGUP, PGDN, QUIT] ;
         PGVAL = 10 ;

      var
         key : char ;

      begin
         while TRUE do begin { infinite loop }
            key := readkey ;
            if key = NUL then begin
               key := readkey ;
               case key of
                  UP :     begin
                              if curr &amp;lt; n then
                                 curr := curr + 1 ;
                              nextrec := curr ;
                              exit
                           end ;
                  DOWN :   begin
                              if curr &amp;gt; -1 then
                                 curr := curr - 1 ;
                              nextrec := curr ;
                              exit
                           end ;
                  PGUP :   begin
                              if curr + PGVAL &amp;lt;= n then
                                 curr := curr + PGVAL ;
                              nextrec := curr ;
                              exit
                           end ;
                  PGDN :   begin
                              if curr - PGVAL &amp;gt;= -1 then
                                 curr := curr - PGVAL ;
                              nextrec := curr ;
                              exit
                           end ;
                  QUIT :   begin
                              nextrec := -100 ;
                              exit
                           end
               end { case }
            end
         end
      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 ;
         textcolor(YELLOW) ;
            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') ;
            
            {[&lt;span style="color: Red;"&gt;
               Basically, this code exits the procedure if any letter other
               than "b" is entred via readln.  There is no need to re-do the
               procedure if we wish to remain.  Exiting can be done by simply
               "falling off the end"

            readln(ans) ;

            if ans = 'b' then

            begin

            advert ;
            end
            else
            mainmenu ;
            &lt;/span&gt;}
            repeat
               readln(ans) ;
               ans := upcase(ans) {&lt;span style="color: Red;"&gt; so it makes no difference 
                                    if ans is upper or lower case &lt;/span&gt;}
            until ans &amp;lt;&amp;gt; 'B' ;
         textcolor(WHITE) ;

      end ;
      {*************************************************
********************}
      
      Procedure Add_MemberDDC;
      {*************************************************
********************
      *This Procedure is used to add members into the DDA database*
      **************************************************
*******************}
      BEGIN
         clrscr;

         Assign(DDCDatabasefile,'MemberDatabase.datDDC');
         {$I-}
         Reset(DDCDatabasefile);
            {$I+}
            If IOResult &amp;lt;&amp;gt;0 then
               Rewrite(DDCDatabasefile);
            {$I+}
            Repeat
               Textcolor(Black);
               Textbackground(White);
               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 Ticket Price');
               Readln(DatabaseRecDDC.Member_TicketPayment);
               Writeln;
               {I-}
            Until IOResult = 0;
            seek(DDCDatabasefile,filesize(DDCDatabasefile));
            Write(DDCDatabasefile,DatabaseRecDDC);
            Write('Now there are ',FileSize(DDCdatabasefile),' records in the DDC Database ');
            ReadLn;
         Close(DDCDatabasefile);
         {&lt;span style="color: Red;"&gt;
         Mainmenu;      again simply "fall off the end"
                        - eliminate "Mainmenu"
         &lt;/span&gt;}
      end;
      {*************************************************
********************}
      
      Procedure Add_MemberDPI;
      {*************************************************
********************
      *This Procedure is used to add members into the DDA database*
      **************************************************
*******************}
      BEGIN
         clrscr;

         Assign(DPIDatabasefile,'MemberDatabase.datDPI');
         {$I-}
         Reset(DPIDatabasefile);
            {$I+}
            If IOResult &amp;lt;&amp;gt;0 then
               Rewrite(DPIDatabasefile);
            {$I+}
            Repeat
               Textcolor(Black);
               Textbackground(White);
               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_IDDPI);
               Writeln;
               Writeln('Enter the Member full name.');
               Readln(DatabaseRecDPI.Member_NameDPI);
               Writeln;
               Writeln('Enter the Member Ticket Price');
               Readln(DatabaseRecDPI.Member_TicketPaymentDPI);
               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);
         {&lt;span style="color: Red;"&gt; fall off the end &lt;/span&gt;}
      end;
      {*************************************************
********************}
      
      Procedure Add_MemberDSGO;
      {*************************************************
********************
      *This Procedure is used to add members into the DDA database*
      **************************************************
*******************}
      BEGIN
         clrscr;

         Assign(DSGODatabasefile,'MemberDatabase.datDSGO');
         {$I-}
         Reset(DSGODatabasefile);
            {$I+}
            If IOResult &amp;lt;&amp;gt;0 then
               Rewrite(DSGODatabasefile);
            {$I+}
            Repeat
               Textcolor(Black);
               Textbackground(White);
               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_IDDSGO);
               Writeln;
               Writeln('Enter the Member full name.');
               Readln(DatabaseRecDSGO.Member_NameDSGO);
               Writeln;
               Writeln('Enter the Member Ticket Price');
               Readln(DatabaseRecDSGO.Member_TicketPaymentDSGO);
               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);
         {&lt;span style="color: Red;"&gt; fall off the end &lt;/span&gt;}
      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;

      Begin
         begin
            clrscr;
            Textcolor(Black);
            Textbackground(White);
            GotoXY(8,2);
            Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
            Gotoxy(8,3);
            Writeln ('º º');
            Gotoxy(8,4);
            Writeln ('º Welcome to the Grand totals option on the database. º');
            Gotoxy(8,5);
            Writeln ('º Here you can view the members grand totals. º');
            Gotoxy(8,6);
            Writeln ('º Enjoy! º');
            Gotoxy(8,7);
            Writeln ('º º');
            Gotoxy(8,8);
            Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');

            Writeln(' The Total cost for DDC MEMBERS IS $3900.00 ');
            Writeln(' The total cost for DPI Members is $2620.00');
            Writeln(' The total cost for DSGO Members is $1260');
            Writeln(' The total cost for all the groups are $7780.00');
            Writeln;
            Writeln(' Press "s" to stay.');
            {&lt;span style="color: Red;"&gt;
                  exit is something other than "s" is pressed

            Readln(Ans);

            If ans = 's' then
            Begin
               GrandTotals;
            end
            Else
               Mainmenu;
            &lt;/span&gt;}
            repeat
               readln(ans) ;
               ans := upcase(ans)
            until ans &amp;lt;&amp;gt; 'S'
         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(Black);
         Textbackground(White);
         GotoXY(8,2);
         Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
         Gotoxy(8,3);
         Writeln ('º º');
         Gotoxy(8,4);
         Writeln ('º Welcome to the Add option of this database. º');
         Gotoxy(8,5);
         Writeln ('º Here you can add members in different groups . º');
         Gotoxy(8,6);
         Writeln ('º Enjoy! º');
         Gotoxy(8,7);
         Writeln ('º º');
         Gotoxy(8,8);
         Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');

         WRITELN;
         Writeln('Here you will choose which database you want to add someone to.');
         Writeln;
         Writeln('1-Add person to DDC database.');
         Writeln('2-Add person to DPI database.');
         Writeln('3-Add person to DSGO database.');
         Writeln('Press any number more than "3" to go to 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;
         END;

         Readln;
         {&lt;span style="color: Red;"&gt; fall off the end &lt;/span&gt;}
      end;
      {*************************************************
*************************}
      
      Procedure View_RecordsDDC;
      {*************************************************
**
      * This Procedure is used to view the information *
      * about the members in the DDC Database. *
      **************************************************
*}
      CONST
         SIZE = 1 ; { max number or records to be displayed }
      Var
         Ans : INTEGER;
         count, { loop counter }
         n, { index of last record in database file }
         curr : longint ; { index of current record in database file }

      Begin
         Assign(DDCDatabasefile,'MemberDatabase.dat');
         {$I-}
         Reset(DDCDatabasefile);
            {$I+}
            n := filesize(DDCDatabasefile) - 1 ;
            curr := 1 ; { default value }

            repeat
               clrscr ;
               For count := curr - (SIZE - 1) to curr do Begin
                  if (count &amp;lt; 0) or (count &amp;gt; n) then
                     continue ; { no record has index &amp;lt; 0 or &amp;gt; n }

                  Seek(DDCDatabasefile,count);
                  Read(DDCDatabasefile,DatabaseRecDDC);
                  writeln;
                  Textcolor(Black);
                  Textbackground(White);

                  With DatabaseRecDDC do begin
                     Writeln;
                     writeln('Member Identification#:', Member_ID);
                     writeln;
                     writeln('name of Member: ', Member_Name);
                     Writeln;
                     Writeln;
                     Writeln('Ticket Payment of member:', Member_TicketPayment);
                     Textcolor(Black + blink);
                     Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
                     Writeln(' ***********');
                  end
               end;
               curr := nextrec(curr, n)
            until curr &amp;lt; -99 ;
         close(DDCDatabasefile);
      end;
      {*************************************************
*********************}

      Procedure View_RecordsDPI;
      {*************************************************
**
      * This Procedure is used to view the information *
      * about the members in the DDC Database. *
      **************************************************
*}
      CONST
         SIZE = 1; { max number or records to be displayed }
      Var
         Ans : INTEGER;
         count, { loop counter }
         n, { index of last record in database file }
         curr : longint ; { index of current record in database file }

      Begin
         Assign(DPIDatabasefile,'MemberDatabase.dat');
         {$I-}
         Reset(DPIDatabasefile);
            {$I+}
            n := filesize(DPIDatabasefile) - 1 ;
            curr := 1 ; { default value }

            repeat
               clrscr ;
               For count := curr - (SIZE - 1) to curr do Begin
                  if (count &amp;lt; 0) or (count &amp;gt; n) then
                     continue ; { no record has index &amp;lt; 0 or &amp;gt; n }

                  Seek(DPIDatabasefile,count);
                  Read(DPIDatabasefile,DatabaseRecDPI);
                  writeln;
                  Textcolor(Black);
                  Textbackground(White);

                  with DatabaseRecDPI do begin
                     Writeln;
                     writeln('Member Identification#:', Member_IDdpi);
                     writeln;
                     writeln('name of Member: ', Member_Namedpi);
                     Writeln;
                     Writeln('Ticket Payment of member:', Member_TicketPaymentdpi);
                     Writeln;
                     Textcolor(Black + blink);
                     Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
                     Writeln('********************');
                  end
               end;
               curr := nextrec(curr, n)
            until curr &amp;lt; -99 ;
         close(DPIDatabasefile);
      end;
      {*************************************************
**********************}
      
      Procedure View_RecordsDSGO;
      {*************************************************
**
      * This Procedure is used to view the information *
      * about the members in the DDC Database. *
      **************************************************
*}
      CONST
         SIZE = 1; { max number or records to be displayed }
      Var
         Ans : INTEGER;
         count, { loop counter }
         n, { index of last record in database file }
         curr : longint ; { index of current record in database file }

      Begin
         Assign(DSGODatabasefile,'MemberDatabase.dat');
         {$I-}
         Reset(DSGODatabasefile);
            {$I+}
            n := filesize(DSGODatabasefile) - 1 ;
            curr := 1 ; { default value }

            repeat
               clrscr ;
               For count := curr - (SIZE - 1) to curr do Begin
                  if (count &amp;lt; 0) or (count &amp;gt; n) then
                     continue ; { no record has index &amp;lt; 0 or &amp;gt; n }

                  Seek(DSGODatabasefile,count);
                  Read(DSGODatabasefile,DatabaseRecDSGO);
                  writeln;
                  Textcolor(White);
                  Textbackground(White);

                  With DatabaseRecDSGO do begin
                     Writeln;
                     writeln('Member Identification#:', Member_IDdsgo);
                     writeln;
                     writeln('name of Member: ', Member_Namedsgo);
                     Writeln;
                     Writeln('Ticket Payment of member:', Member_TicketPaymentdsgo);
                     Writeln;
                     Textcolor(Black + blink);
                     Writeln('Press Up arrow to go up, Down arrow to go down and End to exit.');
                  end
               end;
               curr := nextrec(curr, n)
            until curr &amp;lt; -99 ;
         close(DSGODatabasefile);
      end;
      {*************************************************
**********************}

      Procedure Viewing;
      {*************************************************
************************
      *This procedure is used to view the members in the different groups. *
      **************************************************
***********************}
      Var
         Ans : char;
         choice:Integer;

      Begin
         clrscr;
         GotoXY(8,2);
         Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
         Gotoxy(8,3);
         Writeln ('º º');
         Gotoxy(8,4);
         Writeln ('º Welcome to the a Viewing option on this database. º');
         Gotoxy(8,5);
         Writeln ('º Here you can select which group to add members. º');
         Gotoxy(8,6);
         Writeln ('º Enjoy! º');
         Gotoxy(8,7);
         Writeln ('º º');
         Gotoxy(8,8);
         Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');

         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('1-View DDC members.');
         Writeln('2-View DPI members.');
         Writeln('3-View DSGO members.');
         Writeln('Press any number bigger than "3" to go to main menu.');
         Writeln;
         Writeln('Press the respective number then press Enter.');
         Readln(choice);
         
         Case choice of
            1:View_RecordsDDC;
            2:View_RecordsDPI;
            3:View_RecordsDSGO;
         end;
         {&lt;span style="color: Red;"&gt; fall off the end &lt;/span&gt;}
      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(White);
               Textcolor(black);

               GotoXY(8,2);
               Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
               Gotoxy(8,3);
               Writeln ('º º');
               Gotoxy(8,4);
               Writeln ('º Welcome to the brief synopsis about the WCMF. º');
               Gotoxy(8,5);
               Writeln ('º Here you can view a brief history of the WCMF. º');
               Gotoxy(8,6);
               Writeln ('º Enjoy! º');
               Gotoxy(8,7);
               Writeln ('º º');
               Gotoxy(8,8);
               Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');

               Writeln;
               Gotoxy(9,10);
               Writeln('The World Creole Music Festival also known as WCMF was');
               GOTOXY(9,11);
               Writeln('established in 1997 by the Dominica Festival Commision');
               GOTOXY(9,12);
               Writeln('during the Independence celebrations. Its main aim was');
               GOTOXY(9,12);
               Writeln('to increase the country revenue from stay over visitors');
               GOTOXY(9,13);
               Writeln('coming to the island for the celebration and also to ');
               GOTOXY(9,14);
               Writeln('further broaden Dominica tourism products and to promote');
               GOTOXY(9,15);
               Writeln('the islands creole music. The WCMF has been a great and ');
               GOTOXY(9,16);
               Writeln('never disappointing show since it has been established');
               GOTOXY(9,17);
               Writeln('15 years ago, and it is highly improbable for anything');
               GOTOXY(9,18);
               Writeln('to make it unsuccessful!');
            end;
         Close(DDCDatabasefile);
         Writeln;
         Textcolor(black);
         GOTOXY(1,24);
         Writeln('Press any letter except "g" to go back to the main menu');
         
         {&lt;span style="color: Red;"&gt;
               exit if something other than "g" is pressed         
               
         Readln(Ans);

         If Ans = 'g' then
         Begin
            AboutWCMF;
         end
         else
            Mainmenu;
         &lt;/span&gt;}
         repeat
            readln(ans) ;
            ans := upcase(ans)
         until ans &amp;lt;&amp;gt; 'G'
      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(black);
         Textbackground(White);

         GotoXY(8,2);
         Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
         Gotoxy(8,3);
         Writeln ('º º');
         Gotoxy(8,4);
         Writeln ('º Welcome to the Member database. It Provides features for º');
         Gotoxy(8,5);
         Writeln ('º people attending the festival from the diaspora. º');
         Gotoxy(8,6);
         Writeln ('º º');
         Gotoxy(8,7);
         Writeln ('º Enjoy! º');
         Gotoxy(8,8);
         Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');

         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(black);
         GotoXY(32,60);
         Textcolor(black + blink);
         Writeln('Press the number of your choice , then press "Enter".');
         GotoXY(70,25);
         Readln(Choice);
         Textcolor(blue);
         Case choice of
            1:ADD;
            2:Viewing;
            3:Advert;
            4:GrandTotals;
            5:AboutWCMF;
            6:Exit;
         end;
      end;

Begin {Main program}
   clrscr;
   Viewmenu;
   Mainmenu;
end.  {End of program}
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427198/getting-rid-of-recursive-calls/#427198</guid>
      <pubDate>Thu, 02 Feb 2012 22:39:54 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Getting rid of recursive calls</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427229/re-getting-rid-of-recursive-calls/#427229</link>
      <description>Thanks i'll do that to make it better...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427229/re-getting-rid-of-recursive-calls/#427229</guid>
      <pubDate>Sat, 04 Feb 2012 19:58:23 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Toward simpler, more elegant code</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427255/toward-simpler-more-elegant-code/#427255</link>
      <description>I was composing a post earlier this afternoon about &lt;strong&gt;grandtotals&lt;/strong&gt; but decided that we need to cover some other ground before I can adequately explain.  Below is some code I have extracted from your posts.  It is just as you posted except I have tried to restore some indentation (which I hope you are using) and omitted some blank lines.&lt;br /&gt;
&lt;br /&gt;
I want to discuss your procedure &lt;strong&gt;add&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
(*184*)       
(*185*) Procedure Add;
(*186*) {*************************************************
************************
(*187*) * This Procedure is used to ask the user which database he would like to *
(*188*) * use to add records to the respective groups. *
(*189*) **************************************************
***********************}
(*190*) var
(*191*)    Ans : char;
(*192*)    choice:integer;
(*193*) begin
(*194*)    clrscr;
(*195*) 
(*196*)    Textcolor(Black);
(*197*)    Textbackground(White);
(*198*)    GotoXY(8,2);
(*199*)    Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
(*200*)    Gotoxy(8,3);
(*201*)    Writeln ('º º');
(*202*)    Gotoxy(8,4);
(*203*)    Writeln ('º Welcome to the Add option of this database. º');
(*204*)    Gotoxy(8,5);
(*205*)    Writeln ('º Here you can add members in different groups . º');
(*206*)    Gotoxy(8,6);
(*207*)    Writeln ('º Enjoy! º');
(*208*)    Gotoxy(8,7);
(*209*)    Writeln ('º º');
(*210*)    Gotoxy(8,8);
(*211*)    Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
(*212*) 
(*213*)    WRITELN;
(*214*)    Writeln('Here you will choose which database you want to add someone to.');
(*215*)    Writeln;
(*216*)    Writeln('1-Add person to DDC database.');
(*217*)    Writeln('2-Add person to DPI database.');
(*218*)    Writeln('3-Add person to DSGO database.');
(*219*)    Writeln('Press any number more than "3" to go to main menu');
(*220*)    Writeln;
(*221*)    Writeln('Press the respective number then press Enter to continue.');
(*222*)    Readln(choice);
(*223*) 
(*224*)    case choice of
(*225*)       1:Add_MemberDDC;
(*226*)       2:Add_MemberDPI;
(*227*)       3:Add_MemberDSGO;
(*228*)    END;
(*229*) 
(*230*)    Readln;
(*231*)    Mainmenu;
(*232*)
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Note lines 225, 226, 227.  Depending on the value of &lt;strong&gt;choice&lt;/strong&gt; the program calls one of three procedures: &lt;strong&gt;Add_MemberDDC, Add_MemberDPI&lt;/strong&gt; or &lt;strong&gt;Add_MemberDSGO&lt;/strong&gt;.  Examination of these three procedures shows that they are nearly identical, the differences being which file the procedure accesses.  &lt;strong&gt;Add_MemberDDC&lt;/strong&gt; accesses file &lt;strong&gt;DDCDatabasefile&lt;/strong&gt;, &lt;strong&gt;Add_MemberDPI&lt;/strong&gt; accesses &lt;strong&gt;DPIDatabasefile&lt;/strong&gt; and &lt;strong&gt;Add_MemberDSGO&lt;/strong&gt; accesses &lt;strong&gt;DSGODatabasefile&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
This makes for a lot of duplicated code.  It would be great to have just one procedure that could handle all three files.  The problem with that is that all three files have different structures.  One solution to that is to simply write three different procedures (your solution).  This is a legitimate choice.  Another is to load the procedure with a lot of if..then..else statements (or case statements).  Very ugly and I don’t recommend it.&lt;br /&gt;
&lt;br /&gt;
My solution is to find a structure that satisfies the requirements of all three databases, such as ...&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Type
    MemberDatabase	= record
        Member_ID 		: string[10] ;
        Member_Name		: string[30] ;
        Member_TicketPayment	: integer ;
        Advert			: string
    End ;
&lt;/pre&gt;&lt;br /&gt;
The obvious objection to such an approach is that only the DDC database uses the field &lt;strong&gt;Advert&lt;/strong&gt;.  Its inclusion in the DPI and DSGO databases wastes hard disk space.  At one time, when hard disk space was expensive, that was a valid objection but today disk space is cheap enough (measured in gigibytes) that its expenditure is a small price to pay for simpler, more elegant code.&lt;br /&gt;
&lt;br /&gt;
If we adopt this approach then we need to declare the following.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Type
    {
        &lt;span style="color: Red;"&gt;this declaration is necessary because
        “file of MemberDatabase” cannot be passed 
        to a procedure or function.&lt;/span&gt;
    }
    Databasefiletype	= file of MemberDatabase ;

var
    DDCDatabasefile,
    DPIDatabasefile,
    DSGODatabasefile : Databasefiletype ;
&lt;/pre&gt;&lt;br /&gt;
and to make the assignments &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
begin { main program }
    assign(DDCDatabasefile, ‘memberdb.ddc’) ;
    assign(DPIDatabasefile, ‘memberdb.dpi’) ;
    assign(DSGODatabasefile, ‘memberdb.dsg’) ;

    viewmenu ;
    mainmenu
end.  { main program }
&lt;/pre&gt;&lt;br /&gt;
And now lines 224 .. 228 become&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
(*224*)    case choice of
(*225*)       1 : Add_Member (DDCDatabasefile, 'DDC') ;
(*226*)       2 : Add_Member (DPIDatabasefile, 'DPI') ;
(*227*)       3 : Add_Member (DSGODatabasefile, 'DSGO')
(*228*)    END;
&lt;/pre&gt;&lt;br /&gt;
and the single procedure &lt;strong&gt;Add_Member&lt;/strong&gt; becomes&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Procedure Add_Member (var databasefile : Databasefiletype ; db : string) ;
{*****************************************
 * This Procedure is used to add members *
 * into any database                     *
 *****************************************}
Var
    Databaserec : Memberdatabase ;
BEGIN
    {$I-}
        clrscr;

        Reset(Databasefile);
            If IOResult &amp;lt;&amp;gt;0 then
                Rewrite(Databasefile);

            Textcolor(Black);
            Textbackground(White);
            GotoXY(23,8);
            Writeln('------------------------------------------------');
            GotoXY(23,9);
            Writeln('------------------------------------------------');
            GotoXY(32,10);
            Writeln(' Welcome to the ', db, ' database. ');
            GOTOXY(23,11);
            Writeln(' ');
            GOTOXY(23,11);
            Writeln('-----------------------------------------------');
            Gotoxy(23,12);
            Writeln('----------------------------------------------- ');
            With databaserec do begin	 
                Writeln;
                write  ('Enter the Member ID.');
                readln(Member_ID);
                Writeln;
                write  ('Enter the Member full name.');
                Readln(Member_Name);
                Writeln;
                repeat
                    write  ('Enter the Member Ticket Price');
                    readln(Member_TicketPayment);
                    writeln
                until ioresult = 0      
            end ;

            seek(Databasefile, filesize(Databasefile));
            Write(Databasefile, DatabaseRec);
            Write('Now there are ', fileSize(databasefile), ' records in the ', db, ' Database ');
            ReadLn;
        Close(Databasefile)
    {$I+}
end ;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;br /&gt;
If I may be permitted a small digression and allowed to be Sherlock Holmes, I observe that lines 33, 85 and 136 all have the same typographical error.  From this I deduce that you wrote one of the procedures, then copied and pasted it twice and made the necessary modifications.&lt;br /&gt;
&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427255/toward-simpler-more-elegant-code/#427255</guid>
      <pubDate>Mon, 06 Feb 2012 00:26:33 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Grand Totals</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427263/grand-totals/#427263</link>
      <description>Here is the code for computing the totals.  I hope it is self explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
procedure grandtotals ;
{
**************************************************
****
* This Procedure is used to identify the totals that *
* each group pays and the total of all three groups. *
**************************************************
****
}

      function getcost (databasefile : databasefiletype) : integer ;
      {
         get total of payments from a database
      }
      var
         cost           : integer ;
         i,                            { loop index }
         n              : longint ;    { index of last record }
         databasefile   : databasefiletype ;
         databaserec    : memberdatabase ;

      begin { getcost }
         {$I-}
            cost := 0 ;

            reset(databasefile) ;
               if ioresult &amp;gt; 0 then begin    { cannot open database so ... }
                  getcost := 0 ;             { return zero ... }
                  exit                       { and bug out }
               end ;
               n := filesize(databasefile) - 1 ;
               for i := 0 to n do begin
                  seek(databasefile, i) ;
                  read(databasefile, databaserec) ;
                  with databaserec do
                     cost := cost + member_ticketpayment
               end ; 
            close(databasefile) ;

            getcost := cost
         {$I+}
      end ; { getcost }
var
   costddc,
   costdpi,
   costdsgo,
   total       : integer ;

begin
   {
      first do the work
   }
   costddc  := getcost(DDCdatabasefile) ;
   costdpi  := getcost(DPIdatabasefile) ;
   costdsgo := getcost(DSGOdatabasefile) ;
   total    := costddc + costdpi + costdsgo ;
   {
      then display results
   }
   clrscr ;
   gotoxy(12,2) ; write('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ»') ;
   gotoxy(12,3) ; write('º                                                     º') ;
   gotoxy(12,4) ; write('º Welcome to the Grand totals option on the database. º') ;
   gotoxy(12,5) ; write('º Here you can view the members grand totals.         º') ;
   gotoxy(12,6) ; write('º Enjoy!                                              º') ;
   gotoxy(12,7) ; write('º                                                     º') ;
   gotoxy(12,8) ; write('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ¼') ;

   gotoxy(17,10) ; writeln('The Total cost for DDC  Members is   $', costddc:5,  '.00') ;
   gotoxy(17,11) ; writeln('The total cost for DPI  Members is   $', costdpi:5,  '.00') ;
   gotoxy(17,12) ; writeln('The total cost for DSGO Members is   $', costdsgo:5, '.00') ;

   gotoxy(17,14) ; writeln('The total cost for all the groups is $', total:5,    '.00') ;

   gotoxy(17,17) ; writeln(' Press ENTER to return to the main menu. ') ;
   readln
end ;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427263/grand-totals/#427263</guid>
      <pubDate>Mon, 06 Feb 2012 18:53:11 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Getting rid of recursive calls</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427285/re-getting-rid-of-recursive-calls/#427285</link>
      <description>Hey actor this is pampaz but my normal account has a problem so i had to make a new one "pampaz02" so we can communicate on this one now.&lt;br /&gt;
&lt;br /&gt;
thanks for the advice about the assighns and the add procedure..i'll get to it as soon as possible because the deadline is due next month..&lt;br /&gt;
&lt;br /&gt;
i have a query..do i have to do the same thing for add for procedure viewing...like putting the assigns for viewing in the main menu?&lt;br /&gt;
&lt;br /&gt;
thanks &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427285/re-getting-rid-of-recursive-calls/#427285</guid>
      <pubDate>Tue, 07 Feb 2012 17:43:47 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Getting rid of recursive calls</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427286/re-getting-rid-of-recursive-calls/#427286</link>
      <description>Hey actor this is pampaz but my normal account has a problem so i had to make a new one "pampaz02" so we can communicate on this one now.&lt;br /&gt;
&lt;br /&gt;
thanks for the advice about the assighns and the add procedure..i'll get to it as soon as possible because the deadline is due next month..&lt;br /&gt;
&lt;br /&gt;
i have a query..do i have to do the same thing for add for procedure viewing...like putting the assigns for viewing in the main menu?&lt;br /&gt;
&lt;br /&gt;
thanks &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427286/re-getting-rid-of-recursive-calls/#427286</guid>
      <pubDate>Tue, 07 Feb 2012 17:46:10 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Two examples</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427308/two-examples/#427308</link>
      <description>: i have a query..do i have to do the same thing for add for procedure &lt;br /&gt;
: viewing...like putting the assigns for viewing in the main menu?&lt;br /&gt;
&lt;br /&gt;
Well, yes and no.  That's just the way &lt;em&gt;I&lt;/em&gt; would do it.  There's almost never just one way to do something.&lt;br /&gt;
&lt;br /&gt;
Here are a couple of examples to show what I was suggesting.  The first example shows how I envision the structure of your program.&lt;br /&gt;
&lt;br /&gt;
In lines 7, 8, 9 I define three string constants with the names of the three files.  In lines 22, 23, 24 I declare three "file variables."  In the main program, lines 168, 169, 170, the three variables are assigned to the three string constants.&lt;br /&gt;
&lt;br /&gt;
In line 50 the procedure &lt;strong&gt;add_member&lt;/strong&gt; receives the file variable from the calling procedure &lt;strong&gt;add&lt;/strong&gt;, lines 67, 68. 69.  In &lt;strong&gt;add_member&lt;/strong&gt; the file variable &lt;strong&gt;f&lt;/strong&gt; actually becomes the file variable &lt;strong&gt;ddc_file, dpi_file&lt;/strong&gt; or &lt;strong&gt;dsg_file&lt;/strong&gt;, depending on which line in &lt;strong&gt;add&lt;/strong&gt; called it.&lt;br /&gt;
&lt;br /&gt;
A similar thing happens in &lt;strong&gt;del_member, edit_member&lt;/strong&gt; and &lt;strong&gt;view_member&lt;/strong&gt;.   &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
{  1} {
{  2}    example of passing "file variables" to procedures
{  3} }
{  4} program schoolsba ;
{  5} 
{  6} CONST
{  7}    DDC_NAME = 'memberdb.ddc' ;
{  8}    DPI_NAME = 'memberdb.dpi' ;
{  9}    DSG_NAME = 'memberdb.dsg' ;
{ 10} 
{ 11} type
{ 12}    recordtype = record
{ 13}       id_number   : string[10] ;
{ 14}       name        : string[30] ;
{ 15}       payment     : integer ;
{ 16}       advert      : string
{ 17}    end ;
{ 18} 
{ 19}    filetype  = file of recordtype ;
{ 20} 
{ 21} var
{ 22}    ddc_file,
{ 23}    dpi_file,
{ 24}    dsg_file  : filetype ;
{ 25}       
{ 26}       procedure viewmenu ;
{ 27}       begin
{ 28}          {
{ 29}             your code here
{ 30}          }
{ 31}       end ;
{ 32}       
{ 33}       procedure mainmenu ;
{ 34} 
{ 35}             procedure advertisement ;
{ 36}             begin
{ 37}                {
{ 38}                   your code here
{ 39}                }
{ 40}             end ;
{ 41}             
{ 42}             procedure aboutwcmf ;
{ 43}             begin
{ 44}             {
{ 45}                your code here
{ 46}             }
{ 47}             end ;
{ 48}             
{ 49}             procedure add ;
{ 50}                   procedure add_member (var f : filetype) ;
{ 51}                   begin
{ 52}                      {
{ 53}                         your code here
{ 54}                      
{ 55}                         the file variable f points to whichever file
{ 56}                         was passed to the child procedure by the
{ 57}                         parent procedure.
{ 58}                      }
{ 59}                   end ;
{ 60}             begin
{ 61}                repeat
{ 62}                   {
{ 63}                      your code here
{ 64}                   }
{ 65}                   read (choice) ;
{ 66}                   case choice of
{ 67}                      1 : add_member(ddc_file) ;
{ 68}                      2 : add_member(dpi_file) ;
{ 69}                      3 : add_member(dsg_file)
{ 70}                   end { case }
{ 71}                until choice = 4
{ 72}             end ;
{ 73}             
{ 74}             procedure del ;
{ 75}                   procedure del_member (var f : filetype) ;
{ 76}                   begin
{ 77}                      {
{ 78}                         your code here
{ 79}                      
{ 80}                         the file variable f points to whichever file
{ 81}                         was passed to the child procedure by the
{ 82}                         parent procedure.
{ 83}                      }
{ 84}                   end ;
{ 85}             begin
{ 86}                repeat
{ 87}                   {
{ 88}                      your code here
{ 89}                   }
{ 90}                   read (choice) ;
{ 91}                   case choice of
{ 92}                      1 : del_member(ddc_file) ;
{ 93}                      2 : del_member(dpi_file) ;
{ 94}                      3 : del_member(dsg_file)
{ 95}                   end { case }
{ 96}                until choice = 4
{ 97}             end ;
{ 98}             
{ 99}             procedure edit ;
{100}                   procedure edit_member (var f : filetype) ;
{101}                   begin
{102}                      {
{103}                         your code here
{104}                      
{105}                         the file variable f points to whichever file
{106}                         was passed to the child procedure by the
{107}                         parent procedure.
{108}                      }
{109}                   end ;
{110}             begin
{111}                repeat
{112}                   {
{113}                      your code here
{114}                   }
{115}                   read (choice) ;
{116}                   case choice of
{117}                      1 : edit_member(ddc_file) ;
{118}                      2 : edit_member(dpi_file) ;
{119}                      3 : edit_member(dsg_file)
{120}                   end { case }
{121}                until choice = 4
{122}             end ;
{123} 
{124}             
{125}             procedure view ;
{126}                   procedure view_member (var f : filetype) ;
{127}                   begin
{128}                      {
{129}                         your code here
{130}                      
{131}                         the file variable f points to whichever file
{132}                         was passed to the child procedure by the
{133}                         parent procedure.
{134}                      }
{135}                   end ;
{136}             begin
{137}                repeat
{138}                   {
{139}                      your code here
{140}                   }
{141}                   read (choice) ;
{142}                   case choice of
{143}                      1 : view_member(ddc_file) ;
{144}                      2 : view_member(dpi_file) ;
{145}                      3 : view_member(dsg_file)
{146}                   end { case }
{147}                until choice = 4
{148}             end ;
{149} 
{150}       begin
{151}          repeat
{152}             {
{153}                your code here
{154}             }
{155}             read (choice) ;
{156}             case choice of
{157}                1 : advertisement ;
{158}                2 : aboutwcmf ;
{159}                3 : add ;   { to add records }
{160}                4 : del ;   { to delete records }
{161}                5 : edit ;  { to edit records }
{162}                6 : view    { to view records }
{163}             end { case }
{164}          until choice = 7
{165}       end ;
{166} 
{167} begin
{168}    assign (ddc_file, DDC_NAME) ;
{169}    assign (dpi_file, DPI_NAME) ;
{170}    assign (dsg_file, DSG_NAME) ;  
{171}    
{172}    viewmenu ;
{173}    mainmenu
{174} end.
&lt;/pre&gt;&lt;br /&gt;
In this second example the string constants are declared just as in the first but the file variables are declared in the individual procedures &lt;strong&gt;add_member, del_member, edit_member&lt;/strong&gt; and &lt;strong&gt;view_member&lt;/strong&gt;.  Instead the file names (the string constants) are each passed to the procedures and assigned in the procedures.  The file variables should also be declared inside the individual procedures.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
{  1} {
{  2}    example of passing "file names" to procedures
{  3} }
{  4} program schoolsba ;
{  5} 
{  6} CONST
{  7}    DDC_NAME = 'memberdb.ddc' ;
{  8}    DPI_NAME = 'memberdb.dpi' ;
{  9}    DSG_NAME = 'memberdb.dsg' ;
{ 10} 
{ 11} type
{ 12}    recordtype = record
{ 13}       id_number   : string[10] ;
{ 14}       name        : string[30] ;
{ 15}       payment     : integer ;
{ 16}       advert      : string
{ 17}    end ;
{ 18} 
{ 19}       procedure viewmenu ;
{ 20}       begin
{ 21}          {
{ 22}             your code here
{ 23}          }
{ 24}       end ;
{ 25}       
{ 26}       procedure mainmenu ;
{ 27} 
{ 28}             procedure advertisement ;
{ 29}             begin
{ 30}                {
{ 31}                   your code here
{ 32}                }
{ 33}             end ;
{ 34}             
{ 35}             procedure aboutwcmf ;
{ 36}             begin
{ 37}                {
{ 38}                   your code here
{ 39}                }
{ 40}             end ;
{ 41}             
{ 42}             procedure add ;
{ 43}                   procedure add_member (fname : string) ;
{ 44}                   var
{ 45}                      f : file of recordtype ;
{ 46}                   begin
{ 47}                      {
{ 48}                         the parent procedure passes a file name, rather than
{ 49}                         a file variable, to the child procedure.  The child
{ 50}                         procedure must have its own assign statement.
{ 51}                      }
{ 52}                      assign (f, fname) ;
{ 53}                      {
{ 54}                         your code here
{ 55}                      }
{ 56}                   end ;
{ 57}             begin
{ 58}                repeat
{ 59}                   {
{ 60}                      your code here
{ 61}                   }
{ 62}                   read (choice) ;
{ 63}                   case choice of
{ 64}                      1 : add_member(DDC_NAME) ;
{ 65}                      2 : add_member(DPI_NAME) ;
{ 66}                      3 : add_member(DSG_NAME)
{ 67}                   end { case }
{ 68}                until choice = 4
{ 69}             end ;
{ 70}             
{ 71}             procedure del ;
{ 72}                   procedure del_member (fname : string) ;
{ 73}                   var
{ 74}                      f : file of recordtype ;
{ 75}                   begin
{ 76}                      assign (f, fname) ;
{ 77}                      {
{ 78}                         your code here
{ 79}                      }
{ 80}                   end ;
{ 81}             begin
{ 82}                repeat
{ 83}                   {
{ 84}                      your code here
{ 85}                   }
{ 86}                   read (choice) ;
{ 87}                   case choice of
{ 88}                      1 : del_member(DDC_NAME) ;
{ 89}                      2 : del_member(DPI_NAME) ;
{ 90}                      3 : del_member(DSG_NAME)
{ 91}                   end { case }
{ 92}                until choice = 4
{ 93}             end ;
{ 94}             
{ 95}             procedure edit ;
{ 96}                   procedure edit_member (fname : string) ;
{ 97}                   var
{ 98}                      f : file of recordtype ;
{ 99}                   begin
{100}                      assign (f, fname) ;
{101}                      {
{102}                         your code here
{103}                      }
{104}                   end ;
{105}             begin
{106}                repeat
{107}                   {
{108}                      your code here
{109}                   }
{110}                   read (choice) ;
{111}                   case choice of
{112}                      1 : edit_member(DDC_NAME) ;
{113}                      2 : edit_member(DPI_NAME) ;
{114}                      3 : edit_member(DSG_NAME)
{115}                   end { case }
{116}                until choice = 4
{117}             end ;
{118}             
{119}             procedure view ;
{120}                   procedure view_member (fname : string) ;
{121}                   var
{122}                      f : file of recordtype ;
{123}                   begin
{124}                      assign (f, fname) ;
{125}                      {
{126}                         your code here
{127}                      }
{128}                   end ;
{129}             begin
{130}                repeat
{131}                   {
{132}                      your code here
{133}                   }
{134}                   read (choice) ;
{135}                   case choice of
{136}                      1 : view_member(DDC_NAME) ;
{137}                      2 : view_member(DPI_NAME) ;
{138}                      3 : view_member(DSG_NAME)
{139}                   end { case }
{140}                until choice = 4
{141}             end ;
{142} 
{143}       begin
{144}          repeat
{145}             {
{146}                your code here
{147}             }
{148}             read (choice) ;
{149}             case choice of
{150}                1 : advertisement ;
{151}                2 : aboutwcmf ;
{152}                3 : add ;   { to add records }
{153}                4 : del ;   { to delete records }
{154}                5 : edit ;  { to edit records }
{155}                6 : view    { to view records }
{156}             end { case }
{157}          until choice = 7
{158}       end ;
{159} 
{160} begin
{161}    viewmenu ;
{162}    mainmenu
{163} end.
&lt;/pre&gt;&lt;br /&gt;
Both ways have their advantages and disadvantages.  I prefer the first.&lt;br /&gt;
&lt;br /&gt;
In your program you write several on-screen messages such as:&lt;br /&gt;
&lt;br /&gt;
"Welcome to the DDC database"&lt;br /&gt;
&lt;br /&gt;
which works if you have a different procedure for each database.  But if you have only one procedure it has to know which file was passed to it.  The only way to do this is with a call such as&lt;br /&gt;
&lt;pre class="sourcecode"&gt;1 : add_member(ddc_file, DDC_NAME)&lt;/pre&gt;&lt;br /&gt;
and a procedure declaration like &lt;br /&gt;
&lt;pre class="sourcecode"&gt;procedure add_member(var f : filetype ; fname : string)&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Whichever method you use the message is written out with&lt;br /&gt;
&lt;pre class="sourcecode"&gt;write('Welcome to the ', copy(fname, 1, 3), ' database') ;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I hope all this is helping.  I sometimes get the feeling that I'm giving you more problems than help.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427308/two-examples/#427308</guid>
      <pubDate>Wed, 08 Feb 2012 16:24:23 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>goto</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427328/goto/#427328</link>
      <description>How does your teacher feel about the use of &lt;strong&gt;goto&lt;/strong&gt; statements?  Absolutely forbidden or allowed now and then?&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427328/goto/#427328</guid>
      <pubDate>Fri, 10 Feb 2012 16:37:11 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Grand Totals</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427329/re-grand-totals/#427329</link>
      <description>She wouldn't mind it at all ..she told us to use all the codes we can .."The more complex your program the more marks you get" so yeah, &lt;br /&gt;
&lt;br /&gt;
i watched the grand total codes...thanks alot..i tried to put it in my program and i changed the codes to my program's updated codes but by reset , when i put in my code it says file variable expected...im lost..&lt;br /&gt;
can i upload my updated program so you can eradicate the problem..also is it possible to have 3 "seeks","resets" because i have three databases and it wouldn't be nice if i can only work with one database..so tell me what  to do..&lt;br /&gt;
&lt;br /&gt;
thanks&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427329/re-grand-totals/#427329</guid>
      <pubDate>Fri, 10 Feb 2012 17:02:38 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Grand Totals</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427330/re-grand-totals/#427330</link>
      <description>She wouldn't mind it at all ..she told us to use all the codes we can .."The more complex your program the more marks you get" so yeah, &lt;br /&gt;
&lt;br /&gt;
i watched the grand total codes...thanks alot..i tried to put it in my program and i changed the codes to my program's updated codes but by reset , when i put in my code it says file variable expected...im lost..&lt;br /&gt;
can i upload my updated program so you can eradicate the problem..also is it possible to have 3 "seeks","resets" because i have three databases and it wouldn't be nice if i can only work with one database..so tell me what  to do..&lt;br /&gt;
&lt;br /&gt;
thanks&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427330/re-grand-totals/#427330</guid>
      <pubDate>Fri, 10 Feb 2012 17:04:28 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Grand Totals</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427331/re-grand-totals/#427331</link>
      <description>She wouldn't mind it at all ..she told us to use all the codes we can .."The more complex your program the more marks you get" so yeah, &lt;br /&gt;
&lt;br /&gt;
i watched the grand total codes...thanks alot..i tried to put it in my program and i changed the codes to my program's updated codes but by reset , when i put in my code it says file variable expected...im lost..&lt;br /&gt;
can i upload my updated program so you can eradicate the problem..also is it possible to have 3 "seeks","resets" because i have three databases and it wouldn't be nice if i can only work with one database..so tell me what  to do..&lt;br /&gt;
&lt;br /&gt;
thanks....&lt;br /&gt;
you have been a great help&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427331/re-grand-totals/#427331</guid>
      <pubDate>Fri, 10 Feb 2012 17:06:21 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: goto</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427332/re-goto/#427332</link>
      <description>Hey the teacher is ok with the goto's&lt;br /&gt;
&lt;br /&gt;
Listen i tried the recent codes you sent for me (1) the grandtotals (2) the codes for the &lt;strong&gt;add&lt;/strong&gt;. i tried them separately but there were errors in them...i changed my codes when you told  me about the "8.3" bit so instead of ddcdatabasefile i haave "ddcfile". I appreciate the advice on the add procedure but when i typed the codes they gave me errors. i put the codes under "type" "var" and also on the main menu the "assigns" but still no complete compilation..also the grandtotals...when i tried it before i tried the add codes you gave me..it was going good when i was changing the file names but when i reached the "reset" it told me "file variable expected" i tried allot of different codes but it still showed me the same thing. So i was wondering if you could just remove ,add,edit the codes in the bottom with my recently updated codes..&lt;br /&gt;
&lt;br /&gt;
For the add procedure it is very intelligent especially the fact  that it tells you which database you are adding but if it cannot work it's fine...and if it works how would i do the same for viewing the members or would it be necessary to have codes like that for viewing "i doubt" i said in my mind..&lt;br /&gt;
&lt;br /&gt;
About the recursive calls "mainmenu" the teacher said she doesn't want to see the source code after she leaves the "AboutWCMF" page and the "Advert" page so i left it there.&lt;br /&gt;
&lt;br /&gt;
I would appreciate it if you would check it out for me please..&lt;br /&gt;
thanks here it is , the updated one"different codes, plus yours"&lt;br /&gt;
&lt;br /&gt;
p.s it isn't compiling&lt;br /&gt;
&lt;br /&gt;
Program schoolSBA;&lt;br /&gt;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}&lt;br /&gt;
&lt;br /&gt;
uses crt, dos;&lt;br /&gt;
&lt;br /&gt;
Type&lt;br /&gt;
&lt;br /&gt;
Databasefiletype = file of Memberdatabase;{THIS IS WHERE THE ERRORS START..ENLIGHTENING ME PLEASE}&lt;br /&gt;
&lt;br /&gt;
Memberdatabase = record&lt;br /&gt;
DDCFILE,&lt;br /&gt;
DPIfile,&lt;br /&gt;
DSGOfile: DatabasefileTYPE;&lt;br /&gt;
Databasefiletype : file of Memberdatabase;&lt;br /&gt;
&lt;br /&gt;
MemberDatabaseDDC = record {declaration of record}&lt;br /&gt;
&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
   Member_TicketPayment:integer;&lt;br /&gt;
    Advert:string;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
 MemberDatabaseDPI=record&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
    Member_TicketPayment:integer;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
MemberDatabaseDSGO = record&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
    Member_TicketPayment:integer;&lt;br /&gt;
      end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
DDCFILE,&lt;br /&gt;
DPIfile,&lt;br /&gt;
DSGOfile:Databasefiletype;&lt;br /&gt;
 DDCfile : file of MemberDatabaseDDC;&lt;br /&gt;
  RecDDC: MemberDatabaseDDC; {variable for DDC record}&lt;br /&gt;
&lt;br /&gt;
  DPIfile: file of MemberDatabaseDPI;&lt;br /&gt;
  RecDPI: MemberDatabaseDPI;{variable for DPI record}&lt;br /&gt;
&lt;br /&gt;
  DSGOfile : file of MemberDatabaseDSGO;&lt;br /&gt;
  RecDSGO :MemberDatabaseDSGO; {variable for DSGO record}&lt;br /&gt;
&lt;br /&gt;
   Choice, count,i: integer;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu; Forward;&lt;br /&gt;
&lt;br /&gt;
{*************************************************&lt;br /&gt;
*This Procedure is used to display the Main Menu *&lt;br /&gt;
*of the program.                                 *&lt;br /&gt;
**************************************************
}&lt;br /&gt;
&lt;br /&gt;
{*************************************************
*********************}&lt;br /&gt;
Procedure info;&lt;br /&gt;
Begin&lt;br /&gt;
GotoXY(10,6);&lt;br /&gt;
Writeln('When viewing members, you will observe a blank');&lt;br /&gt;
Writeln('screen press the "up" or "down" arrow to start to view.');&lt;br /&gt;
END;&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
     Procedure Viewmenu;&lt;br /&gt;
    {Procedure to display intro}&lt;br /&gt;
   Begin&lt;br /&gt;
 clrscr;&lt;br /&gt;
  TextColor(BLACK);&lt;br /&gt;
  Textbackground(WHITE);&lt;br /&gt;
  Clrscr;&lt;br /&gt;
GotoXY (1,4);&lt;br /&gt;
 WriteLn(    'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
     WriteLn('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼ º');&lt;br /&gt;
     WriteLn('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
     GoToXY(23,23);&lt;br /&gt;
     GotoXY (16,6);&lt;br /&gt;
      Writeln('* Welcome to the Member database program.*');&lt;br /&gt;
          GotoXY(17,8);&lt;br /&gt;
          Writeln('This program was written by Michael L. Jarvis');&lt;br /&gt;
         GotoXY (17,10);&lt;br /&gt;
        writeln('a student of the Saint Mary`s Academy.');&lt;br /&gt;
      GotoXY(17,12);&lt;br /&gt;
    Writeln('Press "ENTER" to access the main menu.');&lt;br /&gt;
  readln;&lt;br /&gt;
 end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Function File_exist:integer;&lt;br /&gt;
    Begin&lt;br /&gt;
      clrscr;&lt;br /&gt;
        Assign(DDCfile,'DDCdatabase.dat');&lt;br /&gt;
          {$I-}&lt;br /&gt;
            Reset (DDCfile);&lt;br /&gt;
           {$I+}&lt;br /&gt;
        If IOResult&amp;lt;&amp;gt;0 then&lt;br /&gt;
          Rewrite(DDCfile);&lt;br /&gt;
        {$I+}&lt;br /&gt;
      File_Exist := IOResult;&lt;br /&gt;
Close(DDCfile);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**************************}&lt;br /&gt;
 function nextrec(curr, n : longint) : longint ;&lt;br /&gt;
{This function pertains to the view procedures for DDC, DPI and DSGO}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	   CONST&lt;br /&gt;
	      NUL      = chr(0) ;&lt;br /&gt;
	      UP       = chr(72) ;    { UP arrow }&lt;br /&gt;
	      DOWN     = chr(80) ;    { DOWN arrow }&lt;br /&gt;
	      PGUP     = chr(73) ;&lt;br /&gt;
	      PGDN     = chr(81) ;&lt;br /&gt;
	      QUIT     = chr(79) ;    { "END" key }&lt;br /&gt;
	      KEYSET   = [UP, DOWN, PGUP, PGDN, QUIT] ;&lt;br /&gt;
        PGVAL    = 10 ;&lt;br /&gt;
&lt;br /&gt;
	   var&lt;br /&gt;
	      key   : char ;&lt;br /&gt;
&lt;br /&gt;
	   begin&lt;br /&gt;
	      while TRUE do begin  { infinite loop }&lt;br /&gt;
	         key := readkey ;&lt;br /&gt;
	         if key = NUL then begin&lt;br /&gt;
             key := readkey ;&lt;br /&gt;
&lt;br /&gt;
	            case key of&lt;br /&gt;
	               UP    :  begin&lt;br /&gt;
	                           if curr &amp;lt; n then&lt;br /&gt;
	                              curr := curr + 1 ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               DOWN  :  begin&lt;br /&gt;
	                           if curr &amp;gt; -1 then&lt;br /&gt;
	                              curr := curr - 1 ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               PGUP  :  begin&lt;br /&gt;
	                           if curr + PGVAL &amp;lt;= n then&lt;br /&gt;
	                              curr := curr + PGVAL ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               PGDN  :  begin&lt;br /&gt;
	                           if curr - PGVAL &amp;gt;= -1 then&lt;br /&gt;
	                              curr := curr - PGVAL ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               QUIT  :  begin&lt;br /&gt;
	                           nextrec := -100 ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end&lt;br /&gt;
	            end { case }&lt;br /&gt;
	         end&lt;br /&gt;
	      end&lt;br /&gt;
	   end ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
    Procedure Add_Member (var databasefile : Databasefiletype ; db : string) ;&lt;br /&gt;
{*****************************************&lt;br /&gt;
 * This Procedure is used to add members *   { THIS IS THE CODES YOU GAVE ME ..NOTICE "DDCFILE" INSTEAD OF "DDCDATABASEFILE"&lt;br /&gt;
 * into any database                     *&lt;br /&gt;
 *****************************************}&lt;br /&gt;
Var&lt;br /&gt;
    Databaserec : Memberdatabase ;&lt;br /&gt;
BEGIN&lt;br /&gt;
    {$I-}&lt;br /&gt;
        clrscr;&lt;br /&gt;
&lt;br /&gt;
        Reset(Databasefile);&lt;br /&gt;
            If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
                Rewrite(Databasefile);&lt;br /&gt;
&lt;br /&gt;
            Textcolor(Black);&lt;br /&gt;
            Textbackground(White);&lt;br /&gt;
            GotoXY(23,8);&lt;br /&gt;
            Writeln('------------------------------------------------');&lt;br /&gt;
            GotoXY(23,9);&lt;br /&gt;
            Writeln('------------------------------------------------');&lt;br /&gt;
            GotoXY(32,10);&lt;br /&gt;
            Writeln(' Welcome to the ', db, ' database. ');&lt;br /&gt;
            GOTOXY(23,11);&lt;br /&gt;
            Writeln(' ');&lt;br /&gt;
            GOTOXY(23,11);&lt;br /&gt;
            Writeln('-----------------------------------------------');&lt;br /&gt;
            Gotoxy(23,12);&lt;br /&gt;
            Writeln('----------------------------------------------- ');&lt;br /&gt;
            With databaserec do begin	 &lt;br /&gt;
                Writeln;&lt;br /&gt;
                write  ('Enter the Member ID.');&lt;br /&gt;
                readln(Member_ID);&lt;br /&gt;
                Writeln;&lt;br /&gt;
                write  ('Enter the Member full name.');&lt;br /&gt;
                Readln(Member_Name);&lt;br /&gt;
                Writeln;&lt;br /&gt;
                repeat&lt;br /&gt;
                    write  ('Enter the Member Ticket Price');&lt;br /&gt;
                    readln(Member_TicketPayment);&lt;br /&gt;
                    writeln&lt;br /&gt;
                until ioresult = 0      &lt;br /&gt;
            end ;&lt;br /&gt;
&lt;br /&gt;
            seek(Databasefile, filesize(Databasefile));&lt;br /&gt;
            Write(Databasefile, DatabaseRec);&lt;br /&gt;
            Write('Now there are ', fileSize(databasefile), ' records in the ', db, ' Database ');&lt;br /&gt;
            ReadLn;&lt;br /&gt;
        Close(Databasefile)&lt;br /&gt;
    {$I+}&lt;br /&gt;
end ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
Procedure Add;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
* This Procedure is used to ask the user which database he would like to *&lt;br /&gt;
* use to add records to the respective groups.                           *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:integer;&lt;br /&gt;
begin&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
Textcolor(Black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the Add option of this database.         º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can add members in different groups .       º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
WRITELN;&lt;br /&gt;
Writeln('Here you will choose which database you want to add someone to.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('1-Add person to DDC database.');&lt;br /&gt;
Writeln('2-Add person to DPI database.');&lt;br /&gt;
Writeln('3-Add person to DSGO database.');&lt;br /&gt;
Writeln('Press any number more than "3" to go to main menu');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press Enter to continue.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
case choice of&lt;br /&gt;
&lt;br /&gt;
1:Add_Member(DDCFILE, 'DDC');&lt;br /&gt;
2:Add_Member(DPIfile, 'DPI');&lt;br /&gt;
3:Add_Member(DSGOfile,'DSGO');&lt;br /&gt;
&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Readln;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDDC;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1 ;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DDCfile,'DDCDatabase.dat');&lt;br /&gt;
	      {$I-}&lt;br /&gt;
	      Reset(DDCfile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DDCfile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
                    Info;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               Seek(DDCfile,count);&lt;br /&gt;
	               Read(DDCfile,RecDDC);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               With RECDDC do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_ID);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Name);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
                          Writeln('Ticket Payment of member:$', Member_TicketPayment);&lt;br /&gt;
                         Textcolor(Black);&lt;br /&gt;
                         GotoXY(30,16);&lt;br /&gt;
                         Writeln(' ....GO UP.');&lt;br /&gt;
                         GotoXY(30,18);&lt;br /&gt;
                         Writeln(' ....GO DOWN.');&lt;br /&gt;
                         Gotoxy(30,20);&lt;br /&gt;
                         Writeln('END....EXIT VIEW MODE.');&lt;br /&gt;
&lt;br /&gt;
	               end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DDCfile);&lt;br /&gt;
   end;&lt;br /&gt;
{*************************************************
*********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDPI;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DPIFILE,'DPIDatabase.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
	      Reset(DPIfile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DPIfile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
                    Info;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
               Seek(DPIfile,count);&lt;br /&gt;
	               Read(DPIfile,RecDPI);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               with RecDPI do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_ID);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Name);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln('Ticket Payment of member:$', Member_TicketPayment);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
                          Textcolor(Black);&lt;br /&gt;
                          GotoXY(30,16);&lt;br /&gt;
                         Writeln(' ....GO UP.');&lt;br /&gt;
                         GotoXY(30,18);&lt;br /&gt;
                         Writeln(' ....GO DOWN.');&lt;br /&gt;
                         Gotoxy(30,20);&lt;br /&gt;
                         Writeln('END....EXIT VIEW MODE.');&lt;br /&gt;
&lt;br /&gt;
                     end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DPIfile);&lt;br /&gt;
&lt;br /&gt;
	   end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DSGOfile,'DSGODATABASE.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
	      Reset(DSGOfile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DSGOfile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
                    info;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
                       ;&lt;br /&gt;
&lt;br /&gt;
               Seek(DSGOfile,count);&lt;br /&gt;
	               Read(DSGOfile,RecDSGO);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               With RecDSGO do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_ID);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Name);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln('Ticket Payment of member:$', Member_TicketPayment);&lt;br /&gt;
                          Writeln;&lt;br /&gt;
                         Textcolor(Black);&lt;br /&gt;
                         GotoXY(30,16);&lt;br /&gt;
                         Writeln(' ....GO UP.');&lt;br /&gt;
                         GotoXY(30,18);&lt;br /&gt;
                         Writeln(' ....GO DOWN.');&lt;br /&gt;
                         Gotoxy(30,20);&lt;br /&gt;
                         Writeln('END....EXIT VIEW MODE.');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                 end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DSGOfile);&lt;br /&gt;
&lt;br /&gt;
	   end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************}&lt;br /&gt;
&lt;br /&gt;
Procedure Viewing;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This procedure is used to view the members in the different groups.     *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:Integer;&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the a Viewing option on this database.   º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can select which group to add members.      º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Welcome to the View option of this program');&lt;br /&gt;
Writeln('Here you have to select a number to view members in their group.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('1-View DDC members.');&lt;br /&gt;
Writeln('2-View DPI members.');&lt;br /&gt;
Writeln('3-View DSGO members.');&lt;br /&gt;
Writeln('Press any number bigger than "3" to go to main menu.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press Enter.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Case choice of&lt;br /&gt;
1:View_RecordsDDC;&lt;br /&gt;
2:View_RecordsDPI;&lt;br /&gt;
3:View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
procedure advert;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure Provides a list of the bands which will be performing   *&lt;br /&gt;
*at the 16th annual World Creole Music Festival.                        *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
   var&lt;br /&gt;
   ans:integer;&lt;br /&gt;
&lt;br /&gt;
           Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
gotoxy(10,4);&lt;br /&gt;
Writeln('On October 29th we have bands like Krosfyah, Beenie Man, Maxi Priest,');&lt;br /&gt;
Gotoxy(11,6);&lt;br /&gt;
Writeln('Third World, Kassav, and Midnight Groovers!');&lt;br /&gt;
Gotoxy(12,8);&lt;br /&gt;
Writeln('On October 30th Come see bands like Carimi, Beris Hammond,UB40');&lt;br /&gt;
     Gotoxy(13,10);&lt;br /&gt;
     Writeln('Red Hot Flames, Grammacks and WCK.');&lt;br /&gt;
       Gotoxy(14,12);&lt;br /&gt;
       Writeln('On October 31st Come see Tabou Combo, Swinging Starz, Triple K');&lt;br /&gt;
        Gotoxy(15,14);&lt;br /&gt;
        Writeln('Nasio Fontaine, Sean Paul and Jah Cure.');&lt;br /&gt;
        Gotoxy(16,16);&lt;br /&gt;
        Writeln('Press "Enter" to continue.');&lt;br /&gt;
       Readln;&lt;br /&gt;
        Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************}&lt;br /&gt;
procedure grandtotals ;&lt;br /&gt;
{&lt;br /&gt;
**************************************************
****&lt;br /&gt;
* This Procedure is used to identify the totals that *&lt;br /&gt;
* each group pays and the total of all three groups. *&lt;br /&gt;
**************************************************
****&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
      function getcost (databasefile : databasefiletype) : integer ;&lt;br /&gt;
      {&lt;br /&gt;
         get total of payments from a database&lt;br /&gt;
      }&lt;br /&gt;
      var&lt;br /&gt;
         cost           : integer ;&lt;br /&gt;
         i,                            { loop index }&lt;br /&gt;
         n              : longint ;    { index of last record }&lt;br /&gt;
         databasefile   : databasefiletype ;&lt;br /&gt;
         databaserec    : memberdatabase ;&lt;br /&gt;
&lt;br /&gt;
      begin { getcost }&lt;br /&gt;
         {$I-}&lt;br /&gt;
            cost := 0 ;&lt;br /&gt;
&lt;br /&gt;
            reset(databasefile) ;&lt;br /&gt;
               if ioresult &amp;gt; 0 then begin    { cannot open database so ... }&lt;br /&gt;
                  getcost := 0 ;             { return zero ... }&lt;br /&gt;
                  exit                       { and bug out }&lt;br /&gt;
               end ;&lt;br /&gt;
               n := filesize(databasefile) - 1 ;&lt;br /&gt;
               for i := 0 to n do begin&lt;br /&gt;
                  seek(databasefile, i) ;&lt;br /&gt;
                  read(databasefile, databaserec) ;&lt;br /&gt;
                  with databaserec do&lt;br /&gt;
                     cost := cost + member_ticketpayment&lt;br /&gt;
               end ; &lt;br /&gt;
            close(databasefile) ;&lt;br /&gt;
&lt;br /&gt;
            getcost := cost&lt;br /&gt;
         {$I+}&lt;br /&gt;
      end ; { getcost }&lt;br /&gt;
var&lt;br /&gt;
   costddc,&lt;br /&gt;
   costdpi,&lt;br /&gt;
   costdsgo,&lt;br /&gt;
   total       : integer ;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
   {&lt;br /&gt;
      first do the work&lt;br /&gt;
   }&lt;br /&gt;
   costddc  := getcost(DDCdatabasefile) ;&lt;br /&gt;
   costdpi  := getcost(DPIdatabasefile) ;&lt;br /&gt;
   costdsgo := getcost(DSGOdatabasefile) ;&lt;br /&gt;
   total    := costddc + costdpi + costdsgo ;&lt;br /&gt;
   {&lt;br /&gt;
      then display results&lt;br /&gt;
   }&lt;br /&gt;
   clrscr ;&lt;br /&gt;
   gotoxy(12,2) ; write('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ»') ;&lt;br /&gt;
   gotoxy(12,3) ; write('º                                                     º') ;&lt;br /&gt;
   gotoxy(12,4) ; write('º Welcome to the Grand totals option on the database. º') ;&lt;br /&gt;
   gotoxy(12,5) ; write('º Here you can view the members grand totals.         º') ;&lt;br /&gt;
   gotoxy(12,6) ; write('º Enjoy!                                              º') ;&lt;br /&gt;
   gotoxy(12,7) ; write('º                                                     º') ;&lt;br /&gt;
   gotoxy(12,8) ; write('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ¼') ;&lt;br /&gt;
&lt;br /&gt;
   gotoxy(17,10) ; writeln('The Total cost for DDC  Members is   $', costddc:5,  '.00') ;&lt;br /&gt;
   gotoxy(17,11) ; writeln('The total cost for DPI  Members is   $', costdpi:5,  '.00') ;&lt;br /&gt;
   gotoxy(17,12) ; writeln('The total cost for DSGO Members is   $', costdsgo:5, '.00') ;&lt;br /&gt;
&lt;br /&gt;
   gotoxy(17,14) ; writeln('The total cost for all the groups is $', total:5,    '.00') ;&lt;br /&gt;
&lt;br /&gt;
   gotoxy(17,17) ; writeln(' Press ENTER to return to the main menu. ') ;&lt;br /&gt;
   readln&lt;br /&gt;
end ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure  AboutWCMF;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure is used to give a brief synopsis about the WCMF         *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 Var&lt;br /&gt;
  Ans:char;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    Clrscr;&lt;br /&gt;
  begin&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
 TextBackground(White);&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the brief synopsis about the WCMF.       º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can view a brief history of the WCMF.       º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Gotoxy(9,10);&lt;br /&gt;
Writeln('The World Creole Music Festival also known as WCMF was');&lt;br /&gt;
GOTOXY(9,11);&lt;br /&gt;
Writeln('established in 1997 by the Dominica Festival Commision');&lt;br /&gt;
GOTOXY(9,12);&lt;br /&gt;
Writeln('during the Independence celebrations. Its main aim was');&lt;br /&gt;
GOTOXY(9,12);&lt;br /&gt;
Writeln('to increase the country revenue from stay over visitors');&lt;br /&gt;
GOTOXY(9,13);&lt;br /&gt;
Writeln('coming to the island for the celebration and also to ');&lt;br /&gt;
GOTOXY(9,14);&lt;br /&gt;
Writeln('further broaden Dominica tourism products and to promote');&lt;br /&gt;
GOTOXY(9,15);&lt;br /&gt;
Writeln('the islands creole music. The WCMF has been a great and ');&lt;br /&gt;
GOTOXY(9,16);&lt;br /&gt;
Writeln('never disappointing  show since it has been established');&lt;br /&gt;
GOTOXY(9,17);&lt;br /&gt;
Writeln('15 years ago, and it is highly improbable for anything');&lt;br /&gt;
GOTOXY(9,18);&lt;br /&gt;
Writeln('to make it unsuccessful!');&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
   Textcolor(black);&lt;br /&gt;
   GOTOXY(1,24);&lt;br /&gt;
    Writeln('Press any letter except "g" to go back to the main menu');&lt;br /&gt;
     Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
      If Ans = 'g' then&lt;br /&gt;
&lt;br /&gt;
     Begin&lt;br /&gt;
    AboutWCMF; {When i took off the begin and end ,the procedure wouldn't open}&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
 Mainmenu;{ MAIN MENU IS NEEDED AS THE TEACHER DOESN'T WANT TO GO TO THE SOURCE CODE WHEN SHE EXIT'S IT.}&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure exit;&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This Procedure is used merely to exit!                                  *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
Begin&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**************************&lt;br /&gt;
*This Procedure is used to view and select the variety of options available*&lt;br /&gt;
**************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º Welcome  to the Member database. It Provides features for   º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º         people attending the festival from the diaspora.    º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                          Enjoy!                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
GotoXY(24,11);&lt;br /&gt;
Writeln('1.Enter new Member into a database.');&lt;br /&gt;
GotoXY(24,13);&lt;br /&gt;
writeln('2.View members in their different groups.');&lt;br /&gt;
GotoXY(24,15);&lt;br /&gt;
Writeln('3.View the advertisement.');&lt;br /&gt;
GotoXY(24,17);&lt;br /&gt;
Writeln('4. View Grand totals.');&lt;br /&gt;
GotoXY(24,19);&lt;br /&gt;
Writeln('5.A brief history of WCMF. ');&lt;br /&gt;
GotoXY(24,21);&lt;br /&gt;
Writeln('6.Exit.');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
GotoXY(32,60);&lt;br /&gt;
Textcolor(black + blink);&lt;br /&gt;
Writeln('Press the number of your choice , then press "Enter".');&lt;br /&gt;
GotoXY(70,25);&lt;br /&gt;
Readln(Choice);&lt;br /&gt;
Textcolor(blue);&lt;br /&gt;
Case choice of&lt;br /&gt;
&lt;br /&gt;
1:ADD;&lt;br /&gt;
2:Viewing;&lt;br /&gt;
3:Advert;&lt;br /&gt;
4:GrandTotals;&lt;br /&gt;
5:AboutWCMF;&lt;br /&gt;
6:Exit;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
Begin{Main program}&lt;br /&gt;
assign(DDCfile, 'memberdb.ddc');&lt;br /&gt;
Assign(DPIFile, 'memberdb.dpi');&lt;br /&gt;
assign(DSGOFILE,'memberdb.dsg');&lt;br /&gt;
{THIS IS YOUR CODE}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
clrscr;&lt;br /&gt;
Viewmenu;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end.{End of program}{This is just to tell the teacher the program has ended, she says we can keep it)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427332/re-goto/#427332</guid>
      <pubDate>Fri, 10 Feb 2012 18:49:19 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: goto</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427333/re-goto/#427333</link>
      <description>Hey the teacher is ok with the goto's&lt;br /&gt;
&lt;br /&gt;
Listen i tried the recent codes you sent for me (1) the grandtotals (2) the codes for the &lt;strong&gt;add&lt;/strong&gt;. i tried them separately but there were errors in them...i changed my codes when you told  me about the "8.3" bit so instead of ddcdatabasefile i haave "ddcfile". I appreciate the advice on the add procedure but when i typed the codes they gave me errors. i put the codes under "type" "var" and also on the main menu the "assigns" but still no complete compilation..also the grandtotals...when i tried it before i tried the add codes you gave me..it was going good when i was changing the file names but when i reached the "reset" it told me "file variable expected" i tried allot of different codes but it still showed me the same thing. So i was wondering if you could just remove ,add,edit the codes in the bottom with my recently updated codes..&lt;br /&gt;
&lt;br /&gt;
For the add procedure it is very intelligent especially the fact  that it tells you which database you are adding but if it cannot work it's fine...and if it works how would i do the same for viewing the members or would it be necessary to have codes like that for viewing "i doubt" i said in my mind..&lt;br /&gt;
&lt;br /&gt;
About the recursive calls "mainmenu" the teacher said she doesn't want to see the source code after she leaves the "AboutWCMF" page and the "Advert" page so i left it there.&lt;br /&gt;
&lt;br /&gt;
I would appreciate it if you would check it out for me please..&lt;br /&gt;
thanks here it is , the updated one"different codes, plus yours"&lt;br /&gt;
&lt;br /&gt;
p.s it isn't compiling&lt;br /&gt;
&lt;br /&gt;
Program schoolSBA;&lt;br /&gt;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}&lt;br /&gt;
&lt;br /&gt;
uses crt, dos;&lt;br /&gt;
&lt;br /&gt;
Type&lt;br /&gt;
&lt;br /&gt;
Databasefiletype = file of Memberdatabase;{THIS IS WHERE THE ERRORS START..ENLIGHTENING ME PLEASE}&lt;br /&gt;
&lt;br /&gt;
Memberdatabase = record&lt;br /&gt;
DDCFILE,&lt;br /&gt;
DPIfile,&lt;br /&gt;
DSGOfile: DatabasefileTYPE;&lt;br /&gt;
Databasefiletype : file of Memberdatabase;&lt;br /&gt;
&lt;br /&gt;
MemberDatabaseDDC = record {declaration of record}&lt;br /&gt;
&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
   Member_TicketPayment:integer;&lt;br /&gt;
    Advert:string;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
 MemberDatabaseDPI=record&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
    Member_TicketPayment:integer;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
MemberDatabaseDSGO = record&lt;br /&gt;
 Member_ID : string[10];&lt;br /&gt;
  Member_Name:String[30];&lt;br /&gt;
    Member_TicketPayment:integer;&lt;br /&gt;
      end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
DDCFILE,&lt;br /&gt;
DPIfile,&lt;br /&gt;
DSGOfile:Databasefiletype;&lt;br /&gt;
 DDCfile : file of MemberDatabaseDDC;&lt;br /&gt;
  RecDDC: MemberDatabaseDDC; {variable for DDC record}&lt;br /&gt;
&lt;br /&gt;
  DPIfile: file of MemberDatabaseDPI;&lt;br /&gt;
  RecDPI: MemberDatabaseDPI;{variable for DPI record}&lt;br /&gt;
&lt;br /&gt;
  DSGOfile : file of MemberDatabaseDSGO;&lt;br /&gt;
  RecDSGO :MemberDatabaseDSGO; {variable for DSGO record}&lt;br /&gt;
&lt;br /&gt;
   Choice, count,i: integer;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu; Forward;&lt;br /&gt;
&lt;br /&gt;
{*************************************************&lt;br /&gt;
*This Procedure is used to display the Main Menu *&lt;br /&gt;
*of the program.                                 *&lt;br /&gt;
**************************************************
}&lt;br /&gt;
&lt;br /&gt;
{*************************************************
*********************}&lt;br /&gt;
Procedure info;&lt;br /&gt;
Begin&lt;br /&gt;
GotoXY(10,6);&lt;br /&gt;
Writeln('When viewing members, you will observe a blank');&lt;br /&gt;
Writeln('screen press the "up" or "down" arrow to start to view.');&lt;br /&gt;
END;&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
     Procedure Viewmenu;&lt;br /&gt;
    {Procedure to display intro}&lt;br /&gt;
   Begin&lt;br /&gt;
 clrscr;&lt;br /&gt;
  TextColor(BLACK);&lt;br /&gt;
  Textbackground(WHITE);&lt;br /&gt;
  Clrscr;&lt;br /&gt;
GotoXY (1,4);&lt;br /&gt;
 WriteLn(    'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
     WriteLn('º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º º                                                                          º º');&lt;br /&gt;
     WriteLn('º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼ º');&lt;br /&gt;
     WriteLn('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
     GoToXY(23,23);&lt;br /&gt;
     GotoXY (16,6);&lt;br /&gt;
      Writeln('* Welcome to the Member database program.*');&lt;br /&gt;
          GotoXY(17,8);&lt;br /&gt;
          Writeln('This program was written by Michael L. Jarvis');&lt;br /&gt;
         GotoXY (17,10);&lt;br /&gt;
        writeln('a student of the Saint Mary`s Academy.');&lt;br /&gt;
      GotoXY(17,12);&lt;br /&gt;
    Writeln('Press "ENTER" to access the main menu.');&lt;br /&gt;
  readln;&lt;br /&gt;
 end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Function File_exist:integer;&lt;br /&gt;
    Begin&lt;br /&gt;
      clrscr;&lt;br /&gt;
        Assign(DDCfile,'DDCdatabase.dat');&lt;br /&gt;
          {$I-}&lt;br /&gt;
            Reset (DDCfile);&lt;br /&gt;
           {$I+}&lt;br /&gt;
        If IOResult&amp;lt;&amp;gt;0 then&lt;br /&gt;
          Rewrite(DDCfile);&lt;br /&gt;
        {$I+}&lt;br /&gt;
      File_Exist := IOResult;&lt;br /&gt;
Close(DDCfile);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**************************}&lt;br /&gt;
 function nextrec(curr, n : longint) : longint ;&lt;br /&gt;
{This function pertains to the view procedures for DDC, DPI and DSGO}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	   CONST&lt;br /&gt;
	      NUL      = chr(0) ;&lt;br /&gt;
	      UP       = chr(72) ;    { UP arrow }&lt;br /&gt;
	      DOWN     = chr(80) ;    { DOWN arrow }&lt;br /&gt;
	      PGUP     = chr(73) ;&lt;br /&gt;
	      PGDN     = chr(81) ;&lt;br /&gt;
	      QUIT     = chr(79) ;    { "END" key }&lt;br /&gt;
	      KEYSET   = [UP, DOWN, PGUP, PGDN, QUIT] ;&lt;br /&gt;
        PGVAL    = 10 ;&lt;br /&gt;
&lt;br /&gt;
	   var&lt;br /&gt;
	      key   : char ;&lt;br /&gt;
&lt;br /&gt;
	   begin&lt;br /&gt;
	      while TRUE do begin  { infinite loop }&lt;br /&gt;
	         key := readkey ;&lt;br /&gt;
	         if key = NUL then begin&lt;br /&gt;
             key := readkey ;&lt;br /&gt;
&lt;br /&gt;
	            case key of&lt;br /&gt;
	               UP    :  begin&lt;br /&gt;
	                           if curr &amp;lt; n then&lt;br /&gt;
	                              curr := curr + 1 ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               DOWN  :  begin&lt;br /&gt;
	                           if curr &amp;gt; -1 then&lt;br /&gt;
	                              curr := curr - 1 ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               PGUP  :  begin&lt;br /&gt;
	                           if curr + PGVAL &amp;lt;= n then&lt;br /&gt;
	                              curr := curr + PGVAL ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               PGDN  :  begin&lt;br /&gt;
	                           if curr - PGVAL &amp;gt;= -1 then&lt;br /&gt;
	                              curr := curr - PGVAL ;&lt;br /&gt;
	                           nextrec := curr ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end ;&lt;br /&gt;
	               QUIT  :  begin&lt;br /&gt;
	                           nextrec := -100 ;&lt;br /&gt;
	                           exit&lt;br /&gt;
	                        end&lt;br /&gt;
	            end { case }&lt;br /&gt;
	         end&lt;br /&gt;
	      end&lt;br /&gt;
	   end ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
    Procedure Add_Member (var databasefile : Databasefiletype ; db : string) ;&lt;br /&gt;
{*****************************************&lt;br /&gt;
 * This Procedure is used to add members *   { THIS IS THE CODES YOU GAVE ME ..NOTICE "DDCFILE" INSTEAD OF "DDCDATABASEFILE"&lt;br /&gt;
 * into any database                     *&lt;br /&gt;
 *****************************************}&lt;br /&gt;
Var&lt;br /&gt;
    Databaserec : Memberdatabase ;&lt;br /&gt;
BEGIN&lt;br /&gt;
    {$I-}&lt;br /&gt;
        clrscr;&lt;br /&gt;
&lt;br /&gt;
        Reset(Databasefile);&lt;br /&gt;
            If IOResult &amp;lt;&amp;gt;0 then&lt;br /&gt;
                Rewrite(Databasefile);&lt;br /&gt;
&lt;br /&gt;
            Textcolor(Black);&lt;br /&gt;
            Textbackground(White);&lt;br /&gt;
            GotoXY(23,8);&lt;br /&gt;
            Writeln('------------------------------------------------');&lt;br /&gt;
            GotoXY(23,9);&lt;br /&gt;
            Writeln('------------------------------------------------');&lt;br /&gt;
            GotoXY(32,10);&lt;br /&gt;
            Writeln(' Welcome to the ', db, ' database. ');&lt;br /&gt;
            GOTOXY(23,11);&lt;br /&gt;
            Writeln(' ');&lt;br /&gt;
            GOTOXY(23,11);&lt;br /&gt;
            Writeln('-----------------------------------------------');&lt;br /&gt;
            Gotoxy(23,12);&lt;br /&gt;
            Writeln('----------------------------------------------- ');&lt;br /&gt;
            With databaserec do begin	 &lt;br /&gt;
                Writeln;&lt;br /&gt;
                write  ('Enter the Member ID.');&lt;br /&gt;
                readln(Member_ID);&lt;br /&gt;
                Writeln;&lt;br /&gt;
                write  ('Enter the Member full name.');&lt;br /&gt;
                Readln(Member_Name);&lt;br /&gt;
                Writeln;&lt;br /&gt;
                repeat&lt;br /&gt;
                    write  ('Enter the Member Ticket Price');&lt;br /&gt;
                    readln(Member_TicketPayment);&lt;br /&gt;
                    writeln&lt;br /&gt;
                until ioresult = 0      &lt;br /&gt;
            end ;&lt;br /&gt;
&lt;br /&gt;
            seek(Databasefile, filesize(Databasefile));&lt;br /&gt;
            Write(Databasefile, DatabaseRec);&lt;br /&gt;
            Write('Now there are ', fileSize(databasefile), ' records in the ', db, ' Database ');&lt;br /&gt;
            ReadLn;&lt;br /&gt;
        Close(Databasefile)&lt;br /&gt;
    {$I+}&lt;br /&gt;
end ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
Procedure Add;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
* This Procedure is used to ask the user which database he would like to *&lt;br /&gt;
* use to add records to the respective groups.                           *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:integer;&lt;br /&gt;
begin&lt;br /&gt;
clrscr;&lt;br /&gt;
&lt;br /&gt;
Textcolor(Black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the Add option of this database.         º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can add members in different groups .       º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
WRITELN;&lt;br /&gt;
Writeln('Here you will choose which database you want to add someone to.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('1-Add person to DDC database.');&lt;br /&gt;
Writeln('2-Add person to DPI database.');&lt;br /&gt;
Writeln('3-Add person to DSGO database.');&lt;br /&gt;
Writeln('Press any number more than "3" to go to main menu');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press Enter to continue.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
case choice of&lt;br /&gt;
&lt;br /&gt;
1:Add_Member(DDCFILE, 'DDC');&lt;br /&gt;
2:Add_Member(DPIfile, 'DPI');&lt;br /&gt;
3:Add_Member(DSGOfile,'DSGO');&lt;br /&gt;
&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Readln;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDDC;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1 ;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DDCfile,'DDCDatabase.dat');&lt;br /&gt;
	      {$I-}&lt;br /&gt;
	      Reset(DDCfile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DDCfile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
                    Info;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               Seek(DDCfile,count);&lt;br /&gt;
	               Read(DDCfile,RecDDC);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               With RECDDC do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_ID);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Name);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
                          Writeln('Ticket Payment of member:$', Member_TicketPayment);&lt;br /&gt;
                         Textcolor(Black);&lt;br /&gt;
                         GotoXY(30,16);&lt;br /&gt;
                         Writeln(' ....GO UP.');&lt;br /&gt;
                         GotoXY(30,18);&lt;br /&gt;
                         Writeln(' ....GO DOWN.');&lt;br /&gt;
                         Gotoxy(30,20);&lt;br /&gt;
                         Writeln('END....EXIT VIEW MODE.');&lt;br /&gt;
&lt;br /&gt;
	               end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DDCfile);&lt;br /&gt;
   end;&lt;br /&gt;
{*************************************************
*********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDPI;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DPIFILE,'DPIDatabase.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
	      Reset(DPIfile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DPIfile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
                    Info;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
&lt;br /&gt;
               Seek(DPIfile,count);&lt;br /&gt;
	               Read(DPIfile,RecDPI);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               with RecDPI do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_ID);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Name);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln('Ticket Payment of member:$', Member_TicketPayment);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
                          Textcolor(Black);&lt;br /&gt;
                          GotoXY(30,16);&lt;br /&gt;
                         Writeln(' ....GO UP.');&lt;br /&gt;
                         GotoXY(30,18);&lt;br /&gt;
                         Writeln(' ....GO DOWN.');&lt;br /&gt;
                         Gotoxy(30,20);&lt;br /&gt;
                         Writeln('END....EXIT VIEW MODE.');&lt;br /&gt;
&lt;br /&gt;
                     end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DPIfile);&lt;br /&gt;
&lt;br /&gt;
	   end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**&lt;br /&gt;
*  This Procedure is used to view the information  *&lt;br /&gt;
*  about the members in the DDC Database.          *&lt;br /&gt;
**************************************************
*}&lt;br /&gt;
	   CONST&lt;br /&gt;
	      SIZE  = 1;    { max number or records to be displayed }&lt;br /&gt;
   Var&lt;br /&gt;
	      Ans   : INTEGER;&lt;br /&gt;
      count,            { loop counter }&lt;br /&gt;
	      n,                { index of last record in database file }&lt;br /&gt;
	      curr  : longint ; { index of current record in database file }&lt;br /&gt;
&lt;br /&gt;
	   Begin&lt;br /&gt;
	      Assign(DSGOfile,'DSGODATABASE.dat');&lt;br /&gt;
       {$I-}&lt;br /&gt;
	      Reset(DSGOfile);&lt;br /&gt;
      {$I+}&lt;br /&gt;
         n     := filesize(DSGOfile) - 1 ;&lt;br /&gt;
         curr  := 1 ;   { default value }&lt;br /&gt;
&lt;br /&gt;
	         repeat&lt;br /&gt;
	            clrscr ;&lt;br /&gt;
                    info;&lt;br /&gt;
	            For count := curr - (SIZE - 1) to curr do Begin&lt;br /&gt;
	               if (count &amp;lt; 0) or (count &amp;gt; n) then&lt;br /&gt;
	                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }&lt;br /&gt;
                       ;&lt;br /&gt;
&lt;br /&gt;
               Seek(DSGOfile,count);&lt;br /&gt;
	               Read(DSGOfile,RecDSGO);&lt;br /&gt;
	               writeln;&lt;br /&gt;
	               Textcolor(Black);&lt;br /&gt;
	               Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
	               With RecDSGO do begin&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  writeln('Member Identification#:', Member_ID);&lt;br /&gt;
	                  writeln;&lt;br /&gt;
	                  writeln('name of Member: ', Member_Name);&lt;br /&gt;
	                  Writeln;&lt;br /&gt;
	                  Writeln('Ticket Payment of member:$', Member_TicketPayment);&lt;br /&gt;
                          Writeln;&lt;br /&gt;
                         Textcolor(Black);&lt;br /&gt;
                         GotoXY(30,16);&lt;br /&gt;
                         Writeln(' ....GO UP.');&lt;br /&gt;
                         GotoXY(30,18);&lt;br /&gt;
                         Writeln(' ....GO DOWN.');&lt;br /&gt;
                         Gotoxy(30,20);&lt;br /&gt;
                         Writeln('END....EXIT VIEW MODE.');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                 end&lt;br /&gt;
	            end;&lt;br /&gt;
	            curr := nextrec(curr, n)&lt;br /&gt;
	         until curr &amp;lt; -99 ;&lt;br /&gt;
	      close(DSGOfile);&lt;br /&gt;
&lt;br /&gt;
	   end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************}&lt;br /&gt;
&lt;br /&gt;
Procedure Viewing;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This procedure is used to view the members in the different groups.     *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Var&lt;br /&gt;
Ans : char;&lt;br /&gt;
choice:Integer;&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the a Viewing option on this database.   º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can select which group to add members.      º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Welcome to the View option of this program');&lt;br /&gt;
Writeln('Here you have to select a number to view members in their group.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('1-View DDC members.');&lt;br /&gt;
Writeln('2-View DPI members.');&lt;br /&gt;
Writeln('3-View DSGO members.');&lt;br /&gt;
Writeln('Press any number bigger than "3" to go to main menu.');&lt;br /&gt;
Writeln;&lt;br /&gt;
Writeln('Press the respective number then press Enter.');&lt;br /&gt;
Readln(choice);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Case choice of&lt;br /&gt;
1:View_RecordsDDC;&lt;br /&gt;
2:View_RecordsDPI;&lt;br /&gt;
3:View_RecordsDSGO;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
 mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
procedure advert;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure Provides a list of the bands which will be performing   *&lt;br /&gt;
*at the 16th annual World Creole Music Festival.                        *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
   var&lt;br /&gt;
   ans:integer;&lt;br /&gt;
&lt;br /&gt;
           Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
gotoxy(10,4);&lt;br /&gt;
Writeln('On October 29th we have bands like Krosfyah, Beenie Man, Maxi Priest,');&lt;br /&gt;
Gotoxy(11,6);&lt;br /&gt;
Writeln('Third World, Kassav, and Midnight Groovers!');&lt;br /&gt;
Gotoxy(12,8);&lt;br /&gt;
Writeln('On October 30th Come see bands like Carimi, Beris Hammond,UB40');&lt;br /&gt;
     Gotoxy(13,10);&lt;br /&gt;
     Writeln('Red Hot Flames, Grammacks and WCK.');&lt;br /&gt;
       Gotoxy(14,12);&lt;br /&gt;
       Writeln('On October 31st Come see Tabou Combo, Swinging Starz, Triple K');&lt;br /&gt;
        Gotoxy(15,14);&lt;br /&gt;
        Writeln('Nasio Fontaine, Sean Paul and Jah Cure.');&lt;br /&gt;
        Gotoxy(16,16);&lt;br /&gt;
        Writeln('Press "Enter" to continue.');&lt;br /&gt;
       Readln;&lt;br /&gt;
        Mainmenu;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{*************************************************
********************}&lt;br /&gt;
procedure grandtotals ;&lt;br /&gt;
{&lt;br /&gt;
**************************************************
****&lt;br /&gt;
* This Procedure is used to identify the totals that *&lt;br /&gt;
* each group pays and the total of all three groups. *&lt;br /&gt;
**************************************************
****&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
      function getcost (databasefile : databasefiletype) : integer ;&lt;br /&gt;
      {&lt;br /&gt;
         get total of payments from a database&lt;br /&gt;
      }&lt;br /&gt;
      var&lt;br /&gt;
         cost           : integer ;&lt;br /&gt;
         i,                            { loop index }&lt;br /&gt;
         n              : longint ;    { index of last record }&lt;br /&gt;
         databasefile   : databasefiletype ;&lt;br /&gt;
         databaserec    : memberdatabase ;&lt;br /&gt;
&lt;br /&gt;
      begin { getcost }&lt;br /&gt;
         {$I-}&lt;br /&gt;
            cost := 0 ;&lt;br /&gt;
&lt;br /&gt;
            reset(databasefile) ;&lt;br /&gt;
               if ioresult &amp;gt; 0 then begin    { cannot open database so ... }&lt;br /&gt;
                  getcost := 0 ;             { return zero ... }&lt;br /&gt;
                  exit                       { and bug out }&lt;br /&gt;
               end ;&lt;br /&gt;
               n := filesize(databasefile) - 1 ;&lt;br /&gt;
               for i := 0 to n do begin&lt;br /&gt;
                  seek(databasefile, i) ;&lt;br /&gt;
                  read(databasefile, databaserec) ;&lt;br /&gt;
                  with databaserec do&lt;br /&gt;
                     cost := cost + member_ticketpayment&lt;br /&gt;
               end ; &lt;br /&gt;
            close(databasefile) ;&lt;br /&gt;
&lt;br /&gt;
            getcost := cost&lt;br /&gt;
         {$I+}&lt;br /&gt;
      end ; { getcost }&lt;br /&gt;
var&lt;br /&gt;
   costddc,&lt;br /&gt;
   costdpi,&lt;br /&gt;
   costdsgo,&lt;br /&gt;
   total       : integer ;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
   {&lt;br /&gt;
      first do the work&lt;br /&gt;
   }&lt;br /&gt;
   costddc  := getcost(DDCdatabasefile) ;&lt;br /&gt;
   costdpi  := getcost(DPIdatabasefile) ;&lt;br /&gt;
   costdsgo := getcost(DSGOdatabasefile) ;&lt;br /&gt;
   total    := costddc + costdpi + costdsgo ;&lt;br /&gt;
   {&lt;br /&gt;
      then display results&lt;br /&gt;
   }&lt;br /&gt;
   clrscr ;&lt;br /&gt;
   gotoxy(12,2) ; write('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ»') ;&lt;br /&gt;
   gotoxy(12,3) ; write('º                                                     º') ;&lt;br /&gt;
   gotoxy(12,4) ; write('º Welcome to the Grand totals option on the database. º') ;&lt;br /&gt;
   gotoxy(12,5) ; write('º Here you can view the members grand totals.         º') ;&lt;br /&gt;
   gotoxy(12,6) ; write('º Enjoy!                                              º') ;&lt;br /&gt;
   gotoxy(12,7) ; write('º                                                     º') ;&lt;br /&gt;
   gotoxy(12,8) ; write('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ¼') ;&lt;br /&gt;
&lt;br /&gt;
   gotoxy(17,10) ; writeln('The Total cost for DDC  Members is   $', costddc:5,  '.00') ;&lt;br /&gt;
   gotoxy(17,11) ; writeln('The total cost for DPI  Members is   $', costdpi:5,  '.00') ;&lt;br /&gt;
   gotoxy(17,12) ; writeln('The total cost for DSGO Members is   $', costdsgo:5, '.00') ;&lt;br /&gt;
&lt;br /&gt;
   gotoxy(17,14) ; writeln('The total cost for all the groups is $', total:5,    '.00') ;&lt;br /&gt;
&lt;br /&gt;
   gotoxy(17,17) ; writeln(' Press ENTER to return to the main menu. ') ;&lt;br /&gt;
   readln&lt;br /&gt;
end ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure  AboutWCMF;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************&lt;br /&gt;
*This Procedure is used to give a brief synopsis about the WCMF         *&lt;br /&gt;
**************************************************
**********************}&lt;br /&gt;
&lt;br /&gt;
 Var&lt;br /&gt;
  Ans:char;&lt;br /&gt;
&lt;br /&gt;
   Begin&lt;br /&gt;
    Clrscr;&lt;br /&gt;
  begin&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
 TextBackground(White);&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º        Welcome  to the brief synopsis about the WCMF.       º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º        Here you can view a brief history of the WCMF.       º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                        Enjoy!                               º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
Writeln;&lt;br /&gt;
Gotoxy(9,10);&lt;br /&gt;
Writeln('The World Creole Music Festival also known as WCMF was');&lt;br /&gt;
GOTOXY(9,11);&lt;br /&gt;
Writeln('established in 1997 by the Dominica Festival Commision');&lt;br /&gt;
GOTOXY(9,12);&lt;br /&gt;
Writeln('during the Independence celebrations. Its main aim was');&lt;br /&gt;
GOTOXY(9,12);&lt;br /&gt;
Writeln('to increase the country revenue from stay over visitors');&lt;br /&gt;
GOTOXY(9,13);&lt;br /&gt;
Writeln('coming to the island for the celebration and also to ');&lt;br /&gt;
GOTOXY(9,14);&lt;br /&gt;
Writeln('further broaden Dominica tourism products and to promote');&lt;br /&gt;
GOTOXY(9,15);&lt;br /&gt;
Writeln('the islands creole music. The WCMF has been a great and ');&lt;br /&gt;
GOTOXY(9,16);&lt;br /&gt;
Writeln('never disappointing  show since it has been established');&lt;br /&gt;
GOTOXY(9,17);&lt;br /&gt;
Writeln('15 years ago, and it is highly improbable for anything');&lt;br /&gt;
GOTOXY(9,18);&lt;br /&gt;
Writeln('to make it unsuccessful!');&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Writeln;&lt;br /&gt;
   Textcolor(black);&lt;br /&gt;
   GOTOXY(1,24);&lt;br /&gt;
    Writeln('Press any letter except "g" to go back to the main menu');&lt;br /&gt;
     Readln(Ans);&lt;br /&gt;
&lt;br /&gt;
      If Ans = 'g' then&lt;br /&gt;
&lt;br /&gt;
     Begin&lt;br /&gt;
    AboutWCMF; {When i took off the begin and end ,the procedure wouldn't open}&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
 Mainmenu;{ MAIN MENU IS NEEDED AS THE TEACHER DOESN'T WANT TO GO TO THE SOURCE CODE WHEN SHE EXIT'S IT.}&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure exit;&lt;br /&gt;
{*************************************************
************************&lt;br /&gt;
*This Procedure is used merely to exit!                                  *&lt;br /&gt;
**************************************************
***********************}&lt;br /&gt;
Begin&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
{*************************************************
***********************}&lt;br /&gt;
&lt;br /&gt;
Procedure Mainmenu;&lt;br /&gt;
&lt;br /&gt;
{*************************************************
**************************&lt;br /&gt;
*This Procedure is used to view and select the variety of options available*&lt;br /&gt;
**************************************************
*************************}&lt;br /&gt;
&lt;br /&gt;
Begin&lt;br /&gt;
clrscr;&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
Textbackground(White);&lt;br /&gt;
&lt;br /&gt;
GotoXY(8,2);&lt;br /&gt;
Writeln    ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');&lt;br /&gt;
Gotoxy(8,3);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,4);&lt;br /&gt;
Writeln    ('º Welcome  to the Member database. It Provides features for   º');&lt;br /&gt;
Gotoxy(8,5);&lt;br /&gt;
Writeln    ('º         people attending the festival from the diaspora.    º');&lt;br /&gt;
Gotoxy(8,6);&lt;br /&gt;
Writeln    ('º                                                             º');&lt;br /&gt;
Gotoxy(8,7);&lt;br /&gt;
Writeln    ('º                          Enjoy!                             º');&lt;br /&gt;
Gotoxy(8,8);&lt;br /&gt;
Writeln    ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');&lt;br /&gt;
&lt;br /&gt;
GotoXY(24,11);&lt;br /&gt;
Writeln('1.Enter new Member into a database.');&lt;br /&gt;
GotoXY(24,13);&lt;br /&gt;
writeln('2.View members in their different groups.');&lt;br /&gt;
GotoXY(24,15);&lt;br /&gt;
Writeln('3.View the advertisement.');&lt;br /&gt;
GotoXY(24,17);&lt;br /&gt;
Writeln('4. View Grand totals.');&lt;br /&gt;
GotoXY(24,19);&lt;br /&gt;
Writeln('5.A brief history of WCMF. ');&lt;br /&gt;
GotoXY(24,21);&lt;br /&gt;
Writeln('6.Exit.');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Textcolor(black);&lt;br /&gt;
GotoXY(32,60);&lt;br /&gt;
Textcolor(black + blink);&lt;br /&gt;
Writeln('Press the number of your choice , then press "Enter".');&lt;br /&gt;
GotoXY(70,25);&lt;br /&gt;
Readln(Choice);&lt;br /&gt;
Textcolor(blue);&lt;br /&gt;
Case choice of&lt;br /&gt;
&lt;br /&gt;
1:ADD;&lt;br /&gt;
2:Viewing;&lt;br /&gt;
3:Advert;&lt;br /&gt;
4:GrandTotals;&lt;br /&gt;
5:AboutWCMF;&lt;br /&gt;
6:Exit;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
Begin{Main program}&lt;br /&gt;
assign(DDCfile, 'memberdb.ddc');&lt;br /&gt;
Assign(DPIFile, 'memberdb.dpi');&lt;br /&gt;
assign(DSGOFILE,'memberdb.dsg');&lt;br /&gt;
{THIS IS YOUR CODE}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
clrscr;&lt;br /&gt;
Viewmenu;&lt;br /&gt;
Mainmenu;&lt;br /&gt;
end.{End of program}{This is just to tell the teacher the program has ended, she says we can keep it)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427333/re-goto/#427333</guid>
      <pubDate>Fri, 10 Feb 2012 18:51:10 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Your call</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427348/your-call/#427348</link>
      <description>&lt;span style="color: Blue;"&gt;&lt;br /&gt;
: She wouldn't mind it at all ..she told us to use all the codes we &lt;br /&gt;
: can .."The more complex your program the more marks you get" so &lt;br /&gt;
: yeah, &lt;br /&gt;
: &lt;br /&gt;
: i watched the grand total codes...thanks alot..i tried to put it in &lt;br /&gt;
: my program and i changed the codes to my program's updated codes but &lt;br /&gt;
: by reset , when i put in my code it says file variable expected...im &lt;br /&gt;
: lost..&lt;br /&gt;
: can i upload my updated program so you can eradicate the &lt;br /&gt;
: problem..also is it possible to have 3 "seeks","resets" because i &lt;br /&gt;
: have three databases and it wouldn't be nice if i can only work with &lt;br /&gt;
: one database..so tell me what  to do..&lt;br /&gt;
: &lt;br /&gt;
: thanks&lt;br /&gt;
:&lt;br /&gt;
&lt;/span&gt; &lt;br /&gt;
I'm afraid I've only succeeded in confusing you.&lt;br /&gt;
&lt;br /&gt;
My suggestion that you have one procedure to handle all three databases is an "all in" kind of thing.  If you are going to use only one procedure to handle all three databases I'm afraid you have to use the same strategy with &lt;strong&gt;viewing&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
I think it would be simpler to retreat to your original strategy of using three different procedures for each database.  On the other hand, if you teacher is giving more credit for more complex code then you may want to go forward with the one procedure approach I suggested.&lt;br /&gt;
&lt;br /&gt;
Your call.  Get back with me as soon as possible.  I want to help.  I'm working on your code.&lt;br /&gt;
&lt;br /&gt;
BTW, do I understand correctly that your teacher is not going to look at your code?  Just run the program?&lt;br /&gt;
&lt;br /&gt;
What textbook are you using?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427348/your-call/#427348</guid>
      <pubDate>Sat, 11 Feb 2012 13:09:31 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>This compiles</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427354/this-compiles/#427354</link>
      <description>&lt;span style="color: Blue;"&gt;&lt;br /&gt;
: She wouldn't mind it at all ..she told us to use all the codes we &lt;br /&gt;
: can .."The more complex your program the more marks you get" so &lt;br /&gt;
: yeah, &lt;br /&gt;
: &lt;br /&gt;
: i watched the grand total codes...thanks alot..i tried to put it in &lt;br /&gt;
: my program and i changed the codes to my program's updated codes but &lt;br /&gt;
: by reset , when i put in my code it says file variable expected...im &lt;br /&gt;
: lost..&lt;br /&gt;
: can i upload my updated program so you can eradicate the &lt;br /&gt;
: problem..also is it possible to have 3 "seeks","resets" because i &lt;br /&gt;
: have three databases and it wouldn't be nice if i can only work with &lt;br /&gt;
: one database..so tell me what  to do..&lt;br /&gt;
: &lt;br /&gt;
: thanks&lt;br /&gt;
: &lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
This compiles and seems to work.  I'm still working on it.  Will get back to you.&lt;br /&gt;
&lt;br /&gt;
What I've done really needs to be explained in more detail.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Program schoolSBA ;     {&lt;span style="color: Red;"&gt; version 2.11 -- i.e., Feb 11 &lt;/span&gt;}
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}

uses crt, dos ;

CONST
   DDC_FILE_NAME  = 'ddc_file.dat' ;   {&lt;span style="color: Red;"&gt; These are the 3 file names.  Change to suit! &lt;/span&gt;}
   DPI_FILE_NAME  = 'dpi_file.dat' ;   {&lt;span style="color: Red;"&gt; Must conform to the DOS 8.3 format. &lt;/span&gt;}
   DSGO_FILE_NAME = 'dsgofile.dat' ;

Type
   MemberDatabase = record       {declaration of record}
      Member_ID            : string[10] ;
      Member_Name          : string[30] ;
      Member_TicketPayment : integer ;
      Advert               : string
   end ;

   DatabaseFileType  = file of MemberDatabase ;

var
   DDCfile,                      {&lt;span style="color: Red;"&gt; the three file variables &lt;/span&gt;}
   DPIfile,                      {&lt;span style="color: Red;"&gt; a.k.a. file handles &lt;/span&gt;}
   DSGOfile : DatabaseFileType ; {&lt;span style="color: Red;"&gt; a.s.a. file descriptors or file identifiers &lt;/span&gt;}
                                 {&lt;span style="color: Red;"&gt; Pascal programmers prefer
                                   "file variables" and that's what the
                                   compiler calls them. &lt;/span&gt;}

   RecDDC,                       { variable for DDC record }
   RecDPI,                       { variable for DPI record }
   RecDSGO  : MemberDatabase ;   { variable for DSGO record }

   Choice, count, i : integer ;

   Procedure Mainmenu ; Forward ;
   {*************************************************
   *This Procedure is used to display the Main Menu *
   *of the program. *
   **************************************************
}
   
   {*************************************************
*********************}
   Procedure info ;
   Begin
      GotoXY(10,6) ;
      Writeln('When viewing members, you will observe a blank') ;
      Writeln('screen press the "up" or "down" arrow to start to view.') ;
   END ;
   {*************************************************
***********************}
   
   Procedure Viewmenu ;
   {Procedure to display intro}
   Begin
      clrscr ;
      TextColor(BLACK) ;
      Textbackground(WHITE) ;
      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.*') ;
      GotoXY(17,8) ;
      Writeln('This program was written by Michael L. Jarvis') ;
      GotoXY (17,10) ;
      writeln('a student of the Saint Mary`s Academy.') ;
      GotoXY(17,12) ;
      Writeln('Press "ENTER" to access the main menu.') ;
      readln ;
   end ;

(*                   &lt;span style="color: Red;"&gt;commented out -- not used&lt;/span&gt;
   Function File_exist:integer ;
   Begin
   clrscr ;
   {$I-}
   Reset (DDCfile) ;
   {$I+}
   If IOResult&amp;lt;&amp;gt;0 then
   Rewrite(DDCfile) ;
   {$I+}
   File_Exist := IOResult ;
   Close(DDCfile) ;
   end ;
*)
   
   {*************************************************
**************************}
   function nextrec(curr, n : longint) : longint  ;
   {This function pertains to the view procedures for DDC, DPI and DSGO}
   
   CONST
      NUL    = chr(0)  ;
      UP     = chr(72)  ; { UP arrow }
      DOWN   = chr(80)  ; { DOWN arrow }
      PGUP   = chr(73)  ;
      PGDN   = chr(81)  ;
      QUIT   = chr(79)  ; { "END" key }
      PGVAL  = 10  ;
   
   var
      key : char  ;
   
   begin
      while TRUE do begin { infinite loop }
         key := readkey  ;
         if key = NUL then begin
            key := readkey  ;
            
            case key of
               UP :     begin
                           curr := curr + 1 ;
                           if curr &amp;gt; n then
                              curr := n ;
                           nextrec := curr  ;
                           exit
                        end  ;
               DOWN :   begin
                           curr := curr - 1 ;
                           if curr &amp;lt; 0 then
                              curr := 0 ;
                           nextrec := curr  ;
                           exit
                        end  ;
               PGUP :   begin
                           curr := curr + PGVAL ;
                           if curr &amp;gt; n then
                              curr := n ;
                           nextrec := curr  ;
                           exit
                        end  ;
               PGDN :   begin
                           curr := curr - PGVAL ;
                           if curr &amp;lt; 0 then
                              curr := 0 ;
                           nextrec := curr  ;
                           exit
                        end  ;
               QUIT :   begin
                           nextrec := -100  ;
                           exit
                        end
            end { case }
         end
      end
   end  ;
   
   {*************************************************
**********************}
   Procedure Add_Member (var databasefile : Databasefiletype  ; db : string)  ;
   {*****************************************
   * This Procedure is used to add members * { THIS IS THE CODES YOU GAVE ME ..NOTICE "DDCFILE" INSTEAD OF "DDCDATABASEFILE"
   * into any database *
   *****************************************}
   Var
      Databaserec : Memberdatabase  ;
   BEGIN
      {$I-}
         clrscr ;
         
         Reset(Databasefile) ;
            If IOResult &amp;lt;&amp;gt;0 then
               Rewrite(Databasefile) ;
            
            Textcolor(Black) ;
            Textbackground(White) ;
            GotoXY(23,8) ;
            Writeln('------------------------------------------------') ;
            GotoXY(23,9) ;
            Writeln('------------------------------------------------') ;
            GotoXY(32,10) ;
            Writeln(' Welcome to the ', db, ' database. ') ;
            GOTOXY(23,11) ;
            Writeln(' ') ;
            GOTOXY(23,11) ;
            Writeln('-----------------------------------------------') ;
            Gotoxy(23,12) ;
            Writeln('----------------------------------------------- ') ;
            With databaserec do begin
               Writeln ;
               write ('Enter the Member ID.') ;
               readln(Member_ID) ;
               Writeln ;
               write ('Enter the Member full name.') ;
               Readln(Member_Name) ;
               Writeln ;
               repeat
                  write ('Enter the Member Ticket Price') ;
                  readln(Member_TicketPayment) ;
                  writeln
               until ioresult = 0
            end  ;
            
            seek(Databasefile, filesize(Databasefile)) ;
            Write(Databasefile, DatabaseRec) ;
            Write('Now there are ', fileSize(databasefile), ' records in the ', db, ' Database ') ;
            ReadLn ;
         Close(Databasefile)
      {$I+}
   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(Black) ;
      Textbackground(White) ;
      GotoXY(8,2) ;
      Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»') ;
      Gotoxy(8,3) ;
      Writeln ('º                                                             º') ;
      Gotoxy(8,4) ;
      Writeln ('º Welcome to the Add option of this database.                 º') ;
      Gotoxy(8,5) ;
      Writeln ('º Here you can add members in different groups.               º') ;
      Gotoxy(8,6) ;
      Writeln ('º Enjoy!                                                      º') ;
      Gotoxy(8,7) ;
      Writeln ('º                                                             º') ;
      Gotoxy(8,8) ;
      Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼') ;
      
      WRITELN ;
      Writeln('Here you will choose which database you want to add someone to.') ;
      Writeln ;
      Writeln('1-Add person to DDC database.') ;
      Writeln('2-Add person to DPI database.') ;
      Writeln('3-Add person to DSGO database.') ;
      Writeln('Press any number more than "3" to go to main menu') ;
      Writeln ;
      Writeln('Press the respective number then press Enter to continue.') ;
      Readln(choice) ;
      
      case choice of
         1 : Add_Member(DDCFILE, 'DDC') ;
         2 : Add_Member(DPIfile, 'DPI') ;
         3 : Add_Member(DSGOfile,'DSGO') ;
      END ;
      
      Readln ;
      Mainmenu ;
   end ;
   
   {*************************************************
*************************}
   
   Procedure View_RecordsDDC ;
   {*************************************************
**
   * This Procedure is used to view the information *
   * about the members in the DDC Database. *
   **************************************************
*}
   CONST
      SIZE = 1  ; { max number or records to be displayed }
   Var
      Ans : INTEGER ;
      count, { loop counter }
      n, { index of last record in database file }
      curr : longint  ; { index of current record in database file }
   
   Begin
      {$I-}
         Reset(DDCfile) ;
            if ioresult &amp;gt; 0 then begin
               write ('Sorry ') ;
               readln ;
               exit
            end ;
            n := filesize(DDCfile) - 1  ;
            curr := 1  ; { default value }
            
            repeat
               clrscr  ;
               Info ;
               For count := curr - (SIZE - 1) to curr do Begin
                  if (count &amp;lt; 0) or (count &amp;gt; n) then
                     continue  ; { no record has index &amp;lt; 0 or &amp;gt; n }
                  
                  Seek(DDCfile,count) ;
                  Read(DDCfile,RecDDC) ;
                  writeln ;
                  Textcolor(Black) ;
                  Textbackground(White) ;
                  
                  With RECDDC do begin
                     Writeln ;
                     writeln('Member Identification#:', Member_ID) ;
                     writeln ;
                     writeln('name of Member: ', Member_Name) ;
                     Writeln ;
                     Writeln ;
                     Writeln('Ticket Payment of member:$', Member_TicketPayment) ;
                     Textcolor(Black) ;
                     GotoXY(30,16) ;
                     Writeln(' ....GO UP.') ;
                     GotoXY(30,18) ;
                     Writeln(' ....GO DOWN.') ;
                     Gotoxy(30,20) ;
                     Writeln('END....EXIT VIEW MODE.') ;
                  end
               end ;
               curr := nextrec(curr, n)
            until curr &amp;lt; -99  ;
         close(DDCfile) ;
      {$I+}
   end ;
   {*************************************************
*********************}
   
   {*************************************************
**********************}
   Procedure View_RecordsDPI ;
   {*************************************************
**
   * This Procedure is used to view the information *
   * about the members in the DDC Database. *
   **************************************************
*}
   CONST
      SIZE = 1 ; { max number or records to be displayed }
   Var
      Ans : INTEGER ;
      count, { loop counter }
      n, { index of last record in database file }
      curr : longint  ; { index of current record in database file }
   
   Begin
      {$I-}
         Reset(DPIfile) ;
            if ioresult &amp;gt; 0 then begin
               write ('Sorry ') ;
               readln ;
               exit
            end ;
            n := filesize(DPIfile) - 1  ;
            curr := 1  ; { default value }
            
            repeat
               clrscr  ;
               Info ;
               For count := curr - (SIZE - 1) to curr do Begin
                  if (count &amp;lt; 0) or (count &amp;gt; n) then
                     continue  ; { no record has index &amp;lt; 0 or &amp;gt; n }
                  
                  Seek(DPIfile,count) ;
                  Read(DPIfile,RecDPI) ;
                  writeln ;
                  Textcolor(Black) ;
                  Textbackground(White) ;
                  
                  with RecDPI do begin
                     Writeln ;
                     writeln('Member Identification#:', Member_ID) ;
                     writeln ;
                     writeln('name of Member: ', Member_Name) ;
                     Writeln ;
                     Writeln('Ticket Payment of member:$', Member_TicketPayment) ;
                     Writeln ;
                     Textcolor(Black) ;
                     GotoXY(30,16) ;
                     Writeln(' ....GO UP.') ;
                     GotoXY(30,18) ;
                     Writeln(' ....GO DOWN.') ;
                     Gotoxy(30,20) ;
                     Writeln('END....EXIT VIEW MODE.') ;
                  end
               end ;
            curr := nextrec(curr, n)
            until curr &amp;lt; -99  ;
         close(DPIfile) ;
      {$I+}
   end ;
   
   {*************************************************
**********************}
   Procedure View_RecordsDSGO ;
   {*************************************************
**
   * This Procedure is used to view the information *
   * about the members in the DDC Database. *
   **************************************************
*}
   CONST
      SIZE = 1 ; { max number or records to be displayed }
   Var
      Ans : INTEGER ;
      count, { loop counter }
      n, { index of last record in database file }
      curr : longint  ; { index of current record in database file }
   
   Begin
   {$I-}
      Reset(DSGOfile) ;
         if ioresult &amp;gt; 0 then begin
            write ('Sorry ') ;
            readln ;
            exit
         end ;
         n := filesize(DSGOfile) - 1  ;
         curr := 1  ; { default value }
         
         repeat
            clrscr  ;
            info ;
            For count := curr - (SIZE - 1) to curr do Begin
               if (count &amp;lt; 0) or (count &amp;gt; n) then
                  continue  ; { no record has index &amp;lt; 0 or &amp;gt; n }
               
               Seek(DSGOfile,count) ;
               Read(DSGOfile,RecDSGO) ;
               writeln ;
               Textcolor(Black) ;
               Textbackground(White) ;
               
               With RecDSGO do begin
                  Writeln ;
                  writeln('Member Identification#:', Member_ID) ;
                  writeln ;
                  writeln('name of Member: ', Member_Name) ;
                  Writeln ;
                  Writeln('Ticket Payment of member:$', Member_TicketPayment) ;
                  Writeln ;
                  Textcolor(Black) ;
                  GotoXY(30,16) ;
                  Writeln(' ....GO UP.') ;
                  GotoXY(30,18) ;
                  Writeln(' ....GO DOWN.') ;
                  Gotoxy(30,20) ;
                  Writeln('END....EXIT VIEW MODE.') ;
               end
            end ;
            curr := nextrec(curr, n)
         until curr &amp;lt; -99  ;
      close(DSGOfile) ;
   {$I+}
   end ;
   
   {*************************************************
**********************}
   
   {*************************************************
************************}
   
   Procedure Viewing ;
   {*************************************************
************************
   *This procedure is used to view the members in the different groups. *
   **************************************************
***********************}
   Var
      Ans : char ;
      choice:Integer ;
   
   Begin
      clrscr ;
      GotoXY(8,2) ;
      Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»') ;
      Gotoxy(8,3) ;
      Writeln ('º                                                             º') ;
      Gotoxy(8,4) ;
      Writeln ('º Welcome to the a Viewing option on this database.           º') ;
      Gotoxy(8,5) ;
      Writeln ('º Here you can select which group to add members.             º') ;
      Gotoxy(8,6) ;
      Writeln ('º Enjoy!                                                      º') ;
      Gotoxy(8,7) ;
      Writeln ('º                                                             º') ;
      Gotoxy(8,8) ;
      Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼') ;
      
      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('1-View DDC members.') ;
      Writeln('2-View DPI members.') ;
      Writeln('3-View DSGO members.') ;
      Writeln('Press any number bigger than "3" to go to main menu.') ;
      Writeln ;
      Writeln('Press the respective number then press Enter.') ;
      Readln(choice) ;
      
      Case choice of
         1 : View_RecordsDDC ;
         2 : View_RecordsDPI ;
         3 : View_RecordsDSGO ;
      end ;
      
      mainmenu ;
   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:integer ;
   
   Begin
      clrscr ;
      Textcolor(black) ;
      gotoxy(10,4) ;
      Writeln('On October 29th we have bands like Krosfyah, Beenie Man, Maxi Priest,') ;
      Gotoxy(11,6) ;
      Writeln('Third World, Kassav, and Midnight Groovers!') ;
      Gotoxy(12,8) ;
      Writeln('On October 30th Come see bands like Carimi, Beris Hammond, UB40') ;
      Gotoxy(13,10) ;
      Writeln('Red Hot Flames, Grammacks and WCK.') ;
      Gotoxy(14,12) ;
      Writeln('On October 31st Come see Tabou Combo, Swinging Starz, Triple K') ;
      Gotoxy(15,14) ;
      Writeln('Nasio Fontaine, Sean Paul and Jah Cure.') ;
      Gotoxy(16,16) ;
      Writeln('Press "Enter" to continue.') ;
      Readln ;
      Mainmenu ;
   end ;
   
   {*************************************************
********************}
   procedure grandtotals  ;
   {
   **************************************************
****
   * This Procedure is used to identify the totals that *
   * each group pays and the total of all three groups. *
   **************************************************
****
   }
                    {&lt;span style="color: Red;"&gt; Word &lt;/span&gt;var&lt;span style="color: Red;"&gt; is necessary when passing file variables &lt;/span&gt;}
         function getcost (var databasefile : databasefiletype) : integer  ;
         {
         get total of payments from a database
         }
         var
            cost  : integer  ;
            i,                { loop index }
            n     : longint  ;    { index of last record }
         databaserec : memberdatabase  ;
         
         begin { getcost }
         {$I-}
            cost := 0  ;
            
            reset(databasefile)  ;
               if ioresult &amp;gt; 0 then begin { cannot open database so ... }
                  getcost := 0  ;         { return zero ... }
                  exit                    { and bug out }
               end  ;
               n := filesize(databasefile) - 1  ;
               for i := 0 to n do begin
               seek(databasefile, i)  ;
               read(databasefile, databaserec)  ;
               with databaserec do
               cost := cost + member_ticketpayment
               end  ;
            close(databasefile)  ;
            
            getcost := cost
         {$I+}
         end  ; { getcost }
   var
      costddc,
      costdpi,
      costdsgo,
      total : integer  ;
   
   begin
      {
         first do the work
      }
      costddc := getcost(DDCfile)  ;
      costdpi := getcost(DPIfile)  ;
      costdsgo := getcost(DSGOfile)  ;
      total := costddc + costdpi + costdsgo  ;
      {
         then display results
      }
      clrscr  ;
      gotoxy(12,2)  ; write('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ»')  ;
      gotoxy(12,3)  ; write('º                                                     º')  ;
      gotoxy(12,4)  ; write('º Welcome to the Grand totals option on the database. º')  ;
      gotoxy(12,5)  ; write('º Here you can view the members grand totals.         º')  ;
      gotoxy(12,6)  ; write('º Enjoy!                                              º')  ;
      gotoxy(12,7)  ; write('º                                                     º')  ;
      gotoxy(12,8)  ; write('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ¼')  ;
      
      gotoxy(17,10)  ; writeln('The Total cost for DDC Members is    $', costddc:5, '.00')  ;
      gotoxy(17,11)  ; writeln('The total cost for DPI Members is    $', costdpi:5, '.00')  ;
      gotoxy(17,12)  ; writeln('The total cost for DSGO Members is   $', costdsgo:5, '.00')  ;
      
      gotoxy(17,14)  ; writeln('The total cost for all the groups is $', total:5, '.00')  ;
      
      gotoxy(17,17)  ; writeln(' Press ENTER to return to the main menu. ')  ;
      readln ;

      mainmenu {&lt;span style="color: Red;"&gt; &lt;img src="http://www.programmersheaven.com/images/Community/frown.gif" width="15" height="15" alt="" /&gt; &lt;/span&gt;}
   end  ;
   
   Procedure AboutWCMF ;
   {*************************************************
***********************
   *This Procedure is used to give a brief synopsis about the WCMF *
   **************************************************
**********************}
   Var
      Ans:char ;
   
   Begin
      Clrscr ;
      begin
         
         Writeln ;
         TextBackground(White) ;
         Textcolor(black) ;
         
         GotoXY(8,2) ;
         Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»') ;
         Gotoxy(8,3) ;
         Writeln ('º                                                             º') ;
         Gotoxy(8,4) ;
         Writeln ('º Welcome to the brief synopsis about the WCMF.               º') ;
         Gotoxy(8,5) ;
         Writeln ('º Here you can view a brief history of the WCMF.              º') ;
         Gotoxy(8,6) ;
         Writeln ('º Enjoy!                                                      º') ;
         Gotoxy(8,7) ;
         Writeln ('º                                                             º') ;
         Gotoxy(8,8) ;
         Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼') ;
         
         Writeln ;
         Gotoxy(9,10) ;
         Writeln('The World Creole Music Festival also known as WCMF was') ;
         GOTOXY(9,11) ;
         Writeln('established in 1997 by the Dominica Festival Commision') ;
         GOTOXY(9,12) ;
         Writeln('during the Independence celebrations. Its main aim was') ;
         GOTOXY(9,12) ;
         Writeln('to increase the country revenue from stay over visitors') ;
         GOTOXY(9,13) ;
         Writeln('coming to the island for the celebration and also to ') ;
         GOTOXY(9,14) ;
         Writeln('further broaden Dominica tourism products and to promote') ;
         GOTOXY(9,15) ;
         Writeln('the islands creole music. The WCMF has been a great and ') ;
         GOTOXY(9,16) ;
         Writeln('never disappointing show since it has been established') ;
         GOTOXY(9,17) ;
         Writeln('15 years ago, and it is highly improbable for anything') ;
         GOTOXY(9,18) ;
         Writeln('to make it unsuccessful!') ;
      end ;
      
      Writeln ;
      Textcolor(black) ;
      GOTOXY(1,24) ;
      Writeln('Press any letter except "g" to go back to the main menu') ;
      Readln(Ans) ;
      
      If Ans = 'g' then
         AboutWCMF  {When i took off the begin and end ,the procedure wouldn't open
                     &lt;span style="color: Red;"&gt;Because you cannot precede "else" with a semicolon.
                     In Pascal the semicolon is a statement seperator,
                     not a statement terminator as in some other languages.&lt;/span&gt;}
      else
         Mainmenu  { MAIN MENU IS NEEDED AS THE TEACHER DOESN'T WANT TO GO TO THE SOURCE CODE WHEN SHE EXIT'S IT.
                     &lt;span style="color: Red;"&gt;??? I don't understand this comment at all.
                     What does &lt;/span&gt;"GO TO THE SOURCE CODE WHEN SHE EXIT'S"&lt;span style="color: Red;"&gt; mean?&lt;/span&gt;}
   end ;
   
   {*************************************************
***********************}
   {*************************************************
***********************}
   
   Procedure exit ;
   {*************************************************
************************
   *This Procedure is used merely to exit! *
   **************************************************
***********************}
   {&lt;span style="color: Red;"&gt;
      this is a do-nothing procedure and is not needed.  If you want to do
      nothing in a CASE statement simply write '6 : ;'  Since there is
      nothing between the colon and the semicolon, choice '6' will do
      nothing.  &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt;
   &lt;/span&gt;}
   Begin
   
   end ;
   {*************************************************
***********************}
   {*************************************************
***********************}
   
   Procedure Mainmenu ;
   
   {*************************************************
**************************
   *This Procedure is used to view and select the variety of options available*
   **************************************************
*************************}
   
   Begin
      clrscr ;
      Textcolor(black) ;
      Textbackground(White) ;
      
      GotoXY(8,2) ;
      Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»') ;
      Gotoxy(8,3) ;
      Writeln ('º                                                             º') ;
      Gotoxy(8,4) ;
      Writeln ('º Welcome to the Member database. It Provides features for    º') ;
      Gotoxy(8,5) ;
      Writeln ('º people attending the festival from the diaspora.            º') ;
      Gotoxy(8,6) ;
      Writeln ('º                                                             º') ;
      Gotoxy(8,7) ;
      Writeln ('º Enjoy!                                                      º') ;
      Gotoxy(8,8) ;
      Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼') ;
      
      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(black) ;
      GotoXY(32,60) ;
      Textcolor(black + blink) ;
      Writeln('Press the number of your choice , then press "Enter".') ;
      GotoXY(70,25) ;
      Readln(Choice) ;
      Textcolor(blue) ;
      Case choice of
         1 : ADD ;
         2 : Viewing ;
         3 : Advert ;
         4 : GrandTotals ;
         5 : AboutWCMF ;
         6 : ;    {&lt;span style="color: Red;"&gt; do nothing!  &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt; &lt;/span&gt;}
      end ;
   end ;

Begin{Main program}
   {
      These are the only 'assign' statements in entire program -- for now!
   }
   assign(DDCfile, DDC_FILE_NAME) ;
   Assign(DPIFile, DPI_FILE_NAME) ;
   assign(DSGOfile, DSGO_FILE_NAME) ;
   
   clrscr ;
   Viewmenu ;
   Mainmenu ;
end. { End of program }
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427354/this-compiles/#427354</guid>
      <pubDate>Sat, 11 Feb 2012 17:10:30 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Error 1</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427362/error-1/#427362</link>
      <description>The first error, in &lt;span style="color: Red;"&gt;red&lt;/span&gt;, happens because the compiler does not know what &lt;strong&gt;Memberdatabase&lt;/strong&gt; is.  The compiler is a "single pass" compiler.  It does not look ahead.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Program schoolSBA;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}

uses crt, dos;

Type

   &lt;span style="color: Red;"&gt;Databasefiletype = file of Memberdatabase;&lt;/span&gt;{THIS IS WHERE THE ERRORS START..ENLIGHTENING ME PLEASE}
   
   Memberdatabase = record
      DDCFILE,
      DPIfile,
      DSGOfile: DatabasefileTYPE;
      Databasefiletype : file of Memberdatabase;
&lt;/pre&gt;&lt;br /&gt;
This declaration needs to be made after you have declared &lt;strong&gt;Memberdatabase&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;Program schoolSBA;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}

uses crt, dos;

Type
   
   Memberdatabase = record
      DDCFILE,
      DPIfile,
      DSGOfile: DatabasefileTYPE;
      Databasefiletype : file of Memberdatabase;
   
   MemberDatabaseDDC = record {declaration of record}
      Member_ID : string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
      Advert : string;
   end;
   
   MemberDatabaseDPI=record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;
   
   MemberDatabaseDSGO = record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;

   &lt;span style="color: Red;"&gt;Databasefiletype = file of Memberdatabase;&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427362/error-1/#427362</guid>
      <pubDate>Sun, 12 Feb 2012 11:47:21 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Error 2</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427363/error-2/#427363</link>
      <description>Here's the second error.  Now the compiler does not know what &lt;strong&gt;DatabasefileTYPE&lt;/strong&gt; is.  You've gotten into a circular definition, which is not allowed (except with pointers, but that's an advanced subject I don't think you're ready for yet.)&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Program schoolSBA;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}

uses crt, dos;

Type
   
   Memberdatabase = record
      DDCFILE,
      DPIfile,
      DSGOfile: &lt;span style="color: Red;"&gt;DatabasefileTYPE;&lt;/span&gt;
      Databasefiletype : file of Memberdatabase;
   
   MemberDatabaseDDC = record {declaration of record}
      Member_ID : string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
      Advert : string;
   end;
   
   MemberDatabaseDPI=record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;
   
   MemberDatabaseDSGO = record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;

   Databasefiletype = file of Memberdatabase;
&lt;/pre&gt;&lt;br /&gt;
But this is not the correct definition for &lt;strong&gt;Memberdatabase&lt;/strong&gt;.   The innards of &lt;strong&gt;Memberdatabase&lt;/strong&gt; should be identical to &lt;strong&gt;MemberdatabaseDDC&lt;/strong&gt;. &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Program schoolSBA;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}

uses crt, dos;

Type
   
   &lt;span style="color: Red;"&gt;Memberdatabase = record
      Member_ID : string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
      Advert : string;
   end;&lt;/span&gt;
   
   MemberDatabaseDDC = record {declaration of record}
      Member_ID : string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
      Advert : string;
   end;
   
   MemberDatabaseDPI=record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;
   
   MemberDatabaseDSGO = record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;

   Databasefiletype = file of Memberdatabase;
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427363/error-2/#427363</guid>
      <pubDate>Sun, 12 Feb 2012 12:17:27 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Error 3</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427364/error-3/#427364</link>
      <description>The next three errors are caused by trying to define a variable more than once.  The solution is simple: delete the offending lines.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Program schoolSBA;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}

uses crt, dos;

Type
   
   Memberdatabase = record
      Member_ID : string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
      Advert : string;
   end;
   
   MemberDatabaseDDC = record {declaration of record}
      Member_ID : string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
      Advert : string;
   end;
   
   MemberDatabaseDPI=record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;
   
   MemberDatabaseDSGO = record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;

   Databasefiletype = file of Memberdatabase;

var

   DDCFILE,
   DPIfile,
   DSGOfile : Databasefiletype;
   &lt;span style="color: Red;"&gt;DDCfile : file of MemberDatabaseDDC;&lt;/span&gt;
   RecDDC: MemberDatabaseDDC; {variable for DDC record}
   
   &lt;span style="color: Red;"&gt;DPIfile: file of MemberDatabaseDPI;&lt;/span&gt;
   RecDPI: MemberDatabaseDPI;{variable for DPI record}
   
   &lt;span style="color: Red;"&gt;DSGOfile : file of MemberDatabaseDSGO;&lt;/span&gt;
   RecDSGO :MemberDatabaseDSGO; {variable for DSGO record}
   
   Choice, count,i: integer;
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427364/error-3/#427364</guid>
      <pubDate>Sun, 12 Feb 2012 13:46:18 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Error 4</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427365/error-4/#427365</link>
      <description>The next error is in the procedure &lt;strong&gt;View_RecordsDDC&lt;/strong&gt;.  The problem here is that the file &lt;strong&gt;DDCfile&lt;/strong&gt; is of type &lt;strong&gt;Databasefiletype&lt;/strong&gt;, and &lt;strong&gt;Databasefiletype&lt;/strong&gt; is defined as &lt;strong&gt;file of Memberdatabase&lt;/strong&gt;.  But &lt;strong&gt;RecDDC&lt;/strong&gt; is of type &lt;strong&gt;MemberDatabaseDDC&lt;/strong&gt;.  It doesn't matter that the innards of the two types, &lt;strong&gt;MemberDatabaseDDC&lt;/strong&gt; and &lt;strong&gt;MemberDatabase&lt;/strong&gt;, are identical.  As far as the compiler is concerned, it's not a match.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   Procedure View_RecordsDDC;
   
   {*************************************************
**
   * This Procedure is used to view the information *
   * about the members in the DDC Database. *
   **************************************************
*}
   CONST
      SIZE = 1 ; { max number or records to be displayed }
   Var
      Ans : INTEGER;
      count, { loop counter }
      n, { index of last record in database file }
      curr : longint ; { index of current record in database file }
   
   Begin
      Assign(DDCfile,'DDCDatabase.dat');
      {$I-}
      Reset(DDCfile);
         {$I+}
         n := filesize(DDCfile) - 1 ;
         curr := 1 ; { default value }
         
         repeat
            clrscr ;
            Info;
            For count := curr - (SIZE - 1) to curr do Begin
               if (count &amp;lt; 0) or (count &amp;gt; n) then
                  continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
               
               Seek(DDCfile,count);
               &lt;span style="color: Red;"&gt;Read(DDCfile,RecDDC);&lt;/span&gt;
               writeln;
               Textcolor(Black);
               Textbackground(White);
               
               With RECDDC do begin
                  Writeln;
                  writeln('Member Identification#:', Member_ID);
                  writeln;
                  writeln('name of Member: ', Member_Name);
                  Writeln;
                  Writeln;
                  Writeln('Ticket Payment of member:$', Member_TicketPayment);
                  Textcolor(Black);
                  GotoXY(30,16);
                  Writeln(' ....GO UP.');
                  GotoXY(30,18);
                  Writeln(' ....GO DOWN.');
                  Gotoxy(30,20);
                  Writeln('END....EXIT VIEW MODE.');
               
               end
            end;
            curr := nextrec(curr, n)
         until curr &amp;lt; -99 ;
      close(DDCfile);
   end;
&lt;/pre&gt;&lt;br /&gt;
The solution is to go back to the declarations of &lt;strong&gt;RecDDC, RecDPI&lt;/strong&gt; and &lt;strong&gt;RedDSGO&lt;/strong&gt; and redefine them as &lt;strong&gt;MemberDatabase&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Program schoolSBA;
{This program was written by Michael Jarvis, a student of the Saint Mary's Academy.}

uses crt, dos;

Type
   
   Memberdatabase = record
      Member_ID : string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
      Advert : string;
   end;
   
   MemberDatabaseDDC = record {declaration of record}
      Member_ID : string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
      Advert : string;
   end;
   
   MemberDatabaseDPI=record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;
   
   MemberDatabaseDSGO = record
      Member_ID  :  string[10];
      Member_Name : String[30];
      Member_TicketPayment : integer;
   end;

   Databasefiletype = file of Memberdatabase;

var

   DDCFILE,
   DPIfile,
   DSGOfile : Databasefiletype;
   &lt;span style="color: Red;"&gt;RecDDC : MemberDatabase;&lt;/span&gt; {variable for DDC record}
   
   &lt;span style="color: Red;"&gt;RecDPI : MemberDatabase;&lt;/span&gt;{variable for DPI record}
   
   &lt;span style="color: Red;"&gt;RecDSGO : MemberDatabase;&lt;/span&gt; {variable for DSGO record}
   
   Choice, count,i : integer;
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427365/error-4/#427365</guid>
      <pubDate>Sun, 12 Feb 2012 14:54:39 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Your call</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427366/re-your-call/#427366</link>
      <description>Actor you're a mad genius in turbo pascal...thanks alot!!!! gosh you are a big help in making my program work amazing.&lt;br /&gt;
&lt;br /&gt;
Yes the teacher has to watch the codes plus the program(i have to give it to her on a cd). well if it is possible to put the &lt;strong&gt;viewing members&lt;/strong&gt;&lt;strong&gt; procedure in one procedure&lt;/strong&gt; then ok but if not it's ok.&lt;br /&gt;
&lt;br /&gt;
is it possible to edit their info..plus i tried getting simple animations for my advert procedure but when i put the codes it told me i have some error. do you know of any good simple animations i can use. like fireworks or some moving objects and for me to still be able to see the info on the page.&lt;br /&gt;
&lt;br /&gt;
im using "Information Technology for CSEC" i live in the caribbean plus the teacher said the lower grades aren't going to use the book again.&lt;br /&gt;
we never used that text book for programming because it doesn't have turbo pascal in it but "basic" and she said that turbo pascal is easier to use than basic so yeah.&lt;br /&gt;
&lt;br /&gt;
And again thanks..&lt;br /&gt;
and do you know of any great "free" software to make flowcharts&lt;br /&gt;
i used smart draw but my free version expired and finding a crack for it is not easy..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks for the help!!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427366/re-your-call/#427366</guid>
      <pubDate>Sun, 12 Feb 2012 18:35:13 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Error 5</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427367/error-5/#427367</link>
      <description>The next error is in the procedure &lt;strong&gt;getcost&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
      &lt;span style="color: Red;"&gt;function getcost (databasefile : databasefiletype) :&lt;/span&gt; integer ;
      {
      get total of payments from a database
      }
&lt;/pre&gt;&lt;br /&gt;
This has to do with the way variables are passed to procedures/functions.  There are two ways: by &lt;em&gt;value&lt;/em&gt; and by &lt;em&gt;reference&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
Consider the following function, which returns the cube of a number.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
function cube (x : real) : real ;
begin
      cube := x * x * x
end ;
&lt;/pre&gt;&lt;br /&gt;
and a code fragment that calls the function.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
     z := cube(x) ;
&lt;/pre&gt;&lt;br /&gt;
This is an example of "pass by value."  When the function is called it makes a copy of the passed variable.  I.e., the &lt;strong&gt;x&lt;/strong&gt; in the function is a copy of the &lt;strong&gt;x&lt;/strong&gt; in the calling statement.  The two exist at different places in memory.  The fact they both have the same identifier does not matter.  Both the child function and the parent know which &lt;strong&gt;x&lt;/strong&gt; to work with.&lt;br /&gt;
&lt;br /&gt;
Now suppose that &lt;strong&gt;cube&lt;/strong&gt; were a procedure instead of a function.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
procedure cube (x : real) ;
begin
      x := x * x * x
end ;
&lt;/pre&gt;&lt;br /&gt;
This turns out to be a do-nothing procedure because there is no way to get the modified value of &lt;strong&gt;x&lt;/strong&gt; back to the calling procedure.  To do that we need to "pass by reference."  This is done using the reserved word &lt;strong&gt;var&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
procedure cube (var x : real) ;
begin
      x := x * x * x
end ;
&lt;/pre&gt;&lt;br /&gt;
When a variable is passed by reference the called procedure/function does not make a copy of the variable.  Instead it uses the actual variable passed to it.  Consider&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
     cube(z) ;
&lt;/pre&gt;&lt;br /&gt;
This turns &lt;strong&gt;z&lt;/strong&gt; into its cube.  It does not matter that the parent passes &lt;strong&gt;z&lt;/strong&gt; to the procedure and the procedure uses &lt;strong&gt;x&lt;/strong&gt; because &lt;strong&gt;z&lt;/strong&gt; and &lt;strong&gt;x&lt;/strong&gt; are the same thing.  &lt;strong&gt;x&lt;/strong&gt; becomes a kind of nickname for &lt;strong&gt;z&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
     a := 2.0 ;
     b := 3.0 ;
     c := 4.0 ;
     cube(a) ;
     cube(b) ;
     cube(c) ;
     writeln (a:3:1, b:5:1, c:5:1) ;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
this will write out&lt;br /&gt;
&lt;br /&gt;
  8.0 27.0 64.0&lt;br /&gt;
&lt;br /&gt;
Each time &lt;strong&gt;cube&lt;/strong&gt; is called &lt;strong&gt;x&lt;/strong&gt; becomes the same as &lt;strong&gt;a, b&lt;/strong&gt; and &lt;strong&gt;c&lt;/strong&gt; in turn.&lt;br /&gt;
&lt;br /&gt;
The thing is that you cannot make copies of file variables.  The reason is technical and I won't go into that now.  File variables must be passed by reference.  Thus the correct version of &lt;strong&gt;getcost&lt;/strong&gt; is&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
      function getcost (&lt;span style="color: Red;"&gt;var&lt;/span&gt; databasefile : databasefiletype) : integer ;
      {
      get total of payments from a database
      }
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427367/error-5/#427367</guid>
      <pubDate>Sun, 12 Feb 2012 19:15:11 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Error 6</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427368/error-6/#427368</link>
      <description>Another duplicate identifier.  &lt;strong&gt;databasefile&lt;/strong&gt; is already defined 8 lines above.  Same solution.  Get rid of the offending line.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
      function getcost (var databasefile : databasefiletype) : integer ;
      {
      get total of payments from a database
      }
      var
         cost : integer ;
         i, { loop index }
         n : longint ; { index of last record }
         &lt;span style="color: Red;"&gt;databasefile : databasefiletype ;&lt;/span&gt;
         databaserec : memberdatabase ;
      
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427368/error-6/#427368</guid>
      <pubDate>Sun, 12 Feb 2012 19:27:33 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Your call</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427369/re-your-call/#427369</link>
      <description>&lt;span style="color: Blue;"&gt;: Actor you're a mad genius in turbo pascal...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Thanks for the complement.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;: well if it is possible to put the &lt;br /&gt;
: &lt;strong&gt;viewing members&lt;/strong&gt;&lt;strong&gt; procedure in one procedure&lt;/strong&gt; then ok but &lt;br /&gt;
: if not it's ok.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
No problem.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;: is it possible to edit their info..&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Editing info is possible.  There are two strategies.  One is to edit the info inside the &lt;strong&gt;viewing&lt;/strong&gt; procedure.  The other is to have a separate procedure.  For the user it's better to edit inside &lt;strong&gt;viewing&lt;/strong&gt; but for the programmer it's simpler to have a separate procedure.  Your call.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;: plus i tried getting simple &lt;br /&gt;
: animations for my advert procedure but when i put the codes it told &lt;br /&gt;
: me i have some error. do you know of any good simple animations i &lt;br /&gt;
: can use. like fireworks or some moving objects and for me to still &lt;br /&gt;
: be able to see the info on the page.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Sorry, but my career was in databases and robotics.  No experience with animation.  Afraid I can't help there.&lt;br /&gt;
 &lt;br /&gt;
&lt;span style="color: Blue;"&gt;: im using "Information Technology for CSEC"&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I was hoping you were using a book that I already  have.  Checking at Amazon.com I find that that one's expensive.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;: and do you know of any great "free" software to make flowcharts&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Afraid not.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;: Thanks for the help!!&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You're welcome.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427369/re-your-call/#427369</guid>
      <pubDate>Sun, 12 Feb 2012 19:50:58 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Weather</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427370/weather/#427370</link>
      <description>&lt;span style="color: Blue;"&gt;: i live in the Caribbean&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
How's the weather down there.  This afternoon I went to the store for supplies.  Rode my scooter and darn near froze.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427370/weather/#427370</guid>
      <pubDate>Sun, 12 Feb 2012 19:59:22 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>When is this project due?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427371/when-is-this-project-due/#427371</link>
      <description>From what you've posted I'm assuming March 1 or shortly after.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427371/when-is-this-project-due/#427371</guid>
      <pubDate>Sun, 12 Feb 2012 20:07:05 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Error 7</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427391/error-7/#427391</link>
      <description>The last error, "unknown identifier", occurs in the procedure &lt;strong&gt;grandtotals&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   begin
      {
      first do the work
      }
      costddc := getcost(&lt;span style="color: Red;"&gt;DDCdatabasefile&lt;/span&gt;) ;
      costdpi := getcost(&lt;span style="color: Red;"&gt;DPIdatabasefile&lt;/span&gt;) ;
      costdsgo := getcost(&lt;span style="color: Red;"&gt;DSGOdatabasefile&lt;/span&gt;) ;
      total := costddc + costdpi + costdsgo ;
&lt;/pre&gt;&lt;br /&gt;
We need to change this to our new file names.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   begin
      {
      first do the work
      }
      costddc := getcost(&lt;span style="color: Red;"&gt;DDCfile&lt;/span&gt;) ;
      costdpi := getcost(&lt;span style="color: Red;"&gt;DPIfile&lt;/span&gt;) ;
      costdsgo := getcost(&lt;span style="color: Red;"&gt;DSGOfile&lt;/span&gt;) ;
      total := costddc + costdpi + costdsgo ;
&lt;/pre&gt;&lt;br /&gt;
I think this is our last error and the program should compile.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427391/error-7/#427391</guid>
      <pubDate>Mon, 13 Feb 2012 10:13:16 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Your call</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427396/re-your-call/#427396</link>
      <description>Well i would rather have the user edit the info while viewing but i doubt the screen will have enough space so i guess you can make a separate procedure to edit their stuff...that's alright for the animation..the weather is getting hot ..it was cold for the beginning of the year as Christmas just passed. that book isn't really great.. the final project is due for march 17.&lt;br /&gt;
&lt;br /&gt;
thanks for the help as always!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427396/re-your-call/#427396</guid>
      <pubDate>Mon, 13 Feb 2012 12:05:20 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Two changes</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427397/two-changes/#427397</link>
      <description>Two more changes I would like to make to your code before I test it.  The first is to change the file names in the assign statements in the main program to the ones you chose.  As I've explained before Turbo Pascal will truncate these to 'DDCDatab.dat', 'DPIdatab.dat' and 'DSGOData.dat', but it's ok to keep the longer names in your code.  It has good mnemonic value.  I'm thinking that you know what the word "mnemonic" means.  If you don't then google it or look it up in a dictionary.  It's a word that should be in every programmer's vocabulary.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Begin{Main program}
   assign(DDCfile,  '&lt;span style="color: Red;"&gt;DDCDatabase.dat&lt;/span&gt;');
   Assign(DPIFile,  '&lt;span style="color: Red;"&gt;DPIDatabase.dat&lt;/span&gt;');
   assign(DSGOFILE, '&lt;span style="color: Red;"&gt;DSGODatabase.dat&lt;/span&gt;');
   
   clrscr;
   Viewmenu;
   Mainmenu;
end.{End of program}
&lt;/pre&gt;&lt;br /&gt;
&lt;strong&gt;Assign&lt;/strong&gt; appears at four other places in your code.  One is in the procedure &lt;strong&gt;file_exist&lt;/strong&gt; which we won't worry about since it's dead code.  I'll have more to say about dead code later.  The other three are in &lt;strong&gt;View_RecordsDDC, View_RecordsDPI&lt;/strong&gt; and &lt;strong&gt;View_RecordsDSGO&lt;/strong&gt;.  These are unnecessary since the three &lt;strong&gt;assign&lt;/strong&gt; statements in the main program associates each file variable with it's respective file, globally, throughout the program.&lt;br /&gt;
&lt;br /&gt;
I've commented these out rather than deleting them.  This will make them easier to recover should their deletion have unexpected effects when we test, but I don't think it will.&lt;br /&gt;
&lt;br /&gt;
By the way, I use (* *) type comments for "deleting out" code and {  } for all other comments.  This is because you cannot nest {  } comments inside other {  } type comments.  But you can nest {  } comments inside (*  *) comments (and vice versa).  By following this practice I don't have to worry about an unexpected } ending my comment out.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   Procedure View_RecordsDDC;
   
   {*************************************************
**
   * This Procedure is used to view the information *
   * about the members in the DDC Database. *
   **************************************************
*}
   CONST
      SIZE = 1 ; { max number or records to be displayed }
   Var
      Ans : INTEGER;
      count, { loop counter }
      n, { index of last record in database file }
      curr : longint ; { index of current record in database file }
   
   Begin
      (*&lt;span style="color: Red;"&gt;
      Assign(DDCfile,'DDCDatabase.dat');
      &lt;/span&gt;*)
      {$I-}
      Reset(DDCfile);
         {$I+}
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;   
   Procedure View_RecordsDPI;
   
   {*************************************************
**
   * This Procedure is used to view the information *
   * about the members in the DDC Database. *
   **************************************************
*}
   CONST
      SIZE = 1; { max number or records to be displayed }
   Var
      Ans : INTEGER;
      count, { loop counter }
      n, { index of last record in database file }
      curr : longint ; { index of current record in database file }
   
   Begin
      (*&lt;span style="color: Red;"&gt;
      Assign(DPIFILE,'DPIDatabase.dat');
      &lt;/span&gt;*)
      {$I-}
      Reset(DPIfile);
         {$I+}
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;   
   Procedure View_RecordsDSGO;
   
   {*************************************************
**
   * This Procedure is used to view the information *
   * about the members in the DDC Database. *
   **************************************************
*}
   CONST
      SIZE = 1; { max number or records to be displayed }
   Var
      Ans : INTEGER;
      count, { loop counter }
      n, { index of last record in database file }
      curr : longint ; { index of current record in database file }
   
   Begin
      (*&lt;span style="color: Red;"&gt;
      Assign(DSGOfile,'DSGODATABASE.dat');
      &lt;/span&gt;*)
      {$I-}
      Reset(DSGOfile);
      {$I+}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427397/two-changes/#427397</guid>
      <pubDate>Mon, 13 Feb 2012 12:10:14 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Testing</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427414/testing/#427414</link>
      <description>I've been testing your code with the errors removed and the two changes I suggested.  There are two small issues that are not exactly errors but I think they should be corrected.  The first is in the procedure &lt;strong&gt;grandtotals&lt;/strong&gt;.  As is it "falls off the end" and when it does the program terminates.  This isn't exactly wrong but it's annoying to the user.  To avoid it, if you are going to be using recursion, you need to add a call to &lt;strong&gt;mainmenu&lt;/strong&gt; as I show below in red.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   procedure grandtotals ;
   {
   **************************************************
****
   * This Procedure is used to identify the totals that *
   * each group pays and the total of all three groups. *
   **************************************************
****
   }
   
      function getcost (var databasefile : databasefiletype) : integer ;
      {
      get total of payments from a database
      }
      var
         cost : integer ;
         i, { loop index }
         n : longint ; { index of last record }
         databaserec : memberdatabase ;
      
      begin { getcost }
      {$I-}
         cost := 0 ;
         
         reset(databasefile) ;
            if ioresult &amp;gt; 0 then begin { cannot open database so ... }
               getcost := 0 ; { return zero ... }
               exit { and bug out }
            end ;
            n := filesize(databasefile) - 1 ;
            for i := 0 to n do begin
               seek(databasefile, i) ;
               read(databasefile, databaserec) ;
               with databaserec do
               cost := cost + member_ticketpayment
            end ;
         close(databasefile) ;
         
         getcost := cost
      {$I+}
      end ; { getcost }
   var
      costddc,
      costdpi,
      costdsgo,
      total : integer ;
   
   begin
      {
      first do the work
      }
      costddc := getcost(DDCfile) ;
      costdpi := getcost(DPIfile) ;
      costdsgo := getcost(DSGOfile) ;
      total := costddc + costdpi + costdsgo ;
      {
      then display results
      }
      clrscr ;
      gotoxy(12,2) ; write('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ»') ;
      gotoxy(12,3) ; write('º                                                     º') ;
      gotoxy(12,4) ; write('º Welcome to the Grand totals option on the database. º') ;
      gotoxy(12,5) ; write('º Here you can view the members grand totals.         º') ;
      gotoxy(12,6) ; write('º Enjoy!                                              º') ;
      gotoxy(12,7) ; write('º                                                     º') ;
      gotoxy(12,8) ; write('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ¼') ;
      
      gotoxy(17,10) ; writeln('The Total cost for DDC Members is    $', costddc:5, '.00') ;
      gotoxy(17,11) ; writeln('The total cost for DPI Members is    $', costdpi:5, '.00') ;
      gotoxy(17,12) ; writeln('The total cost for DSGO Members is   $', costdsgo:5, '.00') ;
      
      gotoxy(17,14) ; writeln('The total cost for all the groups is $', total:5, '.00') ;
      
      gotoxy(17,17) ; writeln(' Press ENTER to return to the main menu. ') ;
      readln ;

      &lt;span style="color: Red;"&gt;mainmenu { you need this if you're going to use recursion }&lt;/span&gt;
   end ;
&lt;/pre&gt;&lt;br /&gt;
The other problem is when the user selects &lt;strong&gt;add&lt;/strong&gt; he has to hit ENTER twice to continue.  Not exactly wrong, but annoying.  The reason is the &lt;strong&gt;readln&lt;/strong&gt; at the end of &lt;strong&gt;add&lt;/strong&gt; which, it turns out, is an extra &lt;strong&gt;readln&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   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(Black);
      Textbackground(White);
      GotoXY(8,2);
      Writeln ('ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»');
      Gotoxy(8,3);
      Writeln ('º                                                             º');
      Gotoxy(8,4);
      Writeln ('º Welcome to the Add option of this database.                 º');
      Gotoxy(8,5);
      Writeln ('º Here you can add members in different groups.               º');
      Gotoxy(8,6);
      Writeln ('º Enjoy!                                                      º');
      Gotoxy(8,7);
      Writeln ('º                                                             º');
      Gotoxy(8,8);
      Writeln ('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼');
      
      WRITELN;
      Writeln('Here you will choose which database you want to add someone to.');
      Writeln;
      Writeln('1-Add person to DDC database.');
      Writeln('2-Add person to DPI database.');
      Writeln('3-Add person to DSGO database.');
      Writeln('Press any number more than "3" to go to main menu');
      Writeln;
      Writeln('Press the respective number then press Enter to continue.');
      Readln(choice);
      
      case choice of
         1 : Add_Member(DDCFILE, 'DDC');
         2 : Add_Member(DPIfile, 'DPI');
         3 : Add_Member(DSGOfile,'DSGO');
      END;
      (*&lt;span style="color: Red;"&gt;
      Readln;   { not needed!   makes user hit ENTER twice }
      &lt;/span&gt;*)
      Mainmenu;
   end;
&lt;/pre&gt;&lt;br /&gt;
About recursion, I know that eventually your program will crash if a session is long enough, but I was able to add 60 people in one session without crashing, so I guess you're OK. &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427414/testing/#427414</guid>
      <pubDate>Tue, 14 Feb 2012 11:41:37 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Grand Totals</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427435/re-grand-totals/#427435</link>
      <description>&lt;br /&gt;
Pampaz:  Check your messages.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427435/re-grand-totals/#427435</guid>
      <pubDate>Wed, 15 Feb 2012 16:47:49 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Viewing with one procedure</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427439/viewing-with-one-procedure/#427439</link>
      <description>I've had issues logging on to the site.  This is a new account.  I've sent you my email address.  Check your messages&lt;br /&gt;
&lt;br /&gt;
Here's how to change your procedure &lt;strong&gt;viewing&lt;/strong&gt; so that you can use only one &lt;strong&gt;View_Records&lt;/strong&gt; instead of three.  First you need to make the following changes in &lt;strong&gt;Viewing&lt;/strong&gt;.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
      Case choice of
         1 : &lt;span style="color: Red;"&gt;View_Records (DDCfile)&lt;/span&gt; ;
         2 : &lt;span style="color: Red;"&gt;View_Records (DPIfile)&lt;/span&gt; ;
         3 : &lt;span style="color: Red;"&gt;View_Records (DSGOfile)&lt;/span&gt;
      end;
&lt;/pre&gt;&lt;br /&gt;
Now you need to create a procedure &lt;strong&gt;View_Records&lt;/strong&gt; which is mostly identical to &lt;strong&gt;View_RecordsDDC&lt;/strong&gt;, etc., except for the parts I've put in red.&lt;br /&gt;
&lt;br /&gt;
I've made some small changes to &lt;strong&gt;nextrec&lt;/strong&gt;, which I've indicated in blue.  It quite often happens when one is coding that better ways to do it come to mind.  Whether you want to make these changes is up to you.  Obviously the previous versions works.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
      Procedure &lt;span style="color: Red;"&gt;View_Records (var thisfile : Databasefiletype)&lt;/span&gt; ;
      {*************************************************
*
      * This Procedure is used to view the information  *
      * about the members in the DDC Database.          *
      **************************************************
*}

         function nextrec (curr, n : longint) : longint ;
         {
         }            
         CONST
            NUL   = chr(0) ;
            UP    = chr(72) ; { UP arrow }
            DOWN  = chr(80) ; { DOWN arrow }
            PGUP  = chr(73) ;
            PGDN  = chr(81) ;
            QUIT  = chr(79) ; { "END" key }
            PGVAL = 10 ;
         
         var
            key : char ;
         
         begin
            while TRUE do begin { infinite loop }
               key := readkey ;
               if key = NUL then begin
                  key := readkey ;
                  
                  case key of
                     UP :     begin
                                 &lt;span style="color: Blue;"&gt;curr := curr + 1 ;
                                 if curr &amp;gt; n then
                                    curr := n ;&lt;/span&gt;
                                 nextrec := curr ;
                                 exit
                              end ;
                     DOWN :   begin
                                 &lt;span style="color: Blue;"&gt;curr := curr - 1 ;
                                 if curr &amp;lt; 0 then
                                    curr := 0 ;&lt;/span&gt;
                                 nextrec := curr ;
                                 exit
                              end ;
                     PGUP :   begin
                                 &lt;span style="color: Blue;"&gt;curr := curr + PGVAL ;
                                 if curr &amp;gt; n then
                                    curr := n ;&lt;/span&gt;
                                 nextrec := curr ;
                                 exit
                              end ;
                     PGDN :   begin
                                 &lt;span style="color: Blue;"&gt;curr := curr - PGVAL ;
                                 if curr &amp;lt; 0 then
                                    curr := 0 ;&lt;/span&gt;
                                 nextrec := curr ;
                                 exit
                              end ;
                     QUIT :   begin
                                 nextrec := -100 ;
                                 exit
                              end
                  end { case }
               end
            end
         end ;
      
      CONST
         SIZE = 1 ; { max number or records to be displayed }
      Var
         Ans      : INTEGER;
         count,               { loop counter }
         n,                   { index of last record in database file }
         curr     : longint ; { index of current record in database file }
         &lt;span style="color: Red;"&gt;thisrec  : MemberDatabase;    { variable for the current record }&lt;/span&gt;
      
      Begin
         {$I-}
            Reset(&lt;span style="color: Red;"&gt;thisfile&lt;/span&gt;);
               if ioresult &amp;gt; 0 then begin
                  clrscr ;
                  write ('File not found.  Hit ENTER to return to main menu.') ;
                  readln ;
                  exit
               end ;
               n := filesize(&lt;span style="color: Red;"&gt;thisfile&lt;/span&gt;) - 1 ;
               curr := 1 ; { default value }
               
               repeat
                  clrscr ;
                  Info;
                  For count := curr - (SIZE - 1) to curr do Begin
                     if (count &amp;lt; 0) or (count &amp;gt; n) then
                        continue ; { no record has index &amp;lt; 0 or &amp;gt; n }
                     
                     Seek(&lt;span style="color: Red;"&gt;thisfile&lt;/span&gt;,count);
                     Read(&lt;span style="color: Red;"&gt;thisfile,thisrec&lt;/span&gt;);
                     writeln;
                     Textcolor(Black);
                     Textbackground(White);
                     
                     With &lt;span style="color: Red;"&gt;thisrec&lt;/span&gt; do begin
                        Writeln;
                        writeln('Member Identification#:', Member_ID);
                        writeln;
                        writeln('name of Member: ', Member_Name);
                        Writeln;
                        Writeln('Ticket Payment of member:$', Member_TicketPayment);
                        Textcolor(Black);
                        GotoXY(30,16);
                        Writeln(' ....GO UP.');
                        GotoXY(30,18);
                        Writeln(' ....GO DOWN.');
                        Gotoxy(30,20);
                        Writeln('END....EXIT VIEW MODE.')
                     end
                  end ;
                  curr := nextrec (curr, n)
               until curr &amp;lt; -99 ;
            close(thisfile);
         {$I+}
      end;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427439/viewing-with-one-procedure/#427439</guid>
      <pubDate>Wed, 15 Feb 2012 21:29:42 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Viewing with one procedure</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426760/427457/re-viewing-with-one-procedure/#427457</link>
      <description>thanks i'll add them this weekend.&lt;br /&gt;
&lt;br /&gt;
i can't wait to get the editing codes....&lt;br /&gt;
&lt;br /&gt;
any ways thanks alot!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426760/427457/re-viewing-with-one-procedure/#427457</guid>
      <pubDate>Thu, 16 Feb 2012 11:41:16 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>