<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'how to blast an 2d array aout to screen without for-loops?' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'how to blast an 2d array aout to screen without for-loops?' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 10:31:56 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 10:31:56 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>how to blast an 2d array aout to screen without for-loops?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419665/419665/how-to-blast-an-2d-array-aout-to-screen-without-for-loops/</link>
      <description>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/how-to-blast-an-2d-array-aout-to-screen-without-for-loops/</guid>
      <pubDate>Fri, 12 Nov 2010 05:22:32 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: how to blast an 2d array aout to screen without for-loops?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/419665/419675/re-how-to-blast-an-2d-array-aout-to-screen-without-for-loops/#419675</link>
      <description>: I wonder if there is something like the fillchar function, that if u &lt;br /&gt;
: use it you can "erase" the contents of an array in a simple &lt;br /&gt;
: function, without the for-loops, to write all the contents of an 2d &lt;br /&gt;
: array at once..&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&lt;span style="color: Blue;"&gt;uses crt;


procedure fillbyte(var x;count:word;b:byte);assembler; { similar to FillChar, but faster, it takes bytes }
 asm
  les di,[x]
  mov cx,count
  mov al,b
  mov ah,al
  cld
  shr cx,1
  rep stosw
  adc cx,cx
  rep stosb
 end;

procedure fillword(var x;count,w:word);assembler; { same as above, 16 bit }
 asm
  les di,[x]
  mov cx,count
  mov ax,w
  cld
  rep stosw
 end;



var a:array[0..3999] of byte absolute $b800:0;
    i:word;

begin
 repeat
  for i:=0 to 3999 do a[i]:=random(256);
  delay(100);
 until keypressed;
 readkey;

 i:=0;
 repeat
  fillbyte(ptr($b800,0)^,4000,i);
  inc(i);
  delay(100);
 until keypressed;
 readkey;

 i:=0;
 repeat
  fillword(ptr($b800,0)^,2000,i shl 8+(255-i));
  inc(i);
  delay(100);
 until keypressed;
 readkey;

 clrscr;
end.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/419665/419675/re-how-to-blast-an-2d-array-aout-to-screen-without-for-loops/#419675</guid>
      <pubDate>Fri, 12 Nov 2010 18:47:19 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>