RSS Forums RSS
Please support our Pascal and Delphi advertiser: Programming Forums

Pascal calculator program

Join Date: Nov 2007
Posts: 44
Reputation: Gotovina7 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Gotovina7 Gotovina7 is offline Offline
Light Poster

Re: Pascal calculator program

  #12  
Nov 17th, 2007
Something still isn't right, this is what I have

 Program Lesson9_Program(input, output);

Type
   Str25          = String[25];
tEquation = Record
               num                          : Str25;
               add,subtract,multiply,divide : Str25;
            end;


Var file1     : Text;
   eq1        : String[255];
   eq2        : string[255];
   myEquation : tEquation;
   myeqArray  : array[1..50] of tEquation;

Begin

   Assign(file1,'input.txt');
   Reset(file1);
   If (IOResult <> 0) then
   Begin
      Writeln('The file required to be opened is not found!');
      Readln;
   End Else
   Begin
      readln(file1, eq1);
      Writeln('The first line of the file reads: ',eq1);
      readln(file1, eq2);
      writeln('The second line of the file reads: ',eq2);
  End;









end.

Do I have an error somewhere in my record or Array? I can't seem to get my equation into an array. Sorry I am new to programming.
Last edited by Gotovina7 : Nov 17th, 2007 at 6:43 pm.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:00 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC