<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Pascal Feed - Programmer's Heaven</title>
    <link>http://www.programmersheaven.com/feed/Tag/1690/RSS.aspx</link>
    <description>Events at Programmer's Heaven related to Pascal.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Thu, 09 Feb 2012 06:29:04 -0800</pubDate>
    <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>
    <item>
      <title>Peganza Software</title>
      <link>http://www.programmersheaven.com/link/10825-Peganza+Software/info.aspx</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Christer/"&gt;Christer&lt;/a&gt; submitted a new &lt;a href="http://www.programmersheaven.com/link/10825-Peganza+Software/info.aspx"&gt;link&lt;/a&gt;.&lt;/p&gt;Is a company specializing in tools for Delphi and Pascal 
developers. Our main product is Pascal Analyzer, a Windows 
program that helps Delphi and Borland Pascal developers 
measure, check, and document their source code. Pascal Analyzer 
(or PAL for short) is a development tool that makes software 
projects of any size easier to understand and enables 
developers to produce more flawless and reliable code. PAL 
contains numerous optimization, validation, and documentation 
features, which help in fine-tuning and managing the 
development process.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/link/10825-Peganza+Software/info.aspx</guid>
      <pubDate>Fri, 29 Apr 2011 08:44:04 -0800</pubDate>
    </item>
    <item>
      <title>Peganza Software</title>
      <link>http://www.programmersheaven.com/link/10825-Peganza+Software/info.aspx</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Christer/"&gt;Christer&lt;/a&gt; submitted a new &lt;a href="http://www.programmersheaven.com/link/10825-Peganza+Software/info.aspx"&gt;link&lt;/a&gt;.&lt;/p&gt;Is a company specializing in tools for Delphi and Pascal 
developers. Our main product is Pascal Analyzer, a Windows 
program that helps Delphi and Borland Pascal developers 
measure, check, and document their source code. Pascal Analyzer 
(or PAL for short) is a development tool that makes software 
projects of any size easier to understand and enables 
developers to produce more flawless and reliable code. PAL 
contains numerous optimization, validation, and documentation 
features, which help in fine-tuning and managing the 
development process.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/link/10825-Peganza+Software/info.aspx</guid>
      <pubDate>Fri, 29 Apr 2011 08:41:12 -0800</pubDate>
    </item>
    <item>
      <title>Re: copy a 2d array to another</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419898/419968/ReadMessage.aspx#419968</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Malekovits/"&gt;Malekovits&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/419898/419968/ReadMessage.aspx#419968"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;I tried to put it in my code, but it doesn't work... I thing because the arrays I use are char type. Also the arrays are records etc &lt;br /&gt;
a[i].mat[j,k].&lt;br /&gt;
&lt;br /&gt;
If I use SizeOf() for the count, is it going to work???</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/419898/419968/ReadMessage.aspx#419968</guid>
      <pubDate>Sun, 28 Nov 2010 05:05:20 -0800</pubDate>
    </item>
    <item>
      <title>Re: copy a 2d array to another</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419898/419956/ReadMessage.aspx#419956</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Malekovits/"&gt;Malekovits&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/419898/419956/ReadMessage.aspx#419956"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;OK!! I didn't knew that dos in windows(xp) is like java! (virtual machine)&lt;img src="http://www.programmersheaven.com/images/Community/embar.gif" width="15" height="15" alt="" /&gt;! Of course I run my program using dos box! Well, I know its not the best way to make a program and run it, but I know good pascal, that's why I use it. Also I use BP because I like the environment (the editor), free pascal is not so pleasant environment to work... I am trying to make a 3d renderer (not raytracer). Until now, I've made a 2d rotating triangle, and I have made a framebuffer-like effect (motion-blur) as the triangle rotates, and this has 5 arrays that one is copied to another, that's why I need a the copyselective function of yours.&lt;br /&gt;
