initial commit
[rofl0r-KOL.git] / Inifilesample.htm
blob36e20ffe84507d95ea109d08b37818e61874eb0d
1 <html>
3 <head>
4 <title>KOL Help: Ini file sample.</title>
5 </head>
7 <body bgcolor="#FFFFEF" text="#000000" link="#008080" vlink="#008000" alink="#808000">
9 <h1 align="center">
10 <font face="Arial" color="#FF8080">Ini file sample.</font>
11 </h1>
12 This sample shows how the same Pascal operators can be used both
13 for read and write for the same variables, when working with TIniFile:
14 <p align=left><font face="Courier" color="008080"><b><pre>
15 <font color="800000"><b>procedure</b></font> ReadWriteIni( Write: <font color="800000"><b>Boolean</b></font> );
16 <font color="800000"><b>var</b></font> Ini: PIniFile;
17 <font color="800000"><b>begin</b></font>
18 Ini := <a href="kol_pas.htm#openinifile target="_top""><font color="008080">OpenIniFile</font></a>( <font color="A08020">'MyIniFile.ini'</font> );
19 Ini.<a href="tinifile.htm#section"><font color="008080">Section</font></a> := <font color="A08020">'Main'</font>;
20 <font color="800000"><b>if</b></font> Write <font color="800000"><b>then</b></font> </b><font color="40A040"><em>// if Write, the same operators will save</em></font><b>
21 Ini.<a href="tinifile.htm#mode"><font color="008080">Mode</font></a> := ifmWrite; </b><font color="40A040"><em>// data rather then load.</em></font><b>
22 MyForm.Left := Ini.<a href="tinifile.htm#valueinteger"><font color="008080">ValueInteger</font></a>( <font color="A08020">'Left'</font>, MyForm.Left );
23 MyForm.Top := Ini.<a href="tinifile.htm#valueinteger"><font color="008080">ValueInteger</font></a>( <font color="A08020">'Top'</font>, MyForm.Top );
24 Ini.<a href="tobj.htm#free"><font color="008080">Free</font></a>;
25 <font color="800000"><b>end</b></font>;
27 </pre></b></font></p>
28 <hr>
29 <p align="center"><font face="Comic Sans MS"><small>This help is generated by KOL Help generator, (C) 2000-2001 by Vladimir Kladov<br>Modified (C) 2003 by Alexander Bartov</small></font></p>
30 </body>
31 </html>