ScottyBhoy
asked on
Linking 2 variables
Is it possible to enter a number(customer number)
which would then display the details attached to that number
(customer name)
(customer address)
I would be really greatful.
Thanks.
which would then display the details attached to that number
(customer name)
(customer address)
I would be really greatful.
Thanks.
ASKER
Adjusted points to 75
if Data is a Record then
you have to explain where is the data stored ( in a File or in tha Ram "array").
after that you have to search about
your record match with Customer Number
and then Display other Info(name,address,...).
Bakry
you have to explain where is the data stored ( in a File or in tha Ram "array").
after that you have to search about
your record match with Customer Number
and then Display other Info(name,address,...).
Bakry
Why the rejection? Please explain your question more clearly. Do you understand records and arrays?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This Procedure :
For Counter:=1 to MaxCust do
BEGIN
if Customers[Counter].custid
= custid
begin
writeln('Id : ',Customers[counter].custi d;
writeln('Name : ',Customers[counter].name;
writeln('Adress : ',Customers[counter].adres s;
make a search through your array, and give you the result on the screen if it could find a match(custid in array = the custid you typed in).
For Counter:=1 to MaxCust do
BEGIN
if Customers[Counter].custid
= custid
begin
writeln('Id : ',Customers[counter].custi
writeln('Name : ',Customers[counter].name;
writeln('Adress : ',Customers[counter].adres
make a search through your array, and give you the result on the screen if it could find a match(custid in array = the custid you typed in).
ASKER
Cheers Mate!!!!!!!!!!!!!!!!!!!
Take a look at the example
Program Name;
uses crt;
type Customer = record
Name : string;
Adress : string;
end;
var Customers : array[1..3] of Customer;
procedure WriteCustomer(C : Customer);
begin
Writeln('Name : ', C.Name);
Writeln('Adress : ', C.Adress);
Writeln;
end;
begin
Customers[1].Name := 'Heini';
Customers[1].Adress := 'keen road 8';
Customers[2].Name := 'Rolfs';
Customers[2].Adress := 'torp road 1';
{etc. etc.}
Writeln('First Customer')
WriteCustomer(Customers[1]
Writeln('Second Customer')
WriteCustomer(Customers[2]
end.