&lt;br /&gt;
here is the first image ever:&lt;br /&gt;
&lt;img src="http://img.photobucket.com/albums/v327/Malekovits/5c1b8b60.jpg" /&gt;&lt;br /&gt;
and here is using graph and a fill code I made to fill the triangle! (I am using graph only to have a pixel output):&lt;br /&gt;
&lt;img src="http://img.photobucket.com/albums/v327/Malekovits/trid.jpg" /&gt;&lt;br /&gt;
&lt;br /&gt;
(The frame-buffer effect in not in these images, I haven't post any image with the effect)&lt;br /&gt;
&lt;br /&gt;
One thing I noticed, (maybe it's stupid what I am saying but I don't know what to do) is that the function(s) you wrote are being used in a single-dimension array &lt;br /&gt;
&lt;br /&gt;
copyselective(a1,a2,&lt;span style="text-decoration: underline;"&gt;20&lt;/span&gt;,5)   &lt;br /&gt;
&lt;br /&gt;
The 20 is for the count, right? But what if I want to use it in a 2d array???</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/419898/419956/ReadMessage.aspx#419956</guid>
      <pubDate>Sat, 27 Nov 2010 03:25:38 -0800</pubDate>
    </item>
    <item>
      <title>Re: copy a 2d array to another</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419898/419946/ReadMessage.aspx#419946</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Malekovits/"&gt;Malekovits&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/419898/419946/ReadMessage.aspx#419946"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Ok, I am going to give it a try! Unfortunately I haven't still work with dynamic variables (pointers), and this and assembly code is difficult for me to understand... By the way, what do you mean that its going to be 2x faster in 32bit?? How to do this (if use a 32bit pascal, right?) ? Anyway, thanks man! Once I put it in my program I am making,I am going to post again!</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/419898/419946/ReadMessage.aspx#419946</guid>
      <pubDate>Fri, 26 Nov 2010 15:25:25 -0800</pubDate>
    </item>
    <item>
      <title>Re: copy a 2d array to another</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419898/419912/ReadMessage.aspx#419912</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Malekovits/"&gt;Malekovits&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/419898/419912/ReadMessage.aspx#419912"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Thanks a lot, but I can't understand it, because I know nothing about assembly.. Of course the simple assumption you said has a loop inside it, but as I can understand, its something like this:&lt;br /&gt;
&lt;br /&gt;
in the for-loop its going to start something and end it, about 10 x 10 = 100 times (start 100 times, stop 100 times):&lt;br /&gt;
&lt;br /&gt;
for i:=1 to 10 do&lt;br /&gt;
for j:=1 to 10 do&lt;br /&gt;
&lt;br /&gt;
but the simple assumption I thing its something like start something and end it, only for once, as I imagine, because it treats the array like a chain, so its way faster.&lt;br /&gt;
&lt;br /&gt;
All these years that i know some pascal, I always used the for loops for arrays and just about 2 days ago I saw in the net the simple assumption &lt;img src="http://www.programmersheaven.com/images/Community/embar.gif" width="15" height="15" alt="" /&gt;!!! ant the fillchar function that can "erase" an array blazingly fast!!! Yes, something very very simple and I didn't thought it before!!!&lt;br /&gt;
&lt;br /&gt;
I was hoping for something like a function to copy arrays that might have parametres to set, statements.. Unfortunately, I don't have any idea about assembly code..</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/419898/419912/ReadMessage.aspx#419912</guid>
      <pubDate>Thu, 25 Nov 2010 04:07:30 -0800</pubDate>
    </item>
    <item>
      <title>copy a 2d array to another</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419898/419898/ReadMessage.aspx#419898</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Malekovits/"&gt;Malekovits&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/419898/419898/ReadMessage.aspx#419898"&gt;new message&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Hi! I know that there are some ways for copying (2d)arrays in pascal (I use borland pascal). One is to use for-loops and the other one is to use something like array1:=array2. That's what i know so far. Of course i know that there is the fillchar that fills an array with a specified character. I wonder how to do this without for-loops:&lt;br /&gt;
&lt;br /&gt;
copy an array into another but only some elements. To be more specific, the array i want to copy is char type, and it has empty elements(even if you don't put something, the space itself is a character.)that i dont want to be copied to the other array. Until now I did this with for-loops:&lt;br /&gt;
&lt;br /&gt;
for i:=1 to 10 do&lt;br /&gt;
for j:=1 to 10 do&lt;br /&gt;
if array1[i,j] &amp;lt;&amp;gt; '  ' do array2[i,j]:=array1[i,j];&lt;br /&gt;
&lt;br /&gt;
Is there any way that i can do the same thing without for loops? With for loops its very very slow, but when use something like array1:=array2 &lt;br /&gt;
its blazingly faster, but then you copy everything that array2 has, and I want NOT to copy the "empty" or " " characters (or any one else character that might be specified). Hope you understand what I am saying...</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/419898/419898/ReadMessage.aspx#419898</guid>
      <pubDate>Wed, 24 Nov 2010 15:03:12 -0800</pubDate>
    </item>
    <item>
      <title>how to blast an 2d array aout to screen without for-loops?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419665/419665/ReadMessage.aspx#419665</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Malekovits/"&gt;Malekovits&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/419665/419665/ReadMessage.aspx#419665"&gt;new message&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Hi all! I'm using borland pascal (1992) and I wonder how to blast an 2d array out to screen without using the standard two for-loops:&lt;br /&gt;
&lt;br /&gt;
for i:=1 to... do&lt;br /&gt;
begin&lt;br /&gt;
for j:=1 to... do&lt;br /&gt;
write....&lt;br /&gt;
writeln&lt;br /&gt;
&lt;br /&gt;
I wonder if there is something like the fillchar function, that if u use it you can "erase" the contents of an array in a simple function, without the for-loops, to write all the contents of an 2d array at once..</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/419665/419665/ReadMessage.aspx#419665</guid>
      <pubDate>Fri, 12 Nov 2010 05:22:42 -0800</pubDate>
    </item>
    <item>
      <title>Re: Need desperate help with quiz</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419238/419435/ReadMessage.aspx#419435</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/W.Peterson/"&gt;W.Peterson&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/419238/419435/ReadMessage.aspx#419435"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Well, you don't have to creat such a program to make a quiz like that. There are a couple of quiz makers that can be used to make the quiz you want, such as Proprofs quiz school, and Flash QuizCreator from Wondershare: &lt;a href="http://www.sameshow.com/quiz-creator.html#107"&gt;http://www.sameshow.com/quiz-creator.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Well, enjoy your quiz creation.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/419238/419435/ReadMessage.aspx#419435</guid>
      <pubDate>Mon, 01 Nov 2010 02:59:33 -0800</pubDate>
    </item>
    <item>
      <title>Re: Help on Pascal Program: Balance</title>
      <link>http://www.programmersheaven.com/mb/pasprog/415247/415347/ReadMessage.aspx#415347</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/415247/415347/ReadMessage.aspx#415347"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Your program seems to be a savings accumulation program.  Here's my solution.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
program balanceprog ; &lt;span style="color: Red;"&gt;{ my compiler, TP7.0, does not allow
                      the use of the word &lt;strong&gt;balance&lt;/strong&gt;
                      as both a program name and as a variable
                      so I've changed the name of the program. }&lt;/span&gt;

        procedure producetable (balance, rate : real) ;
            &lt;span style="color: Red;"&gt;{
                &lt;strong&gt;balance&lt;/strong&gt; and &lt;strong&gt;rate&lt;/strong&gt; are the only variables
                that need to be passed to the procedure.  The only
                other variable, &lt;strong&gt;lcount&lt;/strong&gt;, is only used locally
                and is declared as such.  In any case TP requires that
                index counters be declared locally.
            }&lt;/span&gt;

            procedure produceline (balance, rate : real) ;
                &lt;span style="color: Red;"&gt;{
                    &lt;strong&gt;produceline&lt;/strong&gt; is invoked only  by
                    &lt;strong&gt;producetable&lt;/strong&gt; so it is appropriate to nest
                    the latter within the former.
                }&lt;/span&gt;
    
            var
                vcount : integer ; &lt;span style="color: Red;"&gt;{ must be local }&lt;/span&gt;
    
            begin
                write(balance:7:0) ;
                write(rate:8:0) ;
    
                for vcount := 1 to 10 do begin
                    balance:= balance + (balance * rate / 100.0) ;
                    write(balance:6:0)
                end
            end ;
        
        var
            lcount : integer ;

        begin
            writeln ('year') ;
            write   ('balance rate(%)') ;
            for lcount := 1 to 10 do
                write (lcount:6) ;
            writeln ;

            for lcount := 1 to 5 do begin
                produceline (balance, rate) ;
                balance := balance + 100.0 ;
                writeln
            end
        end ;

var
    balance, rate   :   real ;  &lt;span style="color: Red;"&gt;{ real fits these variables
                                       better than integer }&lt;/span&gt;

begin
    writeln ;
    write ('enter balance and rate:') ;
    read (balance, rate) ;

    producetable (balance, rate) ;
    writeln
end.
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/415247/415347/ReadMessage.aspx#415347</guid>
      <pubDate>Sun, 11 Apr 2010 19:12:30 -0800</pubDate>
    </item>
    <item>
      <title>Re: Help on Pascal Program: Pressure</title>
      <link>http://www.programmersheaven.com/mb/pasprog/415248/415278/ReadMessage.aspx#415278</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/415248/415278/ReadMessage.aspx#415278"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;&lt;pre class="sourcecode"&gt;
program Pressures ;

CONST
    MAXREAL = 1.0E37 ;

type
    pressuretype = array [1 .. 1000] of real ;


    Procedure GetPressures (var n : integer ; var pressure : pressuretype) ;

    begin
        n := 1 ;

        writeln ('ENTER A NEGATIVE PRESSURE TO TERMINATE DATA INPUT.') ;
        writeln ;

        while TRUE do begin
            write ('ENTER PRESSURE #', n:0, ' ') ;
            readln (pressure[n]) ;
            if pressure[n] &amp;lt; 0.0 then begin
                n := n - 1 ;
                exit
            end ;
            n := n + 1
        end
    end ;


    procedure ProcessPressures (n                       : integer ;
                                pressure                : pressuretype ;
                                var
                                    high, low, average  : real) ;

    var
        total   :   real ;
        count   :   integer ;

    begin
        total   :=  0.0 ;
        count   :=  0 ;
        high    :=  pressure[1] ;
        low     :=  pressure[1] ;

        for count := 1 to n do begin
            total := total + pressure[count] ;
            if pressure[count] &amp;gt; high then
                high := pressure[count] ;
            if pressure[count] &amp;lt; low then
                low  := pressure[count]
        end ;

        average := total / count
    end ;


    procedure PrintSummaryResults  (n                   :   integer ;
                                    pressure            :   pressuretype ;
                                    high, low, average  :   real) ;

    var
        i   :   integer ;

    begin
        writeln('NUMBER OF INTERVALS TO MONITOR: ', n) ;
        writeln('**********************************') ;

        for i := 1 to n do
            writeln('PROCESS ', i:0, ' PRESSURE: ', pressure[i]:10:3);
        writeln ;
        if high &amp;gt; 5000.0 then
            writeln('DANGER! OVERPRESSURE OF ', high:0:3) ;
        if low &amp;lt; 14.0 then
            writeln('DANGER! VACUUM OF ', low:0:3) ;
        
        writeln('HIGH PRESSURE IS ', high:0:3) ;
        writeln('LOW PRESSURE IS ', low:0:3) ;
        writeln('AVERAGE PRESSURE IS ', average:0:3) ;
        writeln('************************************')
    end;


var
    n           :   integer ;
    pressure    :   pressuretype ;
    high,
    low,
    average     :   real ;

begin
    GetPressures (n, pressure) ;
    ProcessPressures (n, pressure, high, low, average);
    PrintSummaryResults (n, pressure, high, low, average);
end.
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/415248/415278/ReadMessage.aspx#415278</guid>
      <pubDate>Thu, 08 Apr 2010 20:32:00 -0800</pubDate>
    </item>
    <item>
      <title>Re: Please help i'm a beginner in pascal</title>
      <link>http://www.programmersheaven.com/mb/pasprog/413989/413995/ReadMessage.aspx#413995</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Predictor/"&gt;Predictor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/413989/413995/ReadMessage.aspx#413995"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;What have you written so far?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-Will Dwinnell&lt;br /&gt;
&lt;a href="http://matlabdatamining.blogspot.com/"&gt;Data Mining in MATLAB&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/413989/413995/ReadMessage.aspx#413995</guid>
      <pubDate>Sun, 28 Feb 2010 04:31:01 -0800</pubDate>
    </item>
    <item>
      <title>string editing</title>
      <link>http://www.programmersheaven.com/mb/pasprog/413915/413915/ReadMessage.aspx#413915</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/sviesusis_alus/"&gt;sviesusis_alus&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/413915/413915/ReadMessage.aspx#413915"&gt;new message&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;hey. what is the fastest way to cut some symbols at the end of string ?&lt;br /&gt;
for example:&lt;br /&gt;
from this: /home/justas/psc/test.pas&lt;br /&gt;
to make /home/justas/psc/test&lt;br /&gt;
&lt;br /&gt;
any suggestions ?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/413915/413915/ReadMessage.aspx#413915</guid>
      <pubDate>Thu, 25 Feb 2010 10:06:23 -0800</pubDate>
    </item>
    <item>
      <title>Re: arranging sorting an array</title>
      <link>http://www.programmersheaven.com/mb/pasprog/412937/413064/ReadMessage.aspx#413064</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/chineerat/"&gt;chineerat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/412937/413064/ReadMessage.aspx#413064"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;sorry for the double post</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/412937/413064/ReadMessage.aspx#413064</guid>
      <pubDate>Thu, 04 Feb 2010 11:50:56 -0800</pubDate>
    </item>
    <item>
      <title>arranging sorting an array</title>
      <link>http://www.programmersheaven.com/mb/pasprog/412937/412937/ReadMessage.aspx#412937</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/chineerat/"&gt;chineerat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/412937/412937/ReadMessage.aspx#412937"&gt;new message&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Hi!&lt;br /&gt;
i am having trouble sorting  an array using a for loop.&lt;br /&gt;
the problem occurs when using iterations i and i+1&lt;br /&gt;
&lt;br /&gt;
for example &lt;br /&gt;
count:=0&lt;br /&gt;
for i:=0 to count do begin&lt;br /&gt;
if a[i] &amp;gt; a[i+1] then begin&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
end &lt;br /&gt;
count+1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
problem is when the for loops reaches the LAST array value i , i+1 does not exist hence the problem.&lt;br /&gt;
I have tried using &lt;br /&gt;
" for i:=0 to count-1 do begin"&lt;br /&gt;
this does not help.&lt;br /&gt;
&lt;br /&gt;
any suggestions?&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/412937/412937/ReadMessage.aspx#412937</guid>
      <pubDate>Tue, 02 Feb 2010 23:47:03 -0800</pubDate>
    </item>
    <item>
      <title>Re: .dat files</title>
      <link>http://www.programmersheaven.com/mb/pasprog/410195/410224/ReadMessage.aspx#410224</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/410195/410224/ReadMessage.aspx#410224"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;It all depends on the layout of your .dat file for one.&lt;br /&gt;
&lt;br /&gt;
If you just mean find the two smallest values and there is one number on each line, you could just have two variables (small_1, small_2) and check each line to see if it's smaller.&lt;br /&gt;
&lt;br /&gt;
if your file looks like this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
14
3
7
321
25
5
19
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Steps&lt;br /&gt;
1) Set small_1 &amp;amp; small_2 to maximum size (65535 for WORD)&lt;br /&gt;
2) Check for end of file, if eof, goto 7)&lt;br /&gt;
3) Read number (n) from file&lt;br /&gt;
4) if n &amp;lt; small_1, set small_1 to n and goto 2)&lt;br /&gt;
5) if n &amp;lt; small_2, set small_2 to n and goto 2)&lt;br /&gt;
6) goto 2)&lt;br /&gt;
7) show small_1 &amp;amp; small_2&lt;br /&gt;
&lt;br /&gt;
That's it.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/410195/410224/ReadMessage.aspx#410224</guid>
      <pubDate>Wed, 02 Dec 2009 19:31:40 -0800</pubDate>
    </item>
    <item>
      <title>VGFX - Graphic Unit  for Free Pascal</title>
      <link>http://www.programmersheaven.com/download/22912/download.aspx</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/venom/"&gt;venom&lt;/a&gt; submitted a new &lt;a href="http://www.programmersheaven.com/download/22912/download.aspx"&gt;file&lt;/a&gt;.&lt;/p&gt;This unit was released in 2001.

