📄 pjenvvar.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>delphiDabbler.com: Info Sheet: Environment Variable Management Unit</title>
<base target="_blank">
<style>
<!--
body {
background-color: White;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10pt;
}
h1 {font-size: 12pt;}
h2 {font-size: 10pt;}
h3 {font-size: 10pt; font-style: italic;}
h4 {font-size: 10pt; font-weight: normal; font-style: italic;}
-->
</style>
</head>
<body>
<h1>Environment Variable Management Unit</h1>
<hr noshade>
<h2>Contents</h2>
<ul>
<li><a href="#Description" target="_self">Description</a></li>
<li><a href="#Compatibility" target="_self">Compatibility</a></li>
<li><a href="#Installation" target="_self">Installation</a></li>
<li><a href="#Issues" target="_self">Known Issues</a></li>
<li><a href="#Update" target="_self">Update History</a></li>
<li><a href="#License" target="_self">License and Disclaimer</a></li>
<li><a href="#Author" target="_self">About the Author</a></li>
</ul>
<hr noshade>
<h2><a name="Description"></a>Description</h2>
<p>This unit provides a component and a set of routines for managing and manipulating
environment variables.</p>
<hr noshade>
<h2><a name="Compatibility"></a>Compatibility</h2>
<p>The unit is compatible with Delphi 3 to 7. It has been tested with Delphi 4, 6 and 7.</p>
<hr noshade>
<h2><a name="Installation"></a>Installation</h2>
<p>In these instructions <code><strong>$(DELPHI)</strong></code> is to be taken
to represent the path where the appropriate version of Delphi was installed.
For example, if you have Delphi 4 installed on the default installation path
then <code>$(DELPHI)</code> is equivalent to
<code>C:\Program Files\Borland\Delphi4</code>.</p>
<h3>Installation with Delphi 3 & later</h3>
<ol>
<li>Unzip the file <code>pjenvvar.zip</code> into a folder, preserving the directory
structure.
<li>Copy <code>PJEnvVars.pas</code> and <code>PJEnvVars.dcr</code> to the folder
from where you wish to install the component into the Delphi Component Palette.
This will probably be a sub-folder of the <code>$(DELPHI)\lib</code> folder.</li>
<li>Install the component into the palette by chosing the <em>Component | Install
Component</em> menu option.
<ul>
<li>Select the "Into exisiting package" page of the <em>Install Components</em>
dialog box.</li>
<li>Browse to the folder where you saved <code>PJEnvVars.pas</code> and select
the file.</li>
<li>Choose a package into which to install the component.</li>
<li>Accept that the package will be rebuilt.</li>
<li>A dialog box should be displayed saying that <em>TPJEnvVars</em> has
been added to the component palette.</li>
</ul>
</li>
<li>You can now delete <code>PJEnvVars.pas</code> from the place where you copied
it if you wish. The component will appear on a palette called <em>DelphiDabbler</em>.
You can move the component to a different palette if required.</li>
<li>The simplest way to install the help file is to use my <em><a href="http://www.delphidabbler.com/chi">Component
Help Installer Expert</a>.</em> To install manually, proceed as follows:</li>
<ul>
<li>Copy <code>PJEnvVars.hlp</code> to whichever folder you wish to install
it to.</li>
<li>In Delphi 3 to 6 (where X is the Delphi version 3..6):
<ul>
<li>Edit <code>DelphiX.ohl</code> (in <code>$(DELPHI)\Help</code>), adding
the line <code>:Link PJEnvVars.hlp</code> to the end of the section labelled
"Third party help".</li>
<li>Edit <code>DelphiX.ohi</code> (in <code>$(DELPHI)\Help</code>), adding
the line <code>:Index DelphiDabbler Environment
Variables=PJEnvVars.hlp</code>
towards the end of the index section.</li>
<li>Edit <code>DelphiX.cnt</code> (in <code>$(DELPHI)\Help</code>), ensuring
that the lines <code>:Include delphiX.ohi</code> and <code>:Include
delphiX.ohl</code> appear somewhere in the file.</li>
</ul>
</li>
<li>In Delphi 7
<ul>
<li>Edit <code>D7.ohl</code> (in <code>$(DELPHI)\Help</code>), adding
the line <code>:Link PJEnvVars.hlp</code> to the end of the section labelled
"Third party help".</li>
<li>Edit <code>D7.ohi</code> (in <code>$(DELPHI)\Help</code>), adding
the line <code>:Index DelphiDabbler Environment
Variables=PJEnvVars.hlp</code>
towards the end of the index section.</li>
<li>Edit <code>D7.cnt</code> (in <code>$(DELPHI)\Help</code>), ensuring
that the lines <code>:Include d7.ohi</code> and <code>:Include d7.ohl</code>
appear somewhere in the file.</li>
</ul>
</li>
<li>Using <em>RegEdit</em> open the key <code>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Help</code>
and add a new string value named <code>PJEnvVars.hlp</code> whose value is
the path where you copied the help file (probably <code>($DELPHI)\Help</code>).</li>
</ul>
</ol>
<hr noshade>
<h2><a name="Issues"></a>Known Issues</h2>
<p>In versions up to 1.1 an error was triggered if an attempt was made to read a
non-existant environment variable. <em>Bug fixed in v1.2</em></p>
<hr noshade>
<h2><a name="Update"></a>Update History</h2>
<p><strong>Release 1.0 of 02 Sep 2001</strong><br />
<em>PJEnvVars v1.0 of 02 Sep 2001</em></p>
<ul>
<li>Original version with help file and HTML documentation.</li>
</ul>
<p><strong>Not released</strong><br />
<em>PJEnvVars v1.1 of 31 Jul 2003</em></p>
<ul>
<li>Updated component palette from "PJ Stuff" to "DelphiDabbler".</li>
<li>Changed references to EWin32Error exception to EOSError in components compiled
with Delphi 6 and later.</li>
<li>Updated copyright date and owner in help file.</li>
</ul>
<p><strong>Release 1.2 of 10 Aug 2003</strong><br />
<em>PJEnvVars v1.2 of 10 Aug 2003</em></p>
<ul>
<li>Fixed bug causing error when attempting to access environment variable
that does not exist.</li>
</ul>
<hr noshade>
<h2><a name="License"></a>License & Disclaimer</h2>
<p>This unit and help file are copyright © P.D.Johnson, 2001-2003.</p>
<p>The source code and help files can be freely distributed on a not-for-profit basis
providing that:</p>
<ol>
<li>the source code is not altered</li>
<li>this file is distributed with it unchanged.</li>
</ol>
<p>By not-for-profit I mean that you may recover out of pocket expenses incurred in
distributing the code, but should not make a profit from this.</p>
<p>If you discover any bugs in this implementation, or if you have any update
suggestions, please contact me at
<a href="mailto:peter.johnson@openlink.org">peter.johnson@openlink.org</a>.</p>
<p>Please do modify the code for you own use. I'd like to see any changes you make -
I could incorporate them into future versions. Please notify me of changes on at
the above e-mail address.</p>
<p>This software is provided as is - no warranty is given as to its suitability for
any purposes to which you may wish to put it.</p>
<hr noshade>
<h2><a name="Author"></a>About the Author</h2>
<p>I'm Peter Johnson - a hobbyist programmer living in Ceredigion in West Wales,
UK, writing mainly in Delphi. My programs are available for download on my
web-site:
<a href="http://www.delphidabbler.com/">http://www.delphidabbler.com/</a>.</p>
<p>I can be contacted by e-mail at
<a href="mailto:peter.johnson@openlink.org">peter.johnson@openlink.org</a>.
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -