Procedure 
Author Message
 Procedure

hi there,
           i am trying out a program that deals with stock.
I have got the following procedure from the program and I was
wondering what the syntax is for searching for a item in the
stock list and producing that data on the screen itself.

This procedure gets the stock details and produces the details in
a table. I was wondering how you number the items of stock that
is inputted into the system, so you get a list like the
following:

                        Stock File

        Item            Price           StockCode       Location

1.      -                 -                -              -
2.      -                 -                -              -
3.      -                 -                -              -
4.
 .
 .
 .
8.

Procedure Display_File_Contents(var FileName:SalesFile);
    var
       StockRec:SalesDetails;
       choice:char;

    begin
         clrscr;
              gotoxy(22,2);
              writeln('Stock File');
              gotoxy(22,3);
              writeln('---------------');
              gotoxy(0,5);

writeln('____________________________________________________');
              gotoxy(1,4);
              writeln('Item');
              gotoxy(16,4);
              writeln('Price');
              gotoxy(28,4);
              writeln('StockCode');
              gotoxy(44,4);
              writeln('Location');
              writeln;

              reset(FileName);
              while not Eof(FileName) do
                 begin
                    read(FileName,StockRec);
                    writeln('
',StockRec.Item,' ':16-length(StockRec.Item),
                    Stockrec.Price,'
':10-length(Stockrec.Price),Stockrec.stock_code,' ':15

-length(StockRec.stock_code),Stockrec.location);

              end;
           writeln;
           WRITE('Press a key to return to menu:  ');
           readkey;

          end;

Is it simple or am I plain stupid!! Please help me I am going mad
trying to sort it.

Thanks

Greg Stone

* Sent from RemarQ http://www.*-*-*.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Calling a procedure within a procedure

2. HELP - calling a Procedure from with a Procedure??

3. re : main-->procedure coomunication + Menu Procedure

4. Using a Procedure within a Procedure?

5. Procedure as parameter in procedure

6. Fast PutCharacter Procedure &/or remove cursor procedure

7. fast putchar procedure and remove cursor procedure needed for lord II type game

8. passing procedures as arguments for another procedure in Turbo pascal

9. passing procedures as arguments for another procedure in Turbo pascal

10. passing procedures as arguments for another procedure in Tu

11. procedure inside of a procedure

12. Passing a pointer to a procedure/function as a parameter in a procedure

 

 
Powered by phpBB® Forum Software