Pascal calculator program

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Reply

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

Re: Pascal calculator program

 
0
  #61
Nov 29th, 2007
I think it would be easiest to use an array of chars. Say this for example (if it works)

Pascal and Delphi Syntax (Toggle Plain Text)
  1.  
  2. Var
  3. myEquation : array[1..256] of char;
  4. Equ : string[255];
  5. my_file :text;
  6.  
  7. BEGIN
  8.  
  9. assign(my_file, 'input.txt');
  10. reset(my_file);
  11. read(my_file, Equ);
  12. myEquation := Equ
  13.  
  14. Writeln(myEquation[1..10])

not sure if this helps at all, but that would atleast put my equation into the array and display the equation (had the writeln to make sure the equation was in the array)
Last edited by Gotovina7; Nov 29th, 2007 at 9:47 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 44
Reputation: Gotovina7 is an unknown quantity at this point 
Solved Threads: 0
Gotovina7 Gotovina7 is offline Offline
Light Poster

Re: Pascal calculator program

 
0
  #62
Nov 29th, 2007
Hey man, I totally appreciate all the help you've given me during this massive thread (and I have learnt stuff). But this assignment is due tomorrow, so I am just going to throw together what I have and hope for the best.

THe next assignment I have is the same concept but I am suppose to use linked lists as the main storage of the equation (records and arrays are allowed)
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,953
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Pascal calculator program

 
0
  #63
Nov 30th, 2007
Ah well, sorry I didn't see this sooner. If it is due today then there's not much more to do here.

If all you wanted to do was store your equation as a string (an array of characters), then we've gone in loops for the wrong assignment.

All the stuff you've done helps, and will help you in your next assignment especially...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC