<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Giving Back - a progress bar of sorts for Mac]]></title>
		<link>http://forums.approximatrix.com/viewtopic.php?id=851</link>
		<atom:link href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=851&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Giving Back - a progress bar of sorts for Mac.]]></description>
		<lastBuildDate>Sun, 10 Apr 2022 07:05:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Giving Back - a progress bar of sorts for Mac]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=3903#p3903</link>
			<description><![CDATA[<p>Below is the code for a simplified progress bar I set up for a routine that was running for more than a minute.<br />I wanted to be sure things were still humming along without periodically printing out increment numbers.</p><p>It&#039;s nice in that it only takes up two lines of the &quot;screen&quot; and can be easily modified for the situation at hand.</p><p>! MyTotalLoops is the number of the maximum loops in my Do/EndDO structure<br />! nStep is my progress bar increment. I wanted 10 steps so it&#039;s MyTotalLoops/10<br />! ss is a counter that triggers printing a progress step when ss equals nStep. Then ss is reset</p><p>Integer(16) MyTotalLoops, nStep, ss<br /> nStep = MyTotalLoops/10</p><p>! Before the loop, I print out numbers 1 to 10 - my progress steps - then write some spaces on a second line so the<br />! progress steps will line up under the numbers 1 thru 10<br />! The font is different in this message area so you don&#039;t see that the second line of spaces<br />! starts at the P and stops just before the &quot;1&quot;</p><p>&nbsp; &nbsp; Write (*,*)<br />&nbsp; &nbsp; Write (*,&#039;(a)&#039;)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;Progress Steps: 1,2,3,4,5,6,7,8,9,10&#039;<br />&nbsp; &nbsp; Write (*,&#039;(a)&#039;,advance=&#039;no&#039;) &#039;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;<br />! The ..., advance = &#039;no&#039;) keeps the &#039;print point&#039; from moving down a line</p><p>! I initialize ss at the beginning of the big Do Loop<br />&nbsp; ss = 1<br />Do<br />! Your task goes here<br />.<br />.<br />.<br />! At the bottom of the loop, above the EndDo, I increment my step counter, compare it to the progress bar increment,<br />! If it is equal, I write out a progress bar step and reset the counter</p><p>! Count steps and write out progress<br />&nbsp; &nbsp; ss = ss + 1<br />&nbsp; &nbsp; IF (ss == nStep) Then<br />&nbsp; &nbsp; &nbsp; &nbsp; ss = 1<br />&nbsp; &nbsp; &nbsp; &nbsp; Write(*,&#039;(a2)&#039;, advance = &#039;no&#039;) &#039;==-&#039;<br />! The ... , advance = &#039;no&#039;) &#039;--&quot; keeps the progress dashes moving along on the same line below progress step numbers<br />&nbsp; &nbsp; Endif</p><p>EndDo</p><p>! I do another write to drop below the progress bar and print out my work results<br />Write (*,*)</p><br /><p>Of course, this adds a little overhead to the computing task, but there is something comforting about having an indication that the program is faithfully chugging away while not pushing everything off-screen as would happen when printing increment numbers.</p><p>I hope this helps a Mac user who is jonesing for a progress indicator.<br />It will run on Windows too, but Windows has AppGraphics with its more sophisticated progress bar.<br />This one is good enough for my tasks.</p><p>if some unicode/font options are available, you might find a thicker bar character than the equal sign.</p>]]></description>
			<author><![CDATA[null@example.com (designer)]]></author>
			<pubDate>Sun, 10 Apr 2022 07:05:21 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=3903#p3903</guid>
		</item>
	</channel>
</rss>
