<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=DEBUG.MSG</id>
	<title>DEBUG.MSG - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=DEBUG.MSG"/>
	<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=DEBUG.MSG&amp;action=history"/>
	<updated>2026-04-28T23:41:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://pickwiki.org/index.php?title=DEBUG.MSG&amp;diff=1708&amp;oldid=prev</id>
		<title>Conversion script: link fix</title>
		<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=DEBUG.MSG&amp;diff=1708&amp;oldid=prev"/>
		<updated>2015-02-26T23:48:54Z</updated>

		<summary type="html">&lt;p&gt;link fix&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;HomePage&amp;gt;&amp;gt;SourceCode&amp;gt;&amp;gt;BasicSource&amp;gt;&amp;gt;SvnWrapper&amp;gt;&amp;gt;DEBUG.MSG&lt;br /&gt;
&lt;br /&gt;
Builds a list of Debug messages for later display/email/etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
                         subroutine DEBUG.MSG( MSG, Params )&lt;br /&gt;
* @SUB Add a message to the current Debug list&lt;br /&gt;
* =======================================================================================&lt;br /&gt;
* 02.Mar.2010 james: &amp;#039;A&amp;#039; is finally &amp;#039;[[AppendToPreviousLine]]&amp;#039; as it was supposed to be.&lt;br /&gt;
* 22.Feb.2010 james: Add DEBUG.MSG DEBUG.FLAG in case caller breaks before finishing.&lt;br /&gt;
* 14.Jul.2009 james: s&amp;#039;W&amp;#039;ap lines&lt;br /&gt;
* 07.Jul.2009 james: First draft&lt;br /&gt;
* =======================================================================================&lt;br /&gt;
* $Id$&lt;br /&gt;
* =======================================================================================&lt;br /&gt;
*&lt;br /&gt;
*  Move code from SELECT.FORMS into this subroutine so it can also be used from AUDIT.SUB.&lt;br /&gt;
*&lt;br /&gt;
* Example usage:&lt;br /&gt;
*&lt;br /&gt;
* - First clear the Messages and turn on message tracking (like &amp;#039;S&amp;#039; option) :&lt;br /&gt;
*&lt;br /&gt;
*    call DEBUG.MSG( &amp;#039;&amp;#039;, &amp;#039;C&amp;#039; )&lt;br /&gt;
*&lt;br /&gt;
* - Now add messages as necessary; start with &amp;#039;|&amp;#039; to force a new line:&lt;br /&gt;
*&lt;br /&gt;
*    call DEBUG.MSG( &amp;quot;| Plan Selection Type is &amp;#039;&amp;quot;:PLAN$SELECT.TYPE:&amp;quot;&amp;#039;&amp;quot;, &amp;#039;&amp;#039; )&lt;br /&gt;
*    call DEBUG.MSG( &amp;#039;| Executing saved DELETE commands ...&amp;#039;, &amp;#039;&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
*   call DEBUG.MSG( &amp;#039;Error Message&amp;#039;, &amp;#039;A&amp;#039; )  ;*  Append the message to the last line&lt;br /&gt;
*   call DEBUG.MSG( &amp;#039;&amp;#039;, &amp;#039;P&amp;#039; ) ;*  &amp;#039;P&amp;#039;rint debug messages&lt;br /&gt;
*   call DEBUG.MSG( &amp;#039; Document Selection for &amp;#039;:WS.NUM:&amp;#039; &amp;#039;, &amp;#039;D&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
* =======================================================================================&lt;br /&gt;
&lt;br /&gt;
  $include RMS.BP RMS.COMMON&lt;br /&gt;
  $include RMS.BP DEBUG.COMMON&lt;br /&gt;
&lt;br /&gt;
  *  Use this in case the program you&amp;#039;re working on never gets to the &amp;#039;D&amp;#039; call; i.e.&lt;br /&gt;
  *  it&amp;#039;s blowing before you see anything in here !:&lt;br /&gt;
  locate &amp;#039;DEBUG.MSG&amp;#039; in DEBUG.FLAG&amp;lt;1&amp;gt; setting dum then [[DebugIt]] = @TRUE else [[DebugIt]] = @FALSE&lt;br /&gt;
&lt;br /&gt;
  Opt = Params&amp;lt;1&amp;gt;&lt;br /&gt;
  begin case&lt;br /&gt;
    case Opt = &amp;#039;A&amp;#039; ; gosub [[AppendToPreviousLine]]&lt;br /&gt;
    case Opt = &amp;#039;S&amp;#039; ; DEBUG.ON = @TRUE    ;*  &amp;#039;S&amp;#039;tart&lt;br /&gt;
    case Opt = &amp;#039;E&amp;#039; ; DEBUG.ON = @FALSE   ;*  &amp;#039;E&amp;#039;nd&lt;br /&gt;
    case Opt = &amp;#039;C&amp;#039; ; DEBUG.DISPLAY = MSG ; DEBUG.ON = @TRUE  ;*  &amp;#039;C&amp;#039;lear and start&lt;br /&gt;
    case Opt = &amp;#039;D&amp;#039; ; gosub [[DisplayDebugMessages]] ; DEBUG.ON = @FALSE&lt;br /&gt;
    case Opt = &amp;#039;P&amp;#039; ; gosub [[PrintDebugMessages]]   ; DEBUG.ON = @FALSE&lt;br /&gt;
    case Opt = &amp;#039;R&amp;#039; ; MSG = DEBUG.DISPLAY        ;*  &amp;#039;R&amp;#039;eturn the current display&lt;br /&gt;
    case Opt = &amp;#039;W&amp;#039; ; if DEBUG.ON and MSG # &amp;#039;&amp;#039; then gosub [[SwapMessages]]&lt;br /&gt;
    case 1         ; if DEBUG.ON and MSG # &amp;#039;&amp;#039; then gosub [[AddMsg]]&lt;br /&gt;
  end case&lt;br /&gt;
  &lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
[[AppendToPreviousLine]]:&lt;br /&gt;
  if DEBUG.DISPLAY&amp;#039;R#1&amp;#039; = @FM then DEBUG.DISPLAY = DEBUG.DISPLAY[1, len(DEBUG.DISPLAY) - 1]&lt;br /&gt;
  gosub [[AddMsg]]&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
*  This is a little trick: if you&amp;#039;re in the middle of adding a line; but find some&lt;br /&gt;
*  condition that needs to be put ABOVE this line; use &amp;#039;W&amp;#039; to &amp;#039;Swap out&amp;#039; the current&lt;br /&gt;
*  line with the message (i.e. insert MSG BEFORE the last line...).&lt;br /&gt;
&lt;br /&gt;
[[SwapMessages]]:&lt;br /&gt;
  [[NumLines]] = dcount( DEBUG.DISPLAY, @FM )&lt;br /&gt;
  [[LastLine]] = DEBUG.DISPLAY&amp;lt; [[NumLines]] &amp;gt;&lt;br /&gt;
  DEBUG.DISPLAY&amp;lt; [[NumLines]] &amp;gt; = MSG&lt;br /&gt;
  if MSG[len(MSG),1] # &amp;#039;:&amp;#039; then  ;*  &amp;#039;:&amp;#039; at the end means &amp;#039;no new line&amp;#039;&lt;br /&gt;
    DEBUG.DISPLAY := @FM&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  MSG = [[LastLine]] ; gosub [[AddMsg]]&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
[[AddMsg]]:&lt;br /&gt;
  if [[DebugIt]] then crt &amp;#039;Adding &amp;#039;:MSG&lt;br /&gt;
  loop while MSG[1,1] = &amp;#039;|&amp;#039; do     ;*  &amp;#039;|&amp;#039; at the beginning means &amp;#039;new lines&amp;#039;&lt;br /&gt;
    DEBUG.DISPLAY := @FM&lt;br /&gt;
    MSG = MSG[2, 99999]&lt;br /&gt;
  repeat&lt;br /&gt;
&lt;br /&gt;
  DEBUG.DISPLAY := MSG   ;*  Finally add text OR a chunk of lines or whatever.&lt;br /&gt;
&lt;br /&gt;
  if MSG[len(MSG),1] # &amp;#039;:&amp;#039; then  ;*  &amp;#039;:&amp;#039; at the end means &amp;#039;no new line&amp;#039;&lt;br /&gt;
    DEBUG.DISPLAY := @FM&lt;br /&gt;
  end&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
[[DisplayDebugMessages]]:&lt;br /&gt;
  Heading = MSG&lt;br /&gt;
  OPTIONS = &amp;#039;FULL.SCREEN&amp;#039;&lt;br /&gt;
  call BOX.DISP.ITEM( DEBUG.DISPLAY, Heading, &amp;#039;&amp;#039;, &amp;#039;&amp;#039;, OPTIONS, OUT)&lt;br /&gt;
  DEBUG.DISPLAY = &amp;#039;&amp;#039;    ;*  never print something twice: just in case calling logic is messed up.&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
*  Does this even work ?&lt;br /&gt;
 &lt;br /&gt;
[[PrintDebugMessages]]:&lt;br /&gt;
  printer on&lt;br /&gt;
  [[NumLines]] = dcount(DEBUG.DISPLAY, @FM)&lt;br /&gt;
  for N.L = 1 to [[NumLines]]&lt;br /&gt;
    print DEBUG.DISPLAY&amp;lt; N.L &amp;gt;&lt;br /&gt;
  next N.L&lt;br /&gt;
  call PRT.OFF&lt;br /&gt;
return&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;/div&gt;</summary>
		<author><name>Conversion script</name></author>
	</entry>
</feed>