ZealOS/docs/Demo/DolDoc/Form.html
2021-07-03 02:51:43 -04:00

83 lines
7.7 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V0.05">
<style type="text/css">
body {background-color:#000000;}
.cF0{color:#ffffff;background-color:#000000;}
.cF1{color:#3465a4;background-color:#000000;}
.cF2{color:#4e9a06;background-color:#000000;}
.cF3{color:#06989a;background-color:#000000;}
.cF4{color:#a24444;background-color:#000000;}
.cF5{color:#75507b;background-color:#000000;}
.cF6{color:#ce982f;background-color:#000000;}
.cF7{color:#bcc0b9;background-color:#000000;}
.cF8{color:#555753;background-color:#000000;}
.cF9{color:#729fcf;background-color:#000000;}
.cFA{color:#82bc49;background-color:#000000;}
.cFB{color:#34e2e2;background-color:#000000;}
.cFC{color:#ac3535;background-color:#000000;}
.cFD{color:#ad7fa8;background-color:#000000;}
.cFE{color:#fce94f;background-color:#000000;}
.cFF{color:#000000;background-color:#000000;}
</style>
</head>
<body>
<pre style="font-family:courier;font-size:10pt">
<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://tomawezome.github.io/ZealOS/System/Debug.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>