VGFX is a very fast and easy to handle software graphic library for Free Pascal.
Full compatible with Windows 95/98/NT/ME/2000/XP.

VGFX allows you to enter all possible resolutions in high color (65536 colors).
There are tons of fast graphic functions written in assembler with MMX support.

For example sprite fading/scaling/rotation/alpha blending and PCX decoding.
A sample demo and a short tutorial are included.

No windows programming knowledge required!

Modification for FPC 2.X was done by godbeast</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/download/22912/download.aspx</guid>
      <pubDate>Thu, 26 Nov 2009 11:01:53 -0800</pubDate>
    </item>
    <item>
      <title>FAT12/FAT16 support.</title>
      <link>http://www.programmersheaven.com/mb/pasprog/408780/408780/ReadMessage.aspx#408780</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/lordestabia/"&gt;lordestabia&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/408780/408780/ReadMessage.aspx#408780"&gt;new message&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;I need to implement FAT12/FAT16 support in a project. Where an I get the specifications for it? Or is there any existing source code I can use for reference.&lt;br /&gt;
&lt;br /&gt;
Thank you in advance.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/408780/408780/ReadMessage.aspx#408780</guid>
      <pubDate>Tue, 03 Nov 2009 14:52:33 -0800</pubDate>
    </item>
    <item>
      <title>Re: im getting an error when using program.. compiles fine!</title>
      <link>http://www.programmersheaven.com/mb/pasprog/399536/399546/ReadMessage.aspx#399546</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/anthrax11/"&gt;anthrax11&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/399536/399546/ReadMessage.aspx#399546"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;With such equations you need to make some checks first. Check that a isn't 0, because you can't divide by 0. Also check that b*b-4ac isn't negative, because you can't root a negative number. If the conditions aren't met, then there are no solutions and the program should handle that.&lt;br /&gt;
&lt;br /&gt;
Usually the best thing to do in these situations is to debug the program.&lt;br /&gt;
&lt;br /&gt;
And the quadratic formula should be:&lt;br /&gt;
x:=(-b+sqrt((b*b)-(4*a*c)))/2*a;&lt;br /&gt;
instead of:&lt;br /&gt;
x:=-b+sqrt(((b*b)-(4*a*c))/2*a);</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/399536/399546/ReadMessage.aspx#399546</guid>
      <pubDate>Wed, 23 Sep 2009 07:05:21 -0800</pubDate>
    </item>
    <item>
      <title>Re: Exit the program</title>
      <link>http://www.programmersheaven.com/mb/pasprog/397311/399093/ReadMessage.aspx#399093</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/397311/399093/ReadMessage.aspx#399093"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;EXIT will leave a procedure/function, HALT will leave the program.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/397311/399093/ReadMessage.aspx#399093</guid>
      <pubDate>Mon, 21 Sep 2009 20:57:09 -0800</pubDate>
    </item>
    <item>
      <title>Re: Solved?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/359838/396596/ReadMessage.aspx#396596</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Laaca/"&gt;Laaca&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/359838/396596/ReadMessage.aspx#396596"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;SOLVED!&lt;br /&gt;
Try this source:&lt;br /&gt;
&lt;br /&gt;
uses Graph,Crt;&lt;br /&gt;
&lt;br /&gt;
type TBod = object&lt;br /&gt;
     x,y:real;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
     Tkruh = object(TBod)&lt;br /&gt;
     r:real;&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
const delta=0.0000001;&lt;br /&gt;
      max_bod = 6;&lt;br /&gt;
&lt;br /&gt;
{     specbody:array[0..max_bod] of TBod = ((x:408;y:313),&lt;br /&gt;
                                            (x:406;y:215),&lt;br /&gt;
                                            (x:311;y:151),&lt;br /&gt;
                                            (x:225;y:309),&lt;br /&gt;
                                            (x:330;y:245));}&lt;br /&gt;
&lt;br /&gt;
var barva:byte;&lt;br /&gt;
    body:array[0..max_bod] of TBod;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Function IsEqual(a,b:real):boolean;&lt;br /&gt;
begin&lt;br /&gt;
IsEqual:=(a&amp;lt;b+delta) and (a&amp;gt;b-delta);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
Function IsLessOrEqual(a,b:real):boolean;&lt;br /&gt;
begin&lt;br /&gt;
IsLessOrEqual:=(a&amp;lt;b) or IsEqual(a,b);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Function Vzdalenost(a1,a2:Tbod):real;&lt;br /&gt;
{Vrati vzdalenost mezi dvema body}&lt;br /&gt;
var n1,n2:real;&lt;br /&gt;
begin&lt;br /&gt;
n1:=sqr(a1.x-a2.x);&lt;br /&gt;
n2:=sqr(a1.y-a2.y);&lt;br /&gt;
Vzdalenost:=sqrt(n1+n2);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
procedure Kruznice3(a1,a2,a3:Tbod;var t:Tkruh);&lt;br /&gt;
{Sestroji kruznici ze 3 bodu. Pokus jsou v primce (netvori trojuhelnik), tak}&lt;br /&gt;
{ji sestroji ze dvou krajnich bodu usecky}&lt;br /&gt;
var a,b,c,d,e,f,g:real;&lt;br /&gt;
begin&lt;br /&gt;
  a:=a2.x - a1.x;&lt;br /&gt;
  b:=a2.y - a1.y;&lt;br /&gt;
  c:=a3.x - a1.x;&lt;br /&gt;
  d:=a3.y - a1.y;&lt;br /&gt;
  e:=A * (a1.x + a2.x) + B * (a1.y + a2.y);&lt;br /&gt;
  f:=C * (a1.x + a3.x) + D * (a1.y + a3.y);&lt;br /&gt;
  g:=2.0 * (A * (a3.y - a2.y) - B * (a3.x - a2.x));&lt;br /&gt;
  if IsEqual(g,0) then  {lepsi nez if G=0}&lt;br /&gt;
     begin&lt;br /&gt;
     a:=Vzdalenost(a1,a2);&lt;br /&gt;
     b:=Vzdalenost(a1,a3);&lt;br /&gt;
     c:=Vzdalenost(a2,a3); {udelame, aby A bylo nejvetsi}&lt;br /&gt;
     if (a&amp;gt;b) then&lt;br /&gt;
        if (a&amp;gt;c) then begin d:=a;end else&lt;br /&gt;
                      begin d:=c;a1:=a2;a2:=a3;end else&lt;br /&gt;
     {b&amp;gt;=a}&lt;br /&gt;
        if (b&amp;gt;c) then begin d:=b;a2:=a3;end else&lt;br /&gt;
                      begin d:=c;a1:=a2;a2:=a3;end;&lt;br /&gt;
&lt;br /&gt;
     t.x:=(a1.x+a2.x) / 2;&lt;br /&gt;
     t.y:=(a1.y+a2.y) / 2;&lt;br /&gt;
     t.r:=d / 2;&lt;br /&gt;
     Exit;&lt;br /&gt;
     end;&lt;br /&gt;
  t.x := (D * E - B * F) / G;&lt;br /&gt;
  t.y := (A * F - C * E) / G;&lt;br /&gt;
  t.r := Vzdalenost(a1,t);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Function MaxDistance(var a,b:longint):real;&lt;br /&gt;
{vrati maximalni vzdalenost mezi body v poli}&lt;br /&gt;
var i,j:longint;&lt;br /&gt;
    k,max:real;&lt;br /&gt;
begin&lt;br /&gt;
max:=0;&lt;br /&gt;
for i:=0 to max_bod-1 do&lt;br /&gt;
    for j:=i+1 to max_bod do&lt;br /&gt;
        begin&lt;br /&gt;
        k:=Vzdalenost(body[i],body[j]); {zmerim vzdalenost vsech bodu}&lt;br /&gt;
        if k&amp;gt;max then&lt;br /&gt;
           begin&lt;br /&gt;
           max:=k;&lt;br /&gt;
           a:=i;&lt;br /&gt;
           b:=j;&lt;br /&gt;
           end;&lt;br /&gt;
        end;&lt;br /&gt;
MaxDistance:=max;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Function MaxDistanceToPoint(p:Tbod):real;&lt;br /&gt;
{maximalni vzdalenost bodu v poli vhledem k P}&lt;br /&gt;
var v,w:real;&lt;br /&gt;
    i:longint;&lt;br /&gt;
begin&lt;br /&gt;
w:=0;&lt;br /&gt;
for i:=0 to max_bod do&lt;br /&gt;
    begin&lt;br /&gt;
    v:=Vzdalenost(p,body[i]);&lt;br /&gt;
    if v&amp;gt;w then w:=v;&lt;br /&gt;
    end;&lt;br /&gt;
MaxDistanceToPoint:=w;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
Procedure ZjistiObklopujiciKruznici(var z:Tkruh);&lt;br /&gt;
{sestroji nejmensi obklopujici kruznici}&lt;br /&gt;
var s:tbod;&lt;br /&gt;
    a,b,c:longint;&lt;br /&gt;
    v,w:real;&lt;br /&gt;
    h:TKruh;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
v:=MaxDistance(a,b);             {zjisti nejdelsi vzdalenost mezi body a take}&lt;br /&gt;
                                 {o ktere body jde}&lt;br /&gt;
