ZealOS/docs/Demo/DolDoc/Form.CC.html
2021-08-17 02:47:37 -04:00

83 lines
7.4 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.00">
<style type="text/css">
body {background-color:#fef1f0;}
.cF0{color:#000000;background-color:#fef1f0;}
.cF1{color:#0148a4;background-color:#fef1f0;}
.cF2{color:#3b7901;background-color:#fef1f0;}
.cF3{color:#057c7e;background-color:#fef1f0;}
.cF4{color:#bb2020;background-color:#fef1f0;}
.cF5{color:#9e42ae;background-color:#fef1f0;}
.cF6{color:#b57901;background-color:#fef1f0;}
.cF7{color:#b2b6af;background-color:#fef1f0;}
.cF8{color:#555753;background-color:#fef1f0;}
.cF9{color:#678fbb;background-color:#fef1f0;}
.cFA{color:#82bc49;background-color:#fef1f0;}
.cFB{color:#0097a2;background-color:#fef1f0;}
.cFC{color:#e26a6a;background-color:#fef1f0;}
.cFD{color:#c671bc;background-color:#fef1f0;}
.cFE{color:#c7ab00;background-color:#fef1f0;}
.cFF{color:#fef1f0;background-color:#fef1f0;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF1>class</span><span class=cF0> FDStruct
<a name="l2"></a>{</span><span class=cF2>//Use &lt;CTRL-l&gt; and sel &quot;Data&quot;, &quot;List&quot; or &quot;Check Box&quot;</span><span class=cF0>
<a name="l3"></a></span><span class=cF2>//to generate the formats.</span><span class=cF0>
<a name="l4"></a> </span><span class=cF1>F64</span><span class=cF0> num1 format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Float 1:%12.8f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l5"></a> </span><span class=cF1>F64</span><span class=cF0> num2 format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Float 2:%12e\&quot;$\n&quot;</span><span class=cF0>;
<a name="l6"></a> </span><span class=cF9>I64</span><span class=cF0> num3 format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Int 1:0x%016X\&quot;$\n&quot;</span><span class=cF0>;
<a name="l7"></a> </span><span class=cF9>I64</span><span class=cF0> num4 format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Int 2:%12d\&quot;$\n&quot;</span><span class=cF0>;
<a name="l8"></a> </span><span class=cF9>I64</span><span class=cF0> type format </span><span class=cF6>&quot;$LS,D=\&quot;ST_PERSON_TYPE\&quot;$\n&quot;</span><span class=cF0>;
<a name="l9"></a> </span><span class=cF1>U8</span><span class=cF0> name[</span><span class=cFE>32</span><span class=cF0>] format </span><span class=cF6>&quot;$DA-P,A=\&quot;Name :%s\&quot;$\n&quot;</span><span class=cF0>;
<a name="l10"></a> </span><span class=cF1>U8</span><span class=cF0> *address1 format </span><span class=cF6>&quot;$DA+M,A=\&quot;Address:%s\&quot;$\n&quot;</span><span class=cF0>; </span><span class=cF2>//+M is unlimited len U8 *.</span><span class=cF0>
<a name="l11"></a> </span><span class=cF1>U8</span><span class=cF0> *address2 format </span><span class=cF6>&quot;$DA+M,A=\&quot;Address:%s\&quot;$\n&quot;</span><span class=cF0>; </span><span class=cF2>//+M is unlimited len U8 *.</span><span class=cF0>
<a name="l12"></a> </span><span class=cF9>CDate</span><span class=cF0> datetime format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Date :%8D\&quot;$\n&quot;</span><span class=cF0>;
<a name="l13"></a> </span><span class=cF1>Bool</span><span class=cF0> check format </span><span class=cF6>&quot;$CB,\&quot;Check\&quot;$\n&quot;</span><span class=cF0>;
<a name="l14"></a>};
<a name="l15"></a>
<a name="l16"></a></span><span class=cF1>U0</span><span class=cF0> FormDemo()
<a name="l17"></a>{
<a name="l18"></a> FDStruct fds;
<a name="l19"></a>
<a name="l20"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>&quot;ST_PERSON_TYPE&quot;</span><span class=cF0>,</span><span class=cF6>&quot;Child\0Teen\0Adult\0&quot;</span><span class=cF0>);
<a name="l21"></a> fds.num1 = </span><span class=cFE>12</span><span class=cF0>.</span><span class=cFE>3</span><span class=cF0>e-</span><span class=cFE>4</span><span class=cF0>; </span><span class=cF2>//Set defaults</span><span class=cF0>
<a name="l22"></a> fds.num2 = </span><span class=cFE>4</span><span class=cF0>.</span><span class=cFE>5</span><span class=cF0>e3;
<a name="l23"></a> fds.num3 = </span><span class=cFE>0x1234</span><span class=cF0>;
<a name="l24"></a> fds.num4 = -</span><span class=cFE>567</span><span class=cF0>;
<a name="l25"></a> fds.type = </span><span class=cFE>1</span><span class=cF0>;
<a name="l26"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(&amp;fds.name, </span><span class=cF6>&quot;John&quot;</span><span class=cF0>);
<a name="l27"></a> fds.address1 = </span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF6>&quot;1234 Pine St.&quot;</span><span class=cF0>);
<a name="l28"></a> fds.address2 = </span><span class=cF3>NULL</span><span class=cF0>; </span><span class=cF2>//Init to NULL if empty.</span><span class=cF0>
<a name="l29"></a> fds.datetime = </span><span class=cF5>Now</span><span class=cF0>;
<a name="l30"></a> fds.check = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocForm</span><span class=cF7>(</span><span class=cF0>&amp;fds</span><span class=cF7>)</span><span class=cF0>)
<a name="l32"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l33"></a> </span><span class=cF6>&quot;#1\t=%e\n&quot;</span><span class=cF0>, fds.num1;
<a name="l34"></a> </span><span class=cF6>&quot;#2\t=%e\n&quot;</span><span class=cF0>, fds.num2;
<a name="l35"></a> </span><span class=cF6>&quot;#3\t=%d\n&quot;</span><span class=cF0>, fds.num3;
<a name="l36"></a> </span><span class=cF6>&quot;#4\t=%d\n&quot;</span><span class=cF0>, fds.num4;
<a name="l37"></a> </span><span class=cF6>&quot;Type\t=%s\n&quot;</span><span class=cF0>, </span><span class=cF5>DefineSub</span><span class=cF0>(fds.type,</span><span class=cF6>&quot;ST_PERSON_TYPE&quot;</span><span class=cF0>);
<a name="l38"></a> </span><span class=cF6>&quot;Name\t=%s\n&quot;</span><span class=cF0>, fds.name;
<a name="l39"></a> </span><span class=cF6>&quot;Address1=%s\n&quot;</span><span class=cF0>, fds.address1;
<a name="l40"></a> </span><span class=cF6>&quot;Address2=%s\n&quot;</span><span class=cF0>, fds.address2;
<a name="l41"></a> </span><span class=cF6>&quot;Date\t=%D\n&quot;</span><span class=cF0>, fds.datetime;
<a name="l42"></a> </span><span class=cF6>&quot;Check\t=%d\n&quot;</span><span class=cF0>, fds.check;
<a name="l43"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l44"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l45"></a> </span><span class=cF6>&quot;Cancel\n&quot;</span><span class=cF0>;
<a name="l46"></a>
<a name="l47"></a> </span><span class=cF6>&quot;\n\nClassRep Example\n&quot;</span><span class=cF0>;
<a name="l48"></a> </span><span class=cF5>ClassRep</span><span class=cF0>(&amp;fds);
<a name="l49"></a> </span><span class=cF5>Free</span><span class=cF0>(fds.address1);
<a name="l50"></a> </span><span class=cF5>Free</span><span class=cF0>(fds.address2);
<a name="l51"></a> </span><span class=cF2>//See also </span><a href="https://zeal-operating-system.github.io/ZealOS/System/Debug.CC.html#l246"><span class=cF4>ClassRepD</span></a><span class=cF2>().</span><span class=cF0>
<a name="l52"></a>}
<a name="l53"></a>
<a name="l54"></a>FormDemo;
</span></pre></body>
</html>