just need i a little help any onyone !!!!!!!!! 
Author Message
 just need i a little help any onyone !!!!!!!!!

Well I think I cracked it just need to create
 a procedure to display the balance of the cutomers that are overdrawn and
the amount they are overdrawn by so that you can send letters to then to
tell the customers they have exceeded there limit any pointers ???

Heres what I have so far ... Many thanks for your help ...

   program bankbookrecords;
uses wincrt;
const   maxrec = 200;
type
bankrec = record
actnum : integer;
name : string[16];
address : string[20];
curbal : integer;
ovdrlm : integer;
end;

type    range  = 0..maxrec;
        index  = 1..maxrec;
        arbankrec  = array[index] of bankrec;

        cusfile = file of bankrec;
var
customerfile : cusfile;
bf : bankrec;
custcount, selcount: range;
arcust, arselected: arbankrec;
 {-------------------------------------------------------}
PROCEDURE SoundBell;
{ sound the bell }
VAR lSBcount : INTEGER;
BEGIN
    FOR lSBcount := 1 to 10 DO
    BEGIN
        Write(CHR(7))
    END;
    WriteLn
END; {SoundBell}

 {-------------------------------------------------------}
PROCEDURE WELCOME;
    var
    count:integer;
begin
for count :=1 to 50 do
write('*');
writeln;
for count := 1 to 10 do
writeln('*','*':49);
writeln('*','':10,'THIS PROGRAM WAS MADE BY':10,'*':15);
writeln('*','':15,'STEPHEN CHAMBERS':10,'*':18);
writeln('*','':10,'PLEASE HIT ENTER TO PROCEED':10,'*':12);
for count := 1 to 10 do
writeln('*','*':49);
for count :=1 to 50 do
write('*');
readln;
clrscr;
end;
{------------------------------------------------------------------}
procedure readrecords;
begin
write('account no':4,'name':10,'address':22,'balance':14,'overdraft':14);
writeln;
begin
assign (customerfile,'a:\customer.rec');
reset(customerfile);
while not eof (customerfile) do
begin
read (customerfile,bf);
writeln(bf.actnum:4,bf.name:18,bf.address:20,'':8,bf.curbal:5,'':8,bf.ovdr
lm:6);
end;
close(customerfile);
end;
end;
{----------------------------------------------------------------}
procedure negbalance;
var num :integer;
begin
writeln('******THESE ARE THE RECORDS OF ALL CUSTOMERS WITH A NEGATIVE
BALANCE********');
write('account no':4,'name':10,'address':22,'balance':12,'overdraft':12);
writeln;
begin
assign (customerfile,'a:\customer.rec');
reset(customerfile);
while not eof (customerfile) do
begin
read (customerfile,bf);
if   bf.curbal <0 then
writeln(bf.actnum:4,bf.name:18,bf.address:20,'':8,bf.curbal:5,'':8,bf.ovdr
lm:6);
end;
close(customerfile);
end;
end;
{----------------------------------------------------------------}
procedure display_items(var br:bankrec);
begin
  with br do writeln(actnum:4,name:18,address:20,
                     '':8,curbal:5,'':8,ovdrlm:6)
end; {display_items}
procedure save;
var overdrawnfile:cusfile; {file to be written}
{-----------------------------------------------------------------------}
begin
  write('account no':4,'name':10,'address':22,
                 'balance':12,'overdraft':12);
  writeln;
  assign (overdrawnfile,'a:\overdrwn.rec');

   {--> customerfile was allready assigned to 'a:\customer.rec'}
  reset(customerfile);  {for reading}
  rewrite(overdrawnfile); {for writing}
  while not eof (customerfile) do
  begin
    read (customerfile,bf);
    if bf.curbal <0
       then begin
              display_items(bf);
              write(overdrawnfile,bf) {<-- the actual write}
            end {if}
  end; {while}
  close(overdrawnfile);
  close(customerfile);
end; {save}
{---------------------------------------------------------------------------
-----}
procedure save1;
var drawnfile:cusfile; {file to be written}
begin
  write('account no':4,'name':10,'address':22,
                 'balance':12,'overdraft':12);
  writeln;
  assign (drawnfile,'a:\drawn.rec');

   {--> customerfile was allready assigned to 'a:\customer.rec'}
  reset(customerfile);  {for reading}
  rewrite(drawnfile); {for writing}
writeln('******THESE ARE THE RECORDS OF ALL CUSTOMERS WHO EXCEED THERE
LIMIT********');
writeln;
writeln(' ACCOUNT NO':8, ' NAME ':10, 'ADDRESS':20, 'BALANCE':20,
'OVERDRAFT':15);
writeln;

 {Start of while loop}
While not eof (customerfile) do
Begin
Read (customerfile,bf);

if (bf.curbal < 0) and (bf.curbal < - bf.ovdrlm) then
begin
              display_items(bf);
              write(drawnfile,bf);
                end;
              If (bf.ovdrlm = 0) and (bf.curbal < 0) then
              begin
              display_items(bf);
              write(drawnfile,bf)

               end {if}
  end; {while}
  close(drawnfile);
  close(customerfile);
end; {save}
{----------------------------------------------------------}
 PROCEDURE goodbye;
    var
    count:integer;
begin

for count :=1 to 50 do
write('*');
writeln;
for count := 1 to 10 do
writeln('*','*':49);
writeln('*','':10,'THANK YOU FOR USING MY PROGRAM':10,'*':9);
writeln('*','':10,'PLEASE HIT ENTER TO EXIT':10,'*':15);
for count := 1 to 10 do
writeln('*','*':49);
for count :=1 to 50 do
write('*');
readln;
clrscr;
end;
{---------------------------------------------------------}

begin 666  {main program}.dat








`
end

begin 666 DRAWN.REC




`
end

begin 666 CUSTOMER.REC




M;&QM86Z,!C^?B3X]G\<&#C$U($AA<F-O=7)T(%)DQP9?GPH`+ %D`*,`!5-I

M=F5Y#H#^__AT! 8?ZPTT-2!$97-M;VYD(%-T,\F ``!*!.S_9 `M``9!;F1E















`
end



Sat, 22 Nov 2003 09:49:55 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. just need i a little help any onyone !!!!!!!!!

2. just need i a little help any onyone !!!!!!!!!

3. Need a little help and/or encouragement with a homework project, Richard A

4. Need a little help and/or encouragement with a homework project, Richard A

5. need just a little help with command lines

6. Need Help with a little program

7. Newbie needs a little help with code for printing

8. Active Window (Need a little help)

9. I need a little help...

10. Need a little help with indexes!

11. I need a little help.

12. Interbase Newbie -- Need a little guidance.

 

 
Powered by phpBB® Forum Software