<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'making a calculator using records, pointers and links.' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'making a calculator using records, pointers and links.' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 00:02:07 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 00:02:07 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>making a calculator using records, pointers and links.</title>
      <link>http://www.programmersheaven.com/mb/pasprog/283116/283116/making-a-calculator-using-records-pointers-and-links/</link>
      <description>hey, im trying to work with records and pointers. i have to make a calculator that will calculator any question that i input. the trouble im having is that i dont' know how to find doing the calculation part. i have the equation down, but now im stuck on how to start the calculation. thanks for the help. bye&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
program pointers6a (input, output);&lt;br /&gt;
&lt;br /&gt;
type&lt;br /&gt;
   onepoint = ^one;&lt;br /&gt;
   one      = record&lt;br /&gt;
                   numb   : integer;  {the number in the equation}&lt;br /&gt;
                   oper   : char;     {the operator in the equation}&lt;br /&gt;
                   next   : onepoint; {move to the next node}&lt;br /&gt;
              end;        &lt;br /&gt;
   &lt;br /&gt;
const space = ' ';&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
   p1, {first numbers for the equation}&lt;br /&gt;
   p2, {second numbers for the equation}&lt;br /&gt;
   start, {beginning of the node}&lt;br /&gt;
   tail   {end of node}&lt;br /&gt;
   : onepoint;&lt;br /&gt;
   temp : integer;&lt;br /&gt;
   num    {true or false}&lt;br /&gt;
   : boolean;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
procedure printlist (p1 : onepoint);&lt;br /&gt;
{*************************************************
******************&lt;br /&gt;
***********&lt;br /&gt;
purpose:to display the original equation on the screen for user to v&lt;br /&gt;
iew.&lt;br /&gt;
input:the equation in which the user types in.&lt;br /&gt;
output:the equation of what the user has typed in.&lt;br /&gt;
**************************************************
******************&lt;br /&gt;
**********}&lt;br /&gt;
begin&lt;br /&gt;
   while (p1 &amp;lt;&amp;gt; tail) do&lt;br /&gt;
   begin&lt;br /&gt;
      if(p1^.numb &amp;gt; 0) and  (p1^.numb &amp;lt; 1000) then&lt;br /&gt;
         write (p1^.numb);&lt;br /&gt;
      if(p1^.oper in['+', '-', '*', '/']) then&lt;br /&gt;
  write(p1^.oper);&lt;br /&gt;
      p1:=p1^.next;&lt;br /&gt;
   end;&lt;br /&gt;
end; { printlist }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
begin {main program}&lt;br /&gt;
   num := true; &lt;br /&gt;
   new(start);&lt;br /&gt;
   read(temp);&lt;br /&gt;
   start^.numb := temp;&lt;br /&gt;
   start^.oper:= space;&lt;br /&gt;
   start^.next:=nil;&lt;br /&gt;
   tail:= start; {set tail to the beginning}&lt;br /&gt;
   p1:= start; {set p1 to the beginning}&lt;br /&gt;
   p2:= start; {set p2 to the beginning}&lt;br /&gt;
&lt;br /&gt;
   while (tail^.oper &amp;lt;&amp;gt; '=') do&lt;br /&gt;
   begin&lt;br /&gt;
      new(p1);&lt;br /&gt;
      p1^.next := nil;&lt;br /&gt;
      if (num) then&lt;br /&gt;
      begin&lt;br /&gt;
         read(p1^.oper);&lt;br /&gt;
         p1^.numb:=0;&lt;br /&gt;
         num:= false;&lt;br /&gt;
      end&lt;br /&gt;
      else&lt;br /&gt;
      begin&lt;br /&gt;
         read(p1^.numb);&lt;br /&gt;
         p1^.oper:=space;&lt;br /&gt;
         num:=true;&lt;br /&gt;
      end;&lt;br /&gt;
      p2^.next:= p1;&lt;br /&gt;
      p2 := p1;&lt;br /&gt;
      tail:=p1;&lt;br /&gt;
   end;&lt;br /&gt;
      printlist(start); {printing out the equation from printlist procedure}&lt;br /&gt;
   evaluate(p1);&lt;br /&gt;
end.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/283116/283116/making-a-calculator-using-records-pointers-and-links/</guid>
      <pubDate>Mon, 29 Nov 2004 11:18:13 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>