s.x:=(body[a].x+body&lt;strong&gt;.x) / 2;&lt;br /&gt;
s.y:=(body[a].y+body&lt;strong&gt;.y) / 2;  {na teto usecce udela stred S}&lt;br /&gt;
&lt;br /&gt;
w:=MaxDistanceToPoint(s);&lt;br /&gt;
{a zjisti, jestli je nejaky bod dal od S nez krajni body usecky}&lt;br /&gt;
&lt;br /&gt;
if IsLessOrEqual(w,v/2) then&lt;br /&gt;
{kdyz ne, tak vime, ze je kruznice tvorena dvema body}&lt;br /&gt;
   begin&lt;br /&gt;
   barva:=5;&lt;br /&gt;
   z.x:=s.x;&lt;br /&gt;
   z.y:=s.y;&lt;br /&gt;
   z.r:=v/2;&lt;br /&gt;
   end&lt;br /&gt;
   else begin&lt;br /&gt;
   {existuje bod, ktery je dal od S nez krajni body usecky.&lt;br /&gt;
   {V tom pripade bude kruznice definovana tremi body, pricemz ale mezi nimi&lt;br /&gt;
    nemusi nutne byt body A a B. Je tedy treba proscanovat vsechny myslitelne&lt;br /&gt;
    trojuhelniky, ktere je mozno z definovanych bodu sestavit a hledat jim&lt;br /&gt;
    opsane kruznice}&lt;br /&gt;
   z.r:=0;&lt;br /&gt;
   for a:=0 to max_bod-2 do&lt;br /&gt;
       for b:=a+1 to max_bod-1 do&lt;br /&gt;
           for c:=b+1 to max_bod do&lt;br /&gt;
               begin&lt;br /&gt;
               {tento trojnasobny cyklus proscanuje vsechny myslitelne trojuhelniky}&lt;br /&gt;
               Kruznice3(body[a],body&lt;strong&gt;,body[c],h);&lt;br /&gt;
               s.x:=h.x;&lt;br /&gt;
               s.y:=h.y;&lt;br /&gt;
&lt;br /&gt;
               w:=MaxDistanceToPoint(s);&lt;br /&gt;
               if IsLessOrEqual(w,h.r) then&lt;br /&gt;
                   if (z.r=0) or (h.r&amp;lt;z.r) then z:=h;&lt;br /&gt;
               end;&lt;br /&gt;
   end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Procedure NakresliScenu(z:TKruh);&lt;br /&gt;
var a:byte;&lt;br /&gt;
begin&lt;br /&gt;
SetColor(4);&lt;br /&gt;
Circle(round(z.x),round(z.y),round(z.r));&lt;br /&gt;
for a:=0 to max_bod do&lt;br /&gt;
    PutPixel(round(body[a].x),round(body[a].y),14);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{-----------------------------------------------------------------}&lt;br /&gt;
&lt;br /&gt;
var gd,gm:integer;&lt;br /&gt;
    z:Tkruh;&lt;br /&gt;
    a:longint;&lt;br /&gt;
    r1,r2:real;&lt;br /&gt;
    c:char;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
randomize;&lt;br /&gt;
gd:=vga;gm:=vgahi;InitGraph(gd,gm,'');&lt;br /&gt;
OutText('Pro ukonceni zmackni ESC, pro dalsi sestavu jakoukoliv jinou klavesu');&lt;br /&gt;
SetFillStyle(0,0);&lt;br /&gt;
&lt;br /&gt;
repeat&lt;br /&gt;
Bar(0,20,639,479);&lt;br /&gt;
for a:=0 to max_bod do&lt;br /&gt;
    begin&lt;br /&gt;
    r1:=random(200);&lt;br /&gt;
    r2:=random(200);&lt;br /&gt;
    body[a].x:=r1-100+320;&lt;br /&gt;
    body[a].y:=r2-100+240;&lt;br /&gt;
    end;&lt;br /&gt;
&lt;br /&gt;
ZjistiObklopujiciKruznici(z);&lt;br /&gt;
NakresliScenu(z);&lt;br /&gt;
&lt;br /&gt;
repeat until keypressed;&lt;br /&gt;
c:=readkey;&lt;br /&gt;
while keypressed do readkey;&lt;br /&gt;
&lt;br /&gt;
until c=#27;&lt;br /&gt;
CloseGraph;&lt;br /&gt;
end.&lt;br /&gt;
&lt;/strong&gt;&lt;/strong&gt;&lt;/strong&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/359838/396596/ReadMessage.aspx#396596</guid>
      <pubDate>Sat, 05 Sep 2009 14:29:45 -0800</pubDate>
    </item>
    <item>
      <title>Re: would error occurs?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/395453/395610/ReadMessage.aspx#395610</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/395453/395610/ReadMessage.aspx#395610"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;The code should run, but after a while it will run out of memory.&lt;br /&gt;
&lt;br /&gt;
Basically, here's what is happening. When you call a procedure, Pascal stores information so that you still have the information when you leave the procedure.&lt;br /&gt;
&lt;br /&gt;
In this case, when BOOK calls MENU, the computer stores info.&lt;br /&gt;
When MENU calls STORE, it stores more info.&lt;br /&gt;
When STORE calls MENU, it stores more info.&lt;br /&gt;
&lt;br /&gt;
Now if you keep calling these two procedures back and forth, it keeps storing info until you run out of memory.&lt;br /&gt;
&lt;br /&gt;
If you look at procedures like a list, after pushing '1' 5 times, it would be:&lt;br /&gt;
&lt;br /&gt;
BOOK -&amp;gt; MENU -&amp;gt; STORE -&amp;gt; MENU -&amp;gt; STORE -&amp;gt; MENU -&amp;gt; STORE&lt;br /&gt;
&lt;br /&gt;
This could just keep growing.&lt;br /&gt;
When a procedure ends, it goes back to the point in the code that it was called.&lt;br /&gt;
&lt;br /&gt;
So if we change STORE to this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
procedure store;
var store_choice : integer;
begin
     repeat
           readln(store_choice);
     until (store_choice = 1);
end;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Then after pushing '1' 5 times, the list would look like:&lt;br /&gt;
&lt;br /&gt;
BOOK -&amp;gt; MENU -&amp;gt; STORE&lt;br /&gt;
&lt;br /&gt;
If you are still confused, look at this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
01: procedure menu;
02: var choice : integer;
03: begin
04:       readln(choice);
05:       If choice = 1 then
06:          store
07: end;
08:
09: procedure store;
10: var store_choice : integer;
11: begin
12:     repeat
13:           readln(store_choice);
14:     until (store_choice = 1);
15: end;
16:
17: program book;
18: begin
19:      menu
20: end.
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Using the line #s above, if we run your program this is how it would execute:&lt;br /&gt;
&lt;span style="color: Green;"&gt;18,19,&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Green;"&gt;03,04&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Red;"&gt;PUSH '1'&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Green;"&gt;05,06&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Green;"&gt;11,12,13&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Red;"&gt;PUSH '2'&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Green;"&gt;14,12,13&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Red;"&gt;PUSH '1'&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Green;"&gt;14,15&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Green;"&gt;7&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: Green;"&gt;20&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you follow the above line numbers you will see how it works. If you want to allow more than one visit to the STORE, you can put a loop in the MENU procedure as well.&lt;br /&gt;
&lt;br /&gt;
Hope this clears things up a bit.&lt;br /&gt;
&lt;br /&gt;
EDIT: Of course, looking at this again, I doubt that your error has to do with Out of Memory as each section of information that is stored is only around 10-20 bytes, so even if you only have 1MB of memory in your computer, it would still take you about 500,000 presses of '1' to run out of memory.&lt;br /&gt;
If this is the case, you need to start pressing a different key ;)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/395453/395610/ReadMessage.aspx#395610</guid>
      <pubDate>Sun, 23 Aug 2009 15:42:02 -0800</pubDate>
    </item>
    <item>
      <title>Re: Turbo Pascal Printing on USB</title>
      <link>http://www.programmersheaven.com/mb/pasprog/395191/395263/ReadMessage.aspx#395263</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/395191/395263/ReadMessage.aspx#395263"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;I don't tink so. Iou would probably have a better chance finding a program that emulates the USB printer port on the LPT1 port.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/395191/395263/ReadMessage.aspx#395263</guid>
      <pubDate>Mon, 17 Aug 2009 19:29:57 -0800</pubDate>
    </item>
    <item>
      <title>Re: Random Lotto</title>
      <link>http://www.programmersheaven.com/mb/pasprog/395155/395262/ReadMessage.aspx#395262</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/395155/395262/ReadMessage.aspx#395262"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;This would be the same idea as the post I just replied to:&lt;br /&gt;
&lt;a href="http://www.programmersheaven.com/mb/pasprog/394632/394663/re-help-with-random-please/?S=B20000#394663"&gt;http://www.programmersheaven.com/mb/pasprog/394632/394663/re-help-with-random-please/?S=B20000#394663&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Just have a section that lets ou manually enter the numbers and then use this to mix them up.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/395155/395262/ReadMessage.aspx#395262</guid>
      <pubDate>Mon, 17 Aug 2009 19:27:51 -0800</pubDate>
    </item>
    <item>
      <title>Re: Pascal language users</title>
      <link>http://www.programmersheaven.com/mb/pasprog/393913/395174/ReadMessage.aspx#395174</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/393913/395174/ReadMessage.aspx#395174"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;:&lt;br /&gt;
: Pascal can't make programs with normal window&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
Neither can C or C++, you have to use Visual C or Visual C++.&lt;br /&gt;
&lt;br /&gt;
Delphi is Visual Pascal.  Apparently Borland could not call it Visual Pascal due to trademark restrictions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/393913/395174/ReadMessage.aspx#395174</guid>
      <pubDate>Sun, 16 Aug 2009 00:28:31 -0800</pubDate>
    </item>
    <item>
      <title>Re: Help with random please</title>
      <link>http://www.programmersheaven.com/mb/pasprog/394632/394663/ReadMessage.aspx#394663</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/394632/394663/ReadMessage.aspx#394663"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;&lt;pre class="sourcecode"&gt;
VAR
   numArray : Array[1..20] Of Byte;
   i,
   y1,
   y2,
   temp  : Byte;

Begin
     { Fill an array in order }
     For i := 1 to 20 do
         numArray[i] := x;

     { I chose 50 passes of mixing, but you can do more or less }
     For i := 1 to 50 do
     Begin
          { Set both array pointers to a random location in the array }
          y1 := Random(20) + 1;
          y2 := Random(20) + 1;
          { Swap the two positions }
          temp := numArray[y1];
          numArray[y1] := numArray[y2];
          numArray[y2] := temp;
     End;
