mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 08:16:31 +00:00
83 lines
7.4 KiB
HTML
Executable file
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 <CTRL-l> and sel "Data", "List" or "Check Box"</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>"$DA-TRM,A=\"Float 1:%12.8f\"$\n"</span><span class=cF0>;
|
|
<a name="l5"></a> </span><span class=cF1>F64</span><span class=cF0> num2 format </span><span class=cF6>"$DA-TRM,A=\"Float 2:%12e\"$\n"</span><span class=cF0>;
|
|
<a name="l6"></a> </span><span class=cF9>I64</span><span class=cF0> num3 format </span><span class=cF6>"$DA-TRM,A=\"Int 1:0x%016X\"$\n"</span><span class=cF0>;
|
|
<a name="l7"></a> </span><span class=cF9>I64</span><span class=cF0> num4 format </span><span class=cF6>"$DA-TRM,A=\"Int 2:%12d\"$\n"</span><span class=cF0>;
|
|
<a name="l8"></a> </span><span class=cF9>I64</span><span class=cF0> type format </span><span class=cF6>"$LS,D=\"ST_PERSON_TYPE\"$\n"</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>"$DA-P,A=\"Name :%s\"$\n"</span><span class=cF0>;
|
|
<a name="l10"></a> </span><span class=cF1>U8</span><span class=cF0> *address1 format </span><span class=cF6>"$DA+M,A=\"Address:%s\"$\n"</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>"$DA+M,A=\"Address:%s\"$\n"</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>"$DA-TRM,A=\"Date :%8D\"$\n"</span><span class=cF0>;
|
|
<a name="l13"></a> </span><span class=cF1>Bool</span><span class=cF0> check format </span><span class=cF6>"$CB,\"Check\"$\n"</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>"ST_PERSON_TYPE"</span><span class=cF0>,</span><span class=cF6>"Child\0Teen\0Adult\0"</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>(&fds.name, </span><span class=cF6>"John"</span><span class=cF0>);
|
|
<a name="l27"></a> fds.address1 = </span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF6>"1234 Pine St."</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>&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>"#1\t=%e\n"</span><span class=cF0>, fds.num1;
|
|
<a name="l34"></a> </span><span class=cF6>"#2\t=%e\n"</span><span class=cF0>, fds.num2;
|
|
<a name="l35"></a> </span><span class=cF6>"#3\t=%d\n"</span><span class=cF0>, fds.num3;
|
|
<a name="l36"></a> </span><span class=cF6>"#4\t=%d\n"</span><span class=cF0>, fds.num4;
|
|
<a name="l37"></a> </span><span class=cF6>"Type\t=%s\n"</span><span class=cF0>, </span><span class=cF5>DefineSub</span><span class=cF0>(fds.type,</span><span class=cF6>"ST_PERSON_TYPE"</span><span class=cF0>);
|
|
<a name="l38"></a> </span><span class=cF6>"Name\t=%s\n"</span><span class=cF0>, fds.name;
|
|
<a name="l39"></a> </span><span class=cF6>"Address1=%s\n"</span><span class=cF0>, fds.address1;
|
|
<a name="l40"></a> </span><span class=cF6>"Address2=%s\n"</span><span class=cF0>, fds.address2;
|
|
<a name="l41"></a> </span><span class=cF6>"Date\t=%D\n"</span><span class=cF0>, fds.datetime;
|
|
<a name="l42"></a> </span><span class=cF6>"Check\t=%d\n"</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>"Cancel\n"</span><span class=cF0>;
|
|
<a name="l46"></a>
|
|
<a name="l47"></a> </span><span class=cF6>"\n\nClassRep Example\n"</span><span class=cF0>;
|
|
<a name="l48"></a> </span><span class=cF5>ClassRep</span><span class=cF0>(&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>
|