1
0
mirror of synced 2024-11-13 22:59:15 +00:00
x2utils/Docs/html/ch02.html

12 lines
3.3 KiB
HTML
Raw Normal View History

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter<EFBFBD>2.<2E>Environment information</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="X<>Utils"><link rel="up" href="index.html" title="X<>Utils"><link rel="previous" href="ch01s03.html" title="License"><link rel="next" href="ch02s02.html" title="X2UtOS.pas"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter<EFBFBD>2.<2E>Environment information</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s03.html">Prev</a><EFBFBD></td><th width="60%" align="center"><EFBFBD></th><td width="20%" align="right"><EFBFBD><a accesskey="n" href="ch02s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id404045"></a>Chapter<EFBFBD>2.<2E>Environment information</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch02.html#id404051">X2UtApp.pas</a></span></dt><dt><span class="section"><a href="ch02s02.html">X2UtOS.pas</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id404051"></a>X2UtApp.pas</h2></div></div><div></div></div><p>
Contains a TX2App class which can be initiated as a singleton using the App() function. It provides information related to the application, such as the executable path and version information.
</p><p>
Note that you should not free the return value of the App() function, the unit's finalization clause takes care of destroying the object when the application closes. This makes it suitable to use the App() function in a way similar to Delphi's Application object.
</p><div class="example"><a name="id495415"></a><p class="title"><b>Example<EFBFBD>2.1.<2E>Using the App function</b></p><p>
MyDataFileLocation := App.Path + <span class="codestring">'data.ini'</span>;
</p></div><p>
The version information is accessible through App.Version. It contains the version numbers and various build flags as specified in the project options. You can also access the version strings through App.Version.Strings, which contain information such as the product name and copyright.
</p><p>
Useful for display purposes is the App.FormatVersion() function. It returns a string with the version information in the format "vX.X.X". If the optional Build parameter is set to True (default), "build X" is appended as well.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s03.html">Prev</a><EFBFBD></td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"><EFBFBD><a accesskey="n" href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">License<EFBFBD></td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"><EFBFBD>X2UtOS.pas</td></tr></table></div></body></html>