End.
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
You will now have an array of 1..20 in random order and each number only exists once. You can then use this to access your questions.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
MyBlock.Add( TBlock.create( 265,320, fRoundImageIndex[numArray[1]], DXSpriteEngine.Engine, dxImageList));
MyBlock.Add( TBlock.create(   7, 10, fRoundImageIndex[numArray[2]], DXSpriteEngine.Engine,dxImageList));
MyBlock.Add( TBlock.create( 135, 30, fRoundImageIndex[numArray[3]], DXSpriteEngine.Engine,dxImageList));
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Also, I would recommend storing all this into a record or class as well, then you can do as many blocks as ou want without writing more lines. Also, you could then have the block positions loaded from a file or whatever later if you wished.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
TYPE
   blockInfo = record
     x,
     y        : Word;
     quesNum  : Byte;
   End;

CONST
   { The total number of desired blocks }
   totalBlocks = 20;

   { All the 'x' positions of the blocks }
   startX : Array[1..20] Of Word =
       (265, 265, 265,   7, 135, 135,   7, 395, 395, 525, 
        525,  32,  32, 160, 160, 420, 420, 550, 550, 265)

   { All the 'y' positions of the blocks }
   startY : Array[1..20] Of Word =
       ( 80, 200, 320,  10,  30, 400, 430,  30, 400, 430, 
         10, 290, 150, 153, 276, 276, 153, 290, 150, 432)

VAR
   blocks : Array[1..totalBlocks] Of blockInfo;
   i,
   y1,
   y2,
   temp  : Byte;

Begin
     { Fill our blocks info in }
     For i := 1 to totalBlocks do
     Begin
         blocks[i].quesNum := i;
         blocks[i].x := startX[i];
         blocks[i].y := startY[i];
     End;

     { I chose 50 passes of mixing, but you can do more or less }
     For i := 1 to 50 do
     Begin
          { Set both array pointers to a random location in the array }
          y1 := Random(totalBlocks) + 1;
          y2 := Random(totalBlocks) + 1;
          { Swap the two positions }
          temp := blocks[y1].quesNum;
          blocks[y1].quesNum := blocks[y2].quesNum;
          blocks[y2].quesNum := temp;
     End;

     {...}

     For i := 1 to 20 do
       MyBlock.Add(TBlock.create( blocks[i].x, blocks[i].y,
                                  fRoundImageIndex[blocks[i].quesNum],
                                  DXSpriteEngine.Engine,dxImageList));
End.
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
This is just to show you, but the first two sections should really be in a seperate procedure, such as StartUp(); or such.&lt;br /&gt;
&lt;br /&gt;
Anyways, hope this gets you what you need!</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/394632/394663/ReadMessage.aspx#394663</guid>
      <pubDate>Tue, 04 Aug 2009 10:14:26 -0800</pubDate>
    </item>
    <item>
      <title>Re: Graphics and Images in 32bit platforms problem</title>
      <link>http://www.programmersheaven.com/mb/pasprog/394062/394073/ReadMessage.aspx#394073</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/394062/394073/ReadMessage.aspx#394073"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Through DOS? Resolutions that high have terrible refresh rates. I used to play with high res graphics alot in Pascal and never figures out how to adjust refresh rates, but if you are determined, then you will want to use VESA modes.&lt;br /&gt;
&lt;br /&gt;
For 800x600x32bit, you need to set mode 012Eh or $12E or 0x12E, however you prefer to write hex.&lt;br /&gt;
&lt;br /&gt;
Anyways, to set the VESA mode:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
ASM
   Mov Ax, $4F02
   Mov Bx, $12E
   Int $10
END;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Check here for more info:&lt;br /&gt;
&lt;a href="http://en.wikipedia.org/wiki/VESA_BIOS_Extensions"&gt;http://en.wikipedia.org/wiki/VESA_BIOS_Extensions&lt;/a&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/394062/394073/ReadMessage.aspx#394073</guid>
      <pubDate>Thu, 23 Jul 2009 01:07:32 -0800</pubDate>
    </item>
    <item>
      <title>Re: In search for a function !</title>
      <link>http://www.programmersheaven.com/mb/pasprog/393707/393899/ReadMessage.aspx#393899</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/393707/393899/ReadMessage.aspx#393899"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Are you using Windows or Dos?&lt;br /&gt;
&lt;br /&gt;
If DOS, you can access the screen directly:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
FUNCTION GetChar(X, Y : Word) : Char;
CONST
    TextScreen = $B800;
Begin
     GetChar := Chr(Mem[TextScreen: Y*160 + X*2]);
     { GetChar := Chr(Mem[TextScreen: Y*160 + X*2+1]); }
End;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
It's been a while, but I think it's the first line and the second is for the color of the character on the screen. If You keep getting the same value, try the second line instead.&lt;br /&gt;
&lt;br /&gt;
*EXTRA INFO* Each character on the screen is defined as two bytes. One is the actual character, then second is the color. The top four bits is the background color, the lower four bits it the forecolor, so $1F would be bgColor(1) and forColor(15), so White text on a Blue background.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/393707/393899/ReadMessage.aspx#393899</guid>
      <pubDate>Sun, 19 Jul 2009 17:49:39 -0800</pubDate>
    </item>
    <item>
      <title>2d mattrix / framebuffer</title>
      <link>http://www.programmersheaven.com/mb/pasprog/393625/393625/ReadMessage.aspx#393625</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Malekovits/"&gt;Malekovits&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/393625/393625/ReadMessage.aspx#393625"&gt;new message&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Hi all!&lt;br /&gt;
&lt;br /&gt;
I am currently making my own 3d graphics engine (still only 2d) and for that i use borland pascal, compile in protected mode and use dosbox to run. (the only method in pascal that u can use delay function (only in protected mode) and the graph unit). I know, very stupid to program in pascal, but I am just for start developing the logic behind:&lt;br /&gt;
&lt;br /&gt;
I want to know what to use that can enable to me a 2d matrix to " turn on/off " pixels (and for that task to use the gpu, i mean only to turn the pixels on/off)&lt;br /&gt;
&lt;br /&gt;
I use the graph unit but it's horribly slow. What about gdi? Can I use directdraw (not directx)? &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/393625/393625/ReadMessage.aspx#393625</guid>
      <pubDate>Sun, 12 Jul 2009 11:46:11 -0800</pubDate>
    </item>
    <item>
      <title>Re: Needing help with nested conditions</title>
      <link>http://www.programmersheaven.com/mb/pasprog/393536/393573/ReadMessage.aspx#393573</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/393536/393573/ReadMessage.aspx#393573"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;&lt;strong&gt;else&lt;/strong&gt; cannot be preceded by a semicolon, but there's more wrong with your code than that.  Unless grouped together by &lt;strong&gt;begin/end&lt;/strong&gt;, an &lt;strong&gt;if&lt;/strong&gt; acts on only a single statement.  I have not studied your code in detail but I think this is what you want.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
program mayorymenor;

var
   num1  : integer;
   num2  : integer;
   num3  : integer;
   mayor : integer;
   menor : integer;

begin
   write ('introduzca el primer número');
   readln (num1);
   write ('introduzca el segundo número');
   readln (num2);
   write ('introduzca el tercer número');
   readln (num3);

   mayor := num1;
   if num2 &amp;gt; mayor then
      mayor := num2;
   if num3 &amp;gt; mayor then
      mayor := num3;
   write ('el mayor es: ', mayor) ;

   menor := num1;
   if num2 &amp;lt; menor then
      menor := num2;
   if num3 &amp;lt; menor then
      menor := num3;
   write ('el menor es: ', menor)
end.
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/393536/393573/ReadMessage.aspx#393573</guid>
      <pubDate>Sat, 11 Jul 2009 00:00:34 -0800</pubDate>
    </item>
    <item>
      <title>Re: Appending to a Text file.</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392797/392925/ReadMessage.aspx#392925</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392797/392925/ReadMessage.aspx#392925"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;This is from TP7 help, but may have been implemented before:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
  Append (procedure)
  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 Opens an existing file for appending.

  Declaration:
  procedure Append(var f: Text);
 where:
  f is a text-file variable.
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
LOL Just realized this is for Textfiles only. Could use it as a text file &amp;amp; just do Read() instead of readln().&lt;br /&gt;
&lt;br /&gt;
Also, just found this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
  var
   F: file;
  begin
   {$I-}
   Assign(F, FileName);
   &lt;strong&gt;FileMode := 2;  ( Set file access to read/write }&lt;/strong&gt;
   Reset(F);
   Close(F);
   {$I+}
   FileExists := (IOResult = 0) and (FileName &amp;lt;&amp;gt; '');
  end;  { FileExists }
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Change FileMode to Read/Write access. This should work.&lt;br /&gt;
&lt;br /&gt;
Otherwise something like this will work:&lt;br /&gt;
reset(file), rewrite(newfile), read data, write data, write new data, close(file), close(newfile), erase(file), rename (newfile, file).&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392797/392925/ReadMessage.aspx#392925</guid>
      <pubDate>Fri, 26 Jun 2009 18:50:11 -0800</pubDate>
    </item>
    <item>
      <title>Re: Appending to a Text file.</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392797/392918/ReadMessage.aspx#392918</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392797/392918/ReadMessage.aspx#392918"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Early Pascal did not have &lt;strong&gt;seek&lt;/strong&gt; or &lt;strong&gt;blockwrite&lt;/strong&gt; so the solution suggested by Atex will not work either.  Probably the only solution is to copy the entire file to a scratch file, then write the new data to the scratch file.  If you are lucky your implementation will let you &lt;strong&gt;remove&lt;/strong&gt; your original file and &lt;strong&gt;rename&lt;/strong&gt; the scratch file, but most early Pascals did not have these capabilities.  Lacking these capabilities your only option will be the copy the scratch file back to your original, leaving the scratch file on the system.&lt;br /&gt;
&lt;br /&gt;
I think of "early Pascal", i.e., implementations based on the Jensen and Wirth descriptions, as an entirely different language than those based on the 1983 standard, e.g., Turbo Pascal, Free Pascal and Delphi.  Detractors of the language inevitably point out the Jensen/Wirth deficiencies, arguments have no validity when applied to modern implementations.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392797/392918/ReadMessage.aspx#392918</guid>
      <pubDate>Fri, 26 Jun 2009 14:26:10 -0800</pubDate>
    </item>
    <item>
      <title>Re: Appending to a Text file.</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392797/392868/ReadMessage.aspx#392868</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392797/392868/ReadMessage.aspx#392868"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;&lt;span style="color: Red;"&gt;: &lt;br /&gt;
