ZealOS/docs/Apps/Budget/BgtMain.CC.html
2021-10-27 03:28:16 -04:00

290 lines
24 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V1.04">
<style type="text/css">
body {background-color:#1f1f1f;}
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
.cF1{color:#4f84a6;background-color:#1f1f1f;}
.cF2{color:#73a255;background-color:#1f1f1f;}
.cF3{color:#297582;background-color:#1f1f1f;}
.cF4{color:#b34f4b;background-color:#1f1f1f;}
.cF5{color:#8a52c3;background-color:#1f1f1f;}
.cF6{color:#b7822f;background-color:#1f1f1f;}
.cF7{color:#444444;background-color:#1f1f1f;}
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
.cF9{color:#94bfde;background-color:#1f1f1f;}
.cFA{color:#a1ce97;background-color:#1f1f1f;}
.cFB{color:#6db4be;background-color:#1f1f1f;}
.cFC{color:#e88e88;background-color:#1f1f1f;}
.cFD{color:#ca94e8;background-color:#1f1f1f;}
.cFE{color:#d4b475;background-color:#1f1f1f;}
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF1>extern</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> BgtRegen();
<a name="l2"></a>
<a name="l3"></a></span><span class=cF1>Bool</span><span class=cF0> BgtPutKey(</span><span class=cF9>CDoc</span><span class=cF0> *doc, </span><span class=cF1>U8</span><span class=cF0> *, </span><span class=cF9>I64</span><span class=cF0> ch, </span><span class=cF9>I64</span><span class=cF0> sc)
<a name="l4"></a>{</span><span class=cF2>//ch=ASCII; sc=scan_code</span><span class=cF0>
<a name="l5"></a> </span><span class=cF1>no_warn</span><span class=cF0> sc;
<a name="l6"></a>
<a name="l7"></a> CBgtEntry *tmpb, *tmpb1;
<a name="l8"></a> CBgtTemplate *tmpt, *tmpt1;
<a name="l9"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce;
<a name="l10"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
<a name="l11"></a>
<a name="l12"></a> </span><span class=cF1>switch</span><span class=cF0> (ch)
<a name="l13"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l14"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\n'</span><span class=cF0>:
<a name="l15"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>doc_ce = doc-&gt;cur_entry</span><span class=cF7>)</span><span class=cF0> &amp;&amp; doc_ce != doc &amp;&amp; doc_ce-&gt;type_u8 == </span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0>)
<a name="l16"></a> {
<a name="l17"></a> tmpb = doc_ce-&gt;user_data;
<a name="l18"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt = tmpb-&gt;template)
<a name="l19"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l20"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt1 = BgtTemplatePrompt</span><span class=cF7>(</span><span class=cF0>tmpt</span><span class=cF7>)</span><span class=cF0>)
<a name="l21"></a> {
<a name="l22"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(tmpt);
<a name="l23"></a> BgtTemplatePurge(tmpt);
<a name="l24"></a> BgtEntryDel2(&amp;tmpt-&gt;b);
<a name="l25"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpt);
<a name="l26"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(tmpt1, t_head.last);
<a name="l27"></a> BgtTemplateExpand(tmpt1);
<a name="l28"></a> BgtRegen;
<a name="l29"></a> }
<a name="l30"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l31"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l32"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l33"></a> </span><span class=cF1>if</span><span class=cF0> (tmpb1=BgtEntryPrompt</span><span class=cF7>(</span><span class=cF0>tmpb</span><span class=cF7>)</span><span class=cF0>)
<a name="l34"></a> {
<a name="l35"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(tmpb);
<a name="l36"></a> BgtEntryDel(tmpb);
<a name="l37"></a> BgtIns(tmpb1);
<a name="l38"></a> BgtRegen;
<a name="l39"></a> }
<a name="l40"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l41"></a> }
<a name="l42"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l43"></a>
<a name="l44"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLY</span><span class=cF0>:
<a name="l45"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>doc_ce = doc-&gt;cur_entry</span><span class=cF7>)</span><span class=cF0> &amp;&amp; doc_ce != doc &amp;&amp; doc_ce-&gt;type_u8 == </span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0>)
<a name="l46"></a> {
<a name="l47"></a> tmpb = doc_ce-&gt;user_data;
<a name="l48"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt = tmpb-&gt;template)
<a name="l49"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l50"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(tmpt);
<a name="l51"></a> BgtTemplateDel(tmpt);
<a name="l52"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l53"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l54"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l55"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(tmpb);
<a name="l56"></a> BgtEntryDel(tmpb);
<a name="l57"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l58"></a> BgtRegen;
<a name="l59"></a> }
<a name="l60"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l61"></a>
<a name="l62"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'a'</span><span class=cF0>:
<a name="l63"></a> </span><span class=cF5>PopUpOk</span><span class=cF0>(</span><span class=cF6>&quot;Set the name and color of your accounts.\n&quot;</span><span class=cF0>
<a name="l64"></a> </span><span class=cF6>&quot;To delete accounts, manually edit\n&quot;</span><span class=cF0>
<a name="l65"></a> </span><span class=cF6>&quot;$GREEN$~/Budget/Accts.DD$FG$.&quot;</span><span class=cF0>);
<a name="l66"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>PopUpEd</span><span class=cF7>(</span><span class=cF0>bgt_accts_file, </span><span class=cF5>Fs</span><span class=cF7>)</span><span class=cF0>)
<a name="l67"></a> {
<a name="l68"></a> BgtAcctsRead;
<a name="l69"></a> BgtRegen;
<a name="l70"></a> }
<a name="l71"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l72"></a>
<a name="l73"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'v'</span><span class=cF0>:
<a name="l74"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>st = BgtPopUpAcct(</span><span class=cF6>&quot;View Acct\n\n&quot;</span><span class=cF0>, view_acct)</span><span class=cF7>)</span><span class=cF0> &gt;= </span><span class=cFE>0</span><span class=cF0>)
<a name="l75"></a> {
<a name="l76"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(view_acct, st);
<a name="l77"></a> BgtRegen;
<a name="l78"></a> }
<a name="l79"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l80"></a>
<a name="l81"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'n'</span><span class=cF0>:
<a name="l82"></a> </span><span class=cF1>if</span><span class=cF0> (tmpb1 = BgtEntryPrompt)
<a name="l83"></a> {
<a name="l84"></a> BgtIns(tmpb1);
<a name="l85"></a> BgtRegen;
<a name="l86"></a> }
<a name="l87"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l88"></a>
<a name="l89"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>:
<a name="l90"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt1 = BgtTemplatePrompt)
<a name="l91"></a> {
<a name="l92"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(tmpt1, t_head.last);
<a name="l93"></a> BgtTemplateExpand(tmpt1);
<a name="l94"></a> BgtRegen;
<a name="l95"></a> }
<a name="l96"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l97"></a>
<a name="l98"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'c'</span><span class=cF0>:
<a name="l99"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>doc_ce = doc-&gt;cur_entry</span><span class=cF7>)</span><span class=cF0> &amp;&amp; doc_ce != doc &amp;&amp; doc_ce-&gt;type_u8 == </span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0>)
<a name="l100"></a> tmpb = doc_ce-&gt;user_data;
<a name="l101"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l102"></a> tmpb = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l103"></a> </span><span class=cF1>if</span><span class=cF0> (tmpb1 = BgtEntryPrompt</span><span class=cF7>(</span><span class=cF0>tmpb</span><span class=cF7>)</span><span class=cF0>)
<a name="l104"></a> {
<a name="l105"></a> BgtIns(tmpb1);
<a name="l106"></a> BgtRegen;
<a name="l107"></a> }
<a name="l108"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l109"></a>
<a name="l110"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'p'</span><span class=cF0>:
<a name="l111"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>doc_ce = doc-&gt;cur_entry</span><span class=cF7>)</span><span class=cF0> &amp;&amp; doc_ce != doc &amp;&amp; doc_ce-&gt;type_u8 == </span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0>)
<a name="l112"></a> {
<a name="l113"></a> tmpb = doc_ce-&gt;user_data;
<a name="l114"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt1=BgtTemplatePrompt</span><span class=cF7>(</span><span class=cF0>, tmpb</span><span class=cF7>)</span><span class=cF0>)
<a name="l115"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l116"></a> BgtTemplateExpand(tmpt1, </span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l117"></a> BgtTemplateDel(tmpt1);
<a name="l118"></a> BgtRegen;
<a name="l119"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l120"></a> }
<a name="l121"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l122"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l123"></a>
<a name="l124"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l125"></a>}
<a name="l126"></a>
<a name="l127"></a></span><span class=cF1>U0</span><span class=cF0> BgtRegen()
<a name="l128"></a>{
<a name="l129"></a> </span><span class=cF9>I64</span><span class=cF0> timeout_jiffy, c, color = </span><span class=cF3>COLOR_INVALID</span><span class=cF0>;
<a name="l130"></a> </span><span class=cF1>F64</span><span class=cF0> balance = </span><span class=cFE>0</span><span class=cF0>;
<a name="l131"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc, *pdoc, *ddoc;
<a name="l132"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce;
<a name="l133"></a> CBgtEntry *tmpb = b_head.next, *tmpb_ce;
<a name="l134"></a>
<a name="l135"></a> doc = </span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l136"></a> doc-&gt;flags |= </span><span class=cF3>DOCF_FORM</span><span class=cF0>;
<a name="l137"></a> </span><span class=cF1>while</span><span class=cF0> (tmpb != &amp;b_head)
<a name="l138"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l139"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>view_acct, tmpb-&gt;credit</span><span class=cF7>)</span><span class=cF0>)
<a name="l140"></a> balance -= tmpb-&gt;amount;
<a name="l141"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>view_acct, tmpb-&gt;debit</span><span class=cF7>)</span><span class=cF0>)
<a name="l142"></a> balance += tmpb-&gt;amount;
<a name="l143"></a> c=BgtAcctColor(tmpb-&gt;credit);
<a name="l144"></a> </span><span class=cF1>if</span><span class=cF0> (c != color)
<a name="l145"></a> {
<a name="l146"></a> color = c;
<a name="l147"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$FG,%d$&quot;</span><span class=cF0>, color);
<a name="l148"></a> }
<a name="l149"></a> tmpb-&gt;doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$MU-UL,\&quot;%D %8ts %8ts:%8.2f %8.2f:%$Q\&quot;,U=0x%X$\n&quot;</span><span class=cF0>,
<a name="l150"></a> tmpb-&gt;date, tmpb-&gt;credit, tmpb-&gt;debit, balance, tmpb-&gt;amount, tmpb-&gt;desc, tmpb);
<a name="l151"></a> tmpb = tmpb-&gt;next;
<a name="l152"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l153"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
<a name="l154"></a>
<a name="l155"></a> </span><span class=cF1>if</span><span class=cF0> (pdoc = </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc)
<a name="l156"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l157"></a> </span><span class=cF5>DocLock</span><span class=cF0>(pdoc);
<a name="l158"></a> </span><span class=cF2>//Now, we want to preserve old position in doc, using ugly brute force.</span><span class=cF0>
<a name="l159"></a> </span><span class=cF2>//It's tricky -- can't use old line num because of editor filters.</span><span class=cF0>
<a name="l160"></a>
<a name="l161"></a> </span><span class=cF2>//The price we pay for using the standard document editor is this kludge.</span><span class=cF0>
<a name="l162"></a> </span><span class=cF2>//When Terry originally wrote the budget program, he did not have separate budget</span><span class=cF0>
<a name="l163"></a> </span><span class=cF2>//and line entries, so we never had to resync.</span><span class=cF0>
<a name="l164"></a>
<a name="l165"></a> doc_ce = pdoc-&gt;cur_entry;
<a name="l166"></a> timeout_jiffy = </span><span class=cFB>counts</span><span class=cF0>.jiffies + </span><span class=cF3>JIFFY_FREQ</span><span class=cF0>; </span><span class=cF2>//Max one second.</span><span class=cF0>
<a name="l167"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce != pdoc &amp;&amp; </span><span class=cFB>counts</span><span class=cF0>.jiffies &lt; timeout_jiffy)
<a name="l168"></a> {
<a name="l169"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce-&gt;type_u8 != </span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0> || !</span><span class=cF7>(</span><span class=cF0>tmpb_ce = doc_ce-&gt;user_data</span><span class=cF7>)</span><span class=cF0>)
<a name="l170"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l171"></a> doc_ce = doc_ce-&gt;next;
<a name="l172"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce == pdoc)
<a name="l173"></a> </span><span class=cF1>goto</span><span class=cF0> br_cont;
<a name="l174"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l175"></a> tmpb = b_head.next;
<a name="l176"></a> </span><span class=cF1>while</span><span class=cF0> (tmpb != &amp;b_head)
<a name="l177"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l178"></a> </span><span class=cF1>if</span><span class=cF0> (tmpb == tmpb_ce)
<a name="l179"></a> {
<a name="l180"></a> doc-&gt;cur_entry = tmpb-&gt;doc_e;
<a name="l181"></a> doc-&gt;cur_col = </span><span class=cFE>0</span><span class=cF0>;
<a name="l182"></a> </span><span class=cF5>DocCenter</span><span class=cF0>(doc);
<a name="l183"></a> </span><span class=cF1>goto</span><span class=cF0> br_cont;
<a name="l184"></a> }
<a name="l185"></a> tmpb = tmpb-&gt;next;
<a name="l186"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l187"></a> doc_ce = doc_ce-&gt;next;
<a name="l188"></a> }
<a name="l189"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l190"></a>
<a name="l191"></a> br_cont:
<a name="l192"></a> ddoc = </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc;
<a name="l193"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc =doc;
<a name="l194"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc=doc;
<a name="l195"></a> </span><span class=cF5>DocDel</span><span class=cF0>(pdoc);
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (pdoc != ddoc)
<a name="l197"></a> </span><span class=cF5>DocDel</span><span class=cF0>(ddoc);
<a name="l198"></a> doc-&gt;user_put_key = &amp;BgtPutKey;
<a name="l199"></a>}
<a name="l200"></a>
<a name="l201"></a></span><span class=cF1>U0</span><span class=cF0> Budget(</span><span class=cF1>U8</span><span class=cF0> *dirname=</span><span class=cF6>&quot;~/Budget&quot;</span><span class=cF0>)
<a name="l202"></a>{
<a name="l203"></a> </span><span class=cF9>CDoc</span><span class=cF0> *pdoc, *ddoc, *old_put, *old_display;
<a name="l204"></a>
<a name="l205"></a> </span><span class=cF5>Cd</span><span class=cF0>(dirname);
<a name="l206"></a> bgt_string_file = </span><span class=cF5>FileNameAbs</span><span class=cF0>(</span><span class=cF6>&quot;Strs.DD&quot;</span><span class=cF0>);
<a name="l207"></a> bgt_accts_file = </span><span class=cF5>FileNameAbs</span><span class=cF0>(</span><span class=cF6>&quot;Accts.DD&quot;</span><span class=cF0>);
<a name="l208"></a> bgt_data_file = </span><span class=cF5>FileNameAbs</span><span class=cF0>(</span><span class=cF6>&quot;Bgt.DATA&quot;</span><span class=cF0>);
<a name="l209"></a>
<a name="l210"></a> BgtAcctsRead;
<a name="l211"></a> BgtDataRead;
<a name="l212"></a> CBgtTemplatesExpand;
<a name="l213"></a> </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/TaskSettings.CC.html#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
<a name="l214"></a> </span><span class=cF5>AutoComplete</span><span class=cF0>;
<a name="l215"></a> </span><span class=cF5>WinBorder</span><span class=cF0>;
<a name="l216"></a> </span><span class=cF5>WinMax</span><span class=cF0>;
<a name="l217"></a> </span><span class=cF5>MenuPush</span><span class=cF0>( </span><span class=cF6>&quot;File {&quot;</span><span class=cF0>
<a name="l218"></a> </span><span class=cF6>&quot; Abort(,CH_SHIFT_ESC);&quot;</span><span class=cF0>
<a name="l219"></a> </span><span class=cF6>&quot; Exit(,CH_ESC);&quot;</span><span class=cF0>
<a name="l220"></a> </span><span class=cF6>&quot;}&quot;</span><span class=cF0>
<a name="l221"></a> </span><span class=cF6>&quot;Edit {&quot;</span><span class=cF0>
<a name="l222"></a> </span><span class=cF6>&quot; NewEntry(,'n');&quot;</span><span class=cF0>
<a name="l223"></a> </span><span class=cF6>&quot; CopyEntry(,'c');&quot;</span><span class=cF0>
<a name="l224"></a> </span><span class=cF6>&quot; PeriodicEntry(,'p');&quot;</span><span class=cF0>
<a name="l225"></a> </span><span class=cF6>&quot; EditEntry(,'\n');&quot;</span><span class=cF0>
<a name="l226"></a> </span><span class=cF6>&quot; DeleteEntry(,CH_CTRLY);&quot;</span><span class=cF0>
<a name="l227"></a> </span><span class=cF6>&quot; NewTemplate(,'t');&quot;</span><span class=cF0>
<a name="l228"></a> </span><span class=cF6>&quot; AcctsFile(,'a');&quot;</span><span class=cF0>
<a name="l229"></a> </span><span class=cF6>&quot;}&quot;</span><span class=cF0>
<a name="l230"></a> </span><span class=cF6>&quot;View {&quot;</span><span class=cF0>
<a name="l231"></a> </span><span class=cF6>&quot; ViewAcct(,'v');&quot;</span><span class=cF0>
<a name="l232"></a> </span><span class=cF6>&quot;}&quot;</span><span class=cF0>
<a name="l233"></a> );
<a name="l234"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(view_acct, </span><span class=cF6>&quot;BANK&quot;</span><span class=cF0>);
<a name="l235"></a> </span><span class=cF5>DocMax</span><span class=cF0>;
<a name="l236"></a> old_put = </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc;
<a name="l237"></a> old_display = </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc;
<a name="l238"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l239"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l240"></a> BgtRegen;
<a name="l241"></a> </span><span class=cF1>try</span><span class=cF0>
<a name="l242"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>View</span><span class=cF0>)
<a name="l243"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l244"></a> BgtDataWrite;
<a name="l245"></a> BgtAcctsWrite;
<a name="l246"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l247"></a> </span><span class=cF1>catch</span><span class=cF0>
<a name="l248"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
<a name="l249"></a>
<a name="l250"></a> pdoc = </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc;
<a name="l251"></a> ddoc = </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc;
<a name="l252"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc = old_put;
<a name="l253"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc = old_display;
<a name="l254"></a> </span><span class=cF5>DocDel</span><span class=cF0>(pdoc);
<a name="l255"></a> </span><span class=cF1>if</span><span class=cF0> (pdoc != ddoc)
<a name="l256"></a> </span><span class=cF5>DocDel</span><span class=cF0>(ddoc);
<a name="l257"></a>
<a name="l258"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
<a name="l259"></a> BgtDel;
<a name="l260"></a> </span><span class=cF5>MenuPop</span><span class=cF0>;
<a name="l261"></a>}
</span></pre></body>
</html>