: Unfortunately the problem seems to be with the open.  I seemingly &lt;br /&gt;
: only have rewrite (which erases the file before starting) and reset &lt;br /&gt;
: (which puts me into a read only mode on the file).  All regardless,&lt;br /&gt;
: to whether I am just writing text or record blocks. Seems to be&lt;br /&gt;
: quite a shortcoming in the early Pascal.&lt;br /&gt;
: &lt;br /&gt;
: Or am I missing something.&lt;br /&gt;
: &lt;/span&gt;&lt;br /&gt;
You're not missing anything.  These "shortcomings" of "early Pascal" was the driving force behind the 1983 standard and Turbo Pascal.  Is there something keep you from upgrading to a more modern implementation?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392797/392868/ReadMessage.aspx#392868</guid>
      <pubDate>Thu, 25 Jun 2009 20:20:08 -0800</pubDate>
    </item>
    <item>
      <title>Re: counting days/months/years</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392799/392812/ReadMessage.aspx#392812</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392799/392812/ReadMessage.aspx#392812"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Here's a program that I posted last year.  It takes a person's birthday and today's date as input, then computes the person's age in days.  That's the opposite of what you are trying to do, however, you may find some of the functions and procedures useful.  Sorry I can't do more right now but it's late and I need to get to bed.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Program Days ;

      Function Julian (Year: Word ; Month, Day : Byte) : LongInt ;

            Function IsLeap (Year : LongInt) : Boolean ;
            {
               a year is a leap year IF it's divisible by 4
               UNLESS it's also divisible by 100, then it's
               a leap year ONLY if it divisible by 400
            }
            begin
                 if Year DIV 4 = 0 then begin
                     if Year DIV 100 = 0 then begin
                         if Year DIV 400 = 0 then
                             IsLeap := TRUE
                         else
                             IsLeap := FALSE
                     end
                     else
                         IsLeap := TRUE
               end
               else
                   IsLeap := FALSE
            end ;

            Function DaysPriorToThisYear (Year : LongInt) : LongInt ;
              
            Var
                  i, Count : LongInt ;

            begin
                  Count := 0 ;

                  for i := 1 to Year - 1 do
                     if IsLeap(i) then
                        Count := Count + 366
                     else
                        Count := Count + 365 ;

                  DaysPriorToThisYear := Count
            end ;

            Function DaysPriorToThisMonth (Year, Month : LongInt) : LongInt ;
               
            CONST
               MonthDays : Array [FALSE .. TRUE, 1 .. 12] of LongInt
                         = ((31,28,31,30,31,30,31,31,30,31,30,31),
                            (31,29,31,30,31,30,31,31,30,31,30,31)) ;

            Var
               i, Count : LongInt ;

            begin
               Count := 0 ;

               for i := 1 to Month - 1 do
                  if IsLeap(Year) then
                     Count := Count + MonthDays[TRUE, i]
                  else
                     Count := Count + MonthDays[FALSE, i]  ;

               DaysPriorToThisMonth := Count
            end ;
             
      begin
         Julian := DaysPriorToThisYear(Year) 
                 + DaysPriorToThisMonth(Year,Month) 
                 + Day
      end ;

Var
   Year0, Year1, Month0, Month1, Day0, Day1, BirthDay, Today : LongInt ;

begin
   Write ('Enter year of birth:   ') ;  ReadLn (Year0) ;
   Write ('Enter month of birth:  ') ;  ReadLn (Month0) ;
   Write ('Enter day of birth:    ') ;  ReadLn (Day0) ;
   WriteLn ;

   Write ('Enter today''s year:    ') ;  ReadLn (Year1) ;
   Write ('Enter today''s month:   ') ;  ReadLn (Month1) ;
   Write ('Enter today''s day:     ') ;  ReadLn (Day1) ;

   BirthDay := Julian (Year0, Month0, Day0) ;
   Today    := Julian (Year1, Month1, Day1) ; 

   WriteLn (Today   :10) ;
   WriteLn (Birthday:10) ;
    
   WriteLn ('The person is ', Today - BirthDay, ' days old.')
end.
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392799/392812/ReadMessage.aspx#392812</guid>
      <pubDate>Wed, 24 Jun 2009 21:14:29 -0800</pubDate>
    </item>
    <item>
      <title>Re: need help with guessing game</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392718/392747/ReadMessage.aspx#392747</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392718/392747/ReadMessage.aspx#392747"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;I would suggest using a &lt;strong&gt;boolean&lt;/strong&gt; type instead of &lt;strong&gt;char&lt;/strong&gt; &amp;amp; &lt;strong&gt;integer&lt;/strong&gt;. &lt;strong&gt;Boolean&lt;/strong&gt; types allow only &lt;strong&gt;True&lt;/strong&gt; &amp;amp; &lt;strong&gt;false&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
Also, I would suggest you use a function instead of a procedure for your &lt;strong&gt;checkifexists&lt;/strong&gt; and let the program calling it write the response.&lt;br /&gt;
Also, most of the time there is no need to write things multiple times. If you are, chances are you can comine them into one section somehow.&lt;br /&gt;
&lt;br /&gt;
Example with some code removed:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;: 
uses wincrt;
var
  x : Integer;
  guess_array: array [1..100] of &lt;strong&gt;boolean&lt;/strong&gt;;

function checkifexists&lt;strong&gt;(guess : integer) : boolean&lt;/strong&gt;;
begin
     if guess_array[guess] = true then  
        &lt;strong&gt;checkifexists := true&lt;/strong&gt;
     else
        &lt;strong&gt;checkifexists := false;&lt;/strong&gt;
end;   


procedure main_game;
begin 

     {... Reinsert your loop and stuff here ...}

     writeln('guess a number between 1 and 100');
     readln (guess);
     writeln;

     if (guess &amp;lt;= 0) then
        WriteLn('You have guessed a number smaller than 1!')

     else if (guess &amp;gt;= 100) then
        WriteLn('You have guessed a number larger than 99!')

     else if (checkifexists = true) then
        WriteLn('You have already guessed that number!')

     else { number is between 1 and 99 and hasn't been guessed yet }
     Begin
        guess_array[guess] := true;
        inc(guess_total);

        if guess &amp;gt; secret_number then
           writeln('you have guessed too high');

        if guess &amp;lt; secret_number then
           writeln('you guessed too low');

        if guess = secret_number then
        begin
             writeln ('grats you guessed to correct number', secret_number);
             writeln('your total number of guesses was ',guess_total);        
        end;
     End;

     {... any other needed code ...}

end;

begin
     repeat
           clrscr;
           { Clear all guesses }
           For x := 1 to 100 do
               guess_array[x] := false;
           main_game;
           writeln('Do you want to play again?');
           readln (answer);           
     until Not(answer In['y','Y']);
     donewincrt;                 
end.
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I would've kept your loop code, but I wasn't expecting to write this much when I started. Hope this helps give you an idea of how you can make your code shorter and cleaner.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392718/392747/ReadMessage.aspx#392747</guid>
      <pubDate>Tue, 23 Jun 2009 19:56:27 -0800</pubDate>
    </item>
    <item>
      <title>Re: Program Record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392548/392598/ReadMessage.aspx#392598</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392548/392598/ReadMessage.aspx#392598"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;I get no errors.  This works as far as getting the password.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
program User_Registration;

uses
  Crt;

Type
   Userrecord = Record
      Password    : string;
      Username    : string;
      Password_ID : integer;
      Username_ID : integer;
   end;

Var
   Index    : integer;
   Temp     : string;
   I        : integer;
   n        : integer;
   Database : array [0..100] of string;
   User     : Userrecord;

Begin
   Index:=0;
   randomize;
   writeln('User Registration Area');
   writeln('');
   writeln('');
   { Eingabe des Usernamen }
   write('Username: ');
   readln(User.Username);
                                                
   { überprüfung ob der Username bereits existiert }
   for I:= 1 to 100 do begin
      if User.Username = 'Database[0..100]' then begin
         repeat
            write('Username: ');
            readln(User.Username)
         until User.Username &amp;lt;&amp;gt; 'Database[0..100]';
      end;
   end;
   Index:=Index+1;
   Database[Index]:=User.Username;
                                                
   { Eingabe des Passworts }
   write('Password: ');
   readln(User.Password);
   writeln('');
                                                
   { Konfirmation des Passworts }
   write('Please confirm Password: ');
   readln(TEMP);
                                                 
   {überprüfung des Passwortes}
   if User.Password &amp;lt;&amp;gt; Temp then begin
      writeln(' Password doesnt match Confirmation');
      writeln('');
      repeat
         
         write('Password: ');
                                             
         readln(User.Password);
         writeln('');
         write('Please confirm Password: ');
         readln(TEMP);
      until User.Password = Temp;
   end;
   for I:= 1 to 100 do
        writeln('Database[0..Index]');
   {  Zuweisung einer Identifikationsnummer  }
end.
&lt;/pre&gt;&lt;br /&gt;
Which implementation of Pascal are you using?&lt;br /&gt;
&lt;br /&gt;
Try this.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   with User do
      readln(Username);
&lt;/pre&gt;&lt;br /&gt;
Or this.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   for j := 1 to Length(User.Username) do
      read(User.Username[j]);
   readln
&lt;/pre&gt;&lt;br /&gt;
or a combination.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   with User do
      for j := 1 to Length(UserName) do
         read(UserName[j]
      readln ;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392548/392598/ReadMessage.aspx#392598</guid>
      <pubDate>Sat, 20 Jun 2009 19:10:37 -0800</pubDate>
    </item>
    <item>
      <title>Re: Program Record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392548/392556/ReadMessage.aspx#392556</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392548/392556/ReadMessage.aspx#392556"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;: Here is my Code&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;: program User_Registration;
: 
: uses
:   Crt;
: 
: Type
:     Userrecord= Record
:           Password: string;
:           Username: string;
:           Password_ID: integer;
:           Username_ID: integer;
: end;
: 
: Var
: 
:    Index: integer;
:    Temp: string;
:    I: integer;
:    n: integer;
:    Database: array [0..100] of string;
:    &lt;span style="color: Red;"&gt;User: Userrecord;&lt;/span&gt;
: 
: 
: Begin
: 
: 
: 
:                 Index:=0;
:                 randomize;
:                 writeln('User Registration Area');
:                 writeln('');
:                 writeln('');
:                                                 {Eingabe des Usernamen}
:                 write('Username: ');
:                 &lt;span style="color: Red;"&gt;readln(Userrecord.Username);&lt;/span&gt;
:                                                 {überprüfung ob der Username bereits existiert}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
You declare userrecord as User, but then don't use it. You need to change all your record pointer names from "userrecord" to "User"&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
readln(User.Username);
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I haven't checked the rest of the code thouroughly, but try this first.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392548/392556/ReadMessage.aspx#392556</guid>
      <pubDate>Fri, 19 Jun 2009 19:00:19 -0800</pubDate>
    </item>
    <item>
      <title>Re: Program Record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392548/392555/ReadMessage.aspx#392555</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392548/392555/ReadMessage.aspx#392555"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;: Here is my Code&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;: program User_Registration;
: 
: uses
:   Crt;
: 
: Type
:     Userrecord= Record
:           Password: string;
:           Username: string;
:           Password_ID: integer;
:           Username_ID: integer;
: end;
: 
: Var
: 
:    Index: integer;
:    Temp: string;
:    I: integer;
:    n: integer;
:    Database: array [0..100] of string;
:    &lt;span style="color: Red;"&gt;User: Userrecord;&lt;/span&gt;
: 
: 
: Begin
: 
: 
: 
:                 Index:=0;
:                 randomize;
:                 writeln('User Registration Area');
:                 writeln('');
:                 writeln('');
:                                                 {Eingabe des Usernamen}
:                 write('Username: ');
:                 &lt;span style="color: Red;"&gt;readln(Userrecord.Username);&lt;/span&gt;
                  &lt;span style="color: Red;"&gt;{
                      &lt;strong&gt;Userrecord&lt;/strong&gt; is a type, not a variable.
                      Use &lt;strong&gt;User&lt;/strong&gt; instead of &lt;strong&gt;Userrecord&lt;/strong&gt; 
                  }&lt;/span&gt;
:                                                 {überprüfung ob der Username bereits existiert}
:                 for I:= 1 to 100 do
:                     begin
:                          if &lt;span style="color: Red;"&gt;Userrecord&lt;/span&gt;.Username = 'Database[0..100]' then
:                             begin
:                                  repeat
:                                        begin
:                                             write('Username: ');
:                                             readln(&lt;span style="color: Red;"&gt;Userrecord&lt;/span&gt;.Username);
:                                        end;
:                                  until &lt;span style="color: Red;"&gt;Userrecord&lt;/span&gt;.Username &amp;lt;&amp;gt; 'Database[0..100]';
:                             end;
:                     end;
:                 Index:=Index+1;
:                 Database[Index]:=&lt;span style="color: Red;"&gt;Userrecord&lt;/span&gt;.Username;
: 
: 
:                                                 {Eingabe des Passworts}
:      write('Password: ');
:      readln(&lt;span style="color: Red;"&gt;Userrecord&lt;/span&gt;.Password);
:      writeln('');
:                                                 {Konfirmation des Passworts}
:      write('Please confirm Password: ');
:      readln(TEMP);
:                                                  {überprüfung des Passwortes}
:      if &lt;span style="color: Red;"&gt;Userrecord&lt;/span&gt;.Password &amp;lt;&amp;gt; Temp then
:         begin
:              writeln(' Password doesnt match Confirmation');
:              writeln('');
:                          repeat
:                                begin
:                                     write('Password: ');
:                                     readln(&lt;span style="color: Red;"&gt;Userrecord&lt;/span&gt;.Password);
:                                     writeln('');
:                                     write('Please confirm Password: ');
:                                     readln(TEMP);
:                                end;
:                          until &lt;span style="color: Red;"&gt;Userrecord&lt;/span&gt;.Password = Temp;
:         end;
:         for I:= 1 to 100 do
:         writeln('Database[0..Index]');
:                                                  {Zuweisung einer Identifikationsnummer}
: end. &lt;/pre&gt;: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
By the way, &lt;strong&gt;begin .. end&lt;/strong&gt; is not necessary inside &lt;strong&gt;repeat .. until&lt;/strong&gt;.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392548/392555/ReadMessage.aspx#392555</guid>
      <pubDate>Fri, 19 Jun 2009 18:59:09 -0800</pubDate>
    </item>
    <item>
      <title>Re: Program Record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392548/392551/ReadMessage.aspx#392551</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392548/392551/ReadMessage.aspx#392551"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;You need to post more of your code.  There's not enough here to tell what is happening.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392548/392551/ReadMessage.aspx#392551</guid>
      <pubDate>Fri, 19 Jun 2009 16:04:36 -0800</pubDate>
    </item>
    <item>
      <title>Re: Program Record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392548/392550/ReadMessage.aspx#392550</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392548/392550/ReadMessage.aspx#392550"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;You need to post more of your code.  There's not enough here to tell what is happening.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392548/392550/ReadMessage.aspx#392550</guid>
      <pubDate>Fri, 19 Jun 2009 16:03:49 -0800</pubDate>
    </item>
    <item>
      <title>Re: Moving from byteint array to record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392258/392299/ReadMessage.aspx#392299</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392258/392299/ReadMessage.aspx#392299"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;How about Move();&lt;br /&gt;
&lt;br /&gt;
Just copy all the data from the ByteArray to the start address of the custfile. This should fill in all the data.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
 Move(bulkfile.bulk, custfile, 28);
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392258/392299/ReadMessage.aspx#392299</guid>
      <pubDate>Sat, 13 Jun 2009 12:46:04 -0800</pubDate>
    </item>
    <item>
      <title>Re: Moving from byteint array to record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392258/392294/ReadMessage.aspx#392294</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392258/392294/ReadMessage.aspx#392294"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;: I &lt;br /&gt;
: may be asking for a ability that does not exist.  But simplistically &lt;br /&gt;
: I am looking for:&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: custfile:=bulkfile.bulk[1..28];&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
I'm fairly certain that such a thing does not exist in classical Pascals such as described by Jensen and Wirth.&lt;br /&gt;
&lt;br /&gt;
I think you might be able to do something like this in Turbo Pascal or FreePascal.  I'd have to give it some thought as to exactly how.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392258/392294/ReadMessage.aspx#392294</guid>
      <pubDate>Sat, 13 Jun 2009 08:43:00 -0800</pubDate>
    </item>
    <item>
      <title>Re: Moving from byteint array to record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392258/392265/ReadMessage.aspx#392265</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392258/392265/ReadMessage.aspx#392265"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;&lt;pre class="sourcecode"&gt;
: bulkrec = record
:   job          : LongInt;    
:   relation     : packed array [1..8] of char;
:   reclen       : LongInt;
:   bulk : array [1.. 1000] of ByteInt;
: 
: pbulkrec = ^bulkrec;
&lt;/pre&gt;&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;strong&gt;and then I have another record like:&lt;/strong&gt;&lt;br /&gt;
: &lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
: custfile = record
:    custnum  : ShortNat;
:      group  : ShortNat;
:       name  : packed array [1..20] of char;
:       flag1 : boolean;
:       flag2 : boolean;
:       flag3 : boolean;
:       flag4 : boolean;
: end;
: 
: pcustfile = ^custfile;
&lt;/pre&gt;&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: Problem then is that the bulkrec.bulk field actually&lt;br /&gt;
: holds the custfile data and I want to move it from that&lt;br /&gt;
: array into custfile record... i.e.&lt;br /&gt;
: &lt;br /&gt;
: custnum is a 2 byte field so the concatenation of  &lt;br /&gt;
: bulk[1] and bulk[2] holds its value.&lt;br /&gt;
: &lt;br /&gt;
: group also is a 2 byte field so the concatenation of&lt;br /&gt;
: bulk[3] and bulk[4] holds its value.&lt;br /&gt;
: &lt;br /&gt;
: name is 20 byte field and thus&lt;br /&gt;
: bulk[5] thru bulk[24] hold its value.&lt;br /&gt;
:&lt;br /&gt;
: flags1-4 hold 1 byte a piece &lt;br /&gt;
: bulk[25] to bulk[28] respectively.&lt;br /&gt;
: &lt;br /&gt;
: How do I make this assignment from the bulkrec.bulk&lt;br /&gt;
: variable to the custfile record???&lt;br /&gt;
: &lt;br /&gt;
: Any help appreciated.&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The first problem I see is your declarations&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   pbulkrec  : ^bulkrec;
   pcustfile : ^custfile;
&lt;/pre&gt;&lt;br /&gt;
where you declare &lt;strong&gt;pbulkrec&lt;/strong&gt; and &lt;strong&gt;pcustfile&lt;/strong&gt; as pointers.  The "problem" is that having to reference and de-reference the adds to the complexity and gets in the way of addressing the other issues.  I have not idea why you declare these as pointers instead of variables, but I'm going to address your other issues in terms of this declaration:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   pbulkrec  : bulkrec;
   pcustfile : custfile;
&lt;/pre&gt;&lt;br /&gt;
If you really need these to be pointers I'll leave it to you to make that adjustment.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;br /&gt;
: custnum is a 2 byte field so the concatenation of  &lt;br /&gt;
: bulk[1] and bulk[2] holds its value.&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
I'm assuming that the definition of &lt;strong&gt;BulkRec&lt;/strong&gt; is being forced upon you by some existing software or data.  If so then the method of "concatenation" is ambiguous and we have to guess how the original programmer did it.  The simplest would be&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   with pbulkrec do
      with pcustfile do
         CustNum := 128*Bulk[1] + Bulk[2] ; 
&lt;/pre&gt;&lt;br /&gt;
This assumes that &lt;strong&gt;Bulk[1]&lt;/strong&gt; is the most significant byte, but it could be that &lt;strong&gt;Bulk[2]&lt;/strong&gt; is the MSB.&lt;br /&gt;
&lt;br /&gt;
However, &lt;strong&gt;Bulk&lt;/strong&gt; is signed and &lt;strong&gt;CustNum&lt;/strong&gt; is unsigned.  I think this is more likely:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   with pbulkrec do
      with pcustfile do
         CustNum := (256*(Bulk[1] + 128) MOD 32768) + (Bulk[2] + 128 ; 
&lt;/pre&gt;&lt;br /&gt;
Adding 128 to each &lt;strong&gt;Bulk&lt;/strong&gt; element shifts it into positive territory, and the MOD operator keeps &lt;strong&gt;CustNum&lt;/strong&gt; in range.  Of course this assumes that the original programmer took this same approach.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;br /&gt;
: name is 20 byte field and thus&lt;br /&gt;
: bulk[5] thru bulk[24] hold its value.&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   for i := 1 to 20 do
      name[i] := bulk[i + 4] ;  &lt;span style="color: Red;"&gt;{ there may be problems with pack and unpack }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;br /&gt;
: flags1-4 hold 1 byte a piece &lt;br /&gt;
: bulk[25] to bulk[28] respectively.&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   flag1 := (bulk[25] = 0) ; &lt;span style="color: Red;"&gt;{ assume zero means FALSE }&lt;/span&gt;
   flag2 := (bulk[26] = 0) ; &lt;span style="color: Red;"&gt;{ any else means TRUE }&lt;/span&gt;
   flag3 := (bulk[27] = 0) ;
   flag4 := (bulk[28] = 0) ;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
What do &lt;strong&gt;Bulk[29] .. Bulk[1000]&lt;/strong&gt; hold ?&lt;br /&gt;
&lt;br /&gt;
What implementation of Pascal are you using?  What kind of computer and operating system?&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392258/392265/ReadMessage.aspx#392265</guid>
      <pubDate>Fri, 12 Jun 2009 20:49:15 -0800</pubDate>
    </item>
    <item>
      <title>Re: Moving from byteint array to record</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392258/392259/ReadMessage.aspx#392259</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392258/392259/ReadMessage.aspx#392259"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;What is a ByteInt?  What is a ShortNat?&lt;br /&gt;
&lt;br /&gt;
Neither of these terms is part of modern Pascal.&lt;br /&gt;
&lt;br /&gt;
I'm guessing that&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Type
   ByteInt = 0 .. 255 ;  { i.e., type Byte }
   ShortNat = -128 .. 127 ;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
By the way the word &lt;strong&gt;packed&lt;/strong&gt; is obsolete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392258/392259/ReadMessage.aspx#392259</guid>
      <pubDate>Fri, 12 Jun 2009 17:25:26 -0800</pubDate>
    </item>
    <item>
      <title>Re: no way to get the console handle</title>
      <link>http://www.programmersheaven.com/mb/pasprog/392085/392097/ReadMessage.aspx#392097</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/392085/392097/ReadMessage.aspx#392097"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Post your code.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/392085/392097/ReadMessage.aspx#392097</guid>
      <pubDate>Tue, 09 Jun 2009 11:57:56 -0800</pubDate>
    </item>
    <item>
      <title>Re: plz help me matrix multiplication 7 * 7 !</title>
      <link>http://www.programmersheaven.com/mb/pasprog/391880/391928/ReadMessage.aspx#391928</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/391880/391928/ReadMessage.aspx#391928"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;There are times when brute force is the best option.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Type
   Matrix = array [1 .. 7, 1 .. 7] of Integer ;
   Survey = array [1 .. 49] of Integer ;

   Procedure DoSurvey (Var S : Survey ; M : Matrix) ;
   begin
      S[1]  := M[1,1] ;
      S[2]  := M[2,1] ;
      S[3]  := M[3,1] ;
      S[4]  := M[4,1] ;
      S[5]  := M[5,1] ;
      S[6]  := M[6,1] ;
      S[7]  := M[7,1] ;
      S[8]  := M[7,2] ;
      S[9]  := M[7,3] ;
      S[10] := M[7,4] ;
      S[11] := M[7,5] ;
      S[12] := M[7,6] ;
      S[13] := M[7,7] ;
      S[14] := M[6,7] ;
      S[15] := M[5,7] ;
      S[16] := M[4,7] ;
      S[17] := M[3,7] ;
      S[18] := M[2,7] ;
      S[19] := M[1,7] ;
      S[20] := M[1,6] ;
      S[21] := M[1,5] ;
      S[22] := M[1,4] ;
      S[23] := M[1,3] ;
      S[24] := M[1,2] ;
      S[25] := M[2,2] ;
      S[26] := M[3,2] ;
      S[27] := M[4,2] ;
      S[28] := M[5,2] ;
      S[29] := M[6,2] ;
      S[30] := M[6,3] ;
      S[31] := M[6,4] ;
      S[32] := M[6,5] ;
      S[33] := M[6,6] ;
      S[34] := M[5,6] ;
      S[35] := M[4,6] ;
      S[36] := M[3,6] ;
      S[37] := M[2,6] ;
      S[38] := M[2,5] ;
      S[39] := M[2,4] ;
      S[40] := M[2,3] ;
      S[41] := M[3,3] ;
      S[42] := M[4,3] ;
      S[43] := M[5,3] ;
      S[44] := M[5,4] ;
      S[45] := M[5,5] ;
      S[46] := M[4,5] ;
      S[47] := M[3,5] ;
      S[48] := M[3,4] ;
      S[49] := M[4,4]
   end ;
&lt;/pre&gt;&lt;br /&gt;
Although crude, this solution is straightforward and easy to understand, a very important consideration.  It may even be faster and more efficient than a more complex solution.  You have to measure to be sure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/391880/391928/ReadMessage.aspx#391928</guid>
      <pubDate>Thu, 04 Jun 2009 13:42:09 -0800</pubDate>
    </item>
    <item>
      <title>Re: tic tac toe game</title>
      <link>http://www.programmersheaven.com/mb/pasprog/391817/391819/ReadMessage.aspx#391819</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Actor/"&gt;Actor&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/391817/391819/ReadMessage.aspx#391819"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;Google "tic tac toe pascal."&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/391817/391819/ReadMessage.aspx#391819</guid>
      <pubDate>Mon, 01 Jun 2009 11:01:00 -0800</pubDate>
    </item>
    <item>
      <title>Re: NEED IMMEDIATE HELP -- PLEASE !</title>
      <link>http://www.programmersheaven.com/mb/pasprog/391456/391793/ReadMessage.aspx#391793</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/Phat+Nat/"&gt;Phat Nat&lt;/a&gt; posted a &lt;a href="http://www.programmersheaven.com/mb/pasprog/391456/391793/ReadMessage.aspx#391793"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/pasprog/Board.aspx"&gt;Pascal&lt;/a&gt; forum.&lt;/p&gt;You can use a 1D or 2D array to do this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
VAR
   {1D Array}
   Board : Array[1..9] Of Char;

   {2D Array}
   Board : Array[1..3,1..3] Of Char; { 3x3 = 9 }
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Either way works well. For the examples, I am using box 5:&lt;br /&gt;
&lt;br /&gt;
With a 1D array it's easy to select the box that the user chooses, as Spot 5 on the board = Board[&lt;strong&gt;5&lt;/strong&gt;].&lt;br /&gt;
With a 2D array Spot 5 on the board = Board[&lt;strong&gt;1,2&lt;/strong&gt;] or Board[5 DIV 3, 5 MOD 3].&lt;br /&gt;
&lt;br /&gt;
But for drawing the X or O onto the board, a 2D array is setup the same as the board, so:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
  { 1D array }
  for y := 1 to 3 do
    for x := 1 to 3 do
    begin
      gotoXY(x*3,y*3);
      write(Board[&lt;strong&gt;(y-1)*3 + x&lt;/strong&gt;]);
    end;

  { 2D array }
  for y := 1 to 3 do
    for x := 1 to 3 do
    begin
      gotoXY(x*3,y*3);
      write(Board[&lt;strong&gt;x,y&lt;/strong&gt;]);
    end;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Either way has its advantages and disadvantages, but both work basically the same. (Oh, and now you have some needed code too ;)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/391456/391793/ReadMessage.aspx#391793</guid>
      <pubDate>Sun, 31 May 2009 23:56:46 -0800</pubDate>
    </item>
    <item>
      <title>TatukGIS Editor 2.0</title>
      <link>http://www.programmersheaven.com/download/56106/download.aspx</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/TatukGIS/"&gt;TatukGIS&lt;/a&gt; submitted a new &lt;a href="http://www.programmersheaven.com/download/56106/download.aspx"&gt;file&lt;/a&gt;.&lt;/p&gt;The TatukGIS Editor is a well designed GIS desktop application supporting the features that would typically be expected of a GIS editing software, including advanced support for coordinate systems and a huge number of data formats. For custom solution designers with specialized or more advanced requirements, the Editor supports a built-in Basic and Pascal scripting IDE that exposes the full power of the TatukGIS Developer Kernel (SDK) (with its hundreds of classes and thousands of methods) within the Editor. The Editor product is intuitive and learnable just from the integrated help files.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/download/56106/download.aspx</guid>
      <pubDate>Fri, 29 May 2009 12:35:22 -0800</pubDate>
    </item>
    <item>
      <title>TatukGIS Editor 2.0</title>
      <link>http://www.programmersheaven.com/download/56106/download.aspx</link>
      <description>&lt;p&gt;&lt;a href="http://www.programmersheaven.com/user/TatukGIS/"&gt;TatukGIS&lt;/a&gt; submitted a new &lt;a href="http://www.programmersheaven.com/download/56106/download.aspx"&gt;file&lt;/a&gt;.&lt;/p&gt;The TatukGIS Editor is a well designed GIS desktop application supporting the features that would typically be expected of a GIS editing software, including advanced support for coordinate systems and a huge number of data formats. For custom solution designers with specialized or more advanced requirements, the Editor supports a built-in Basic and Pascal scripting IDE that exposes the full power of the TatukGIS Developer Kernel (SDK) (with its hundreds of classes and thousands of methods) within the Editor. The Editor product is intuitive and learnable just from the integrated help files.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/download/56106/download.aspx</guid>
      <pubDate>Fri, 29 May 2009 12:33:33 -0800</pubDate>
    </item>
  </channel>
</rss>
