<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>SETPROFILESTRING</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">SETPROFILESTRING</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Sets the value of a profile entry in an initialization file.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
An empty string, upon successful execution; otherwise, an error message.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
System functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>SetProfileString(<i>ini</i>Path, section, entry, value)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
GetProfileSections, GetProfileString, SetProfileString
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;h3&gt;SetProfileString Example&lt;/h3&gt;
This example uses SetProfileString to set the timeout value in an 
initialization file. Enter the full path of your initialization 
file, specify the timeout value, and submit the form.
&lt;!--- This section checks whether the form was submitted. If so, this 
section sets the initialization path and timeout value to the 
path and timeout value specified in the form ---&gt;
&lt;cfif Isdefined(&quot;Form.Submit&quot;)&gt;

   &lt;cfset IniPath = FORM.iniPath&gt;
   &lt;cfset Section = &quot;boot loader&quot;&gt;
   &lt;cfset MyTimeout = FORM.MyTimeout&gt;
   &lt;cfset timeout = GetProfileString(IniPath, Section, &quot;timeout&quot;)&gt;

   &lt;cfif timeout Is Not MyTimeout&gt;
    &lt;cfif MyTimeout Greater Than 0&gt;
       &lt;hr size = &quot;2&quot; color = &quot;#0000A0&quot;&gt;
      &lt;p&gt;Setting the timeout value to &lt;cfoutput&gt;#MyTimeout#&lt;/cfoutput&gt;
      &lt;/p&gt;
         &lt;cfset code = SetProfileString(IniPath, 
            Section, &quot;timeout&quot;, MyTimeout)&gt;
      &lt;p&gt;Value returned from SetProfileString: 
            &lt;cfoutput&gt;#code#&lt;/cfoutput&gt;&lt;/p&gt;
      &lt;cfelse&gt;
         &lt;hr size = &quot;2&quot; color = &quot;red&quot;&gt;
         &lt;p&gt;Timeout value should be greater than zero in order to
            provide time for user response.&lt;/p&gt;
         &lt;hr size = &quot;2&quot; color = &quot;red&quot;&gt;   
      &lt;/cfif&gt;
   &lt;cfelse&gt;
      &lt;p&gt;The timeout value in your initialization file is already
         &lt;cfoutput&gt;#MyTimeout#&lt;/cfoutput&gt;.&lt;/p&gt;   
   &lt;/cfif&gt;
   &lt;cfset timeout = GetProfileString(IniPath, Section, &quot;timeout&quot;)&gt;
   &lt;cfset default = GetProfileString(IniPath, Section, &quot;default&quot;)&gt;
   
   &lt;h4&gt;Boot Loader&lt;/h4&gt;
   &lt;p&gt;Timeout is set to: &lt;cfoutput&gt;#timeout#&lt;/cfoutput&gt;.&lt;/p&gt;
   &lt;p&gt;Default directory is: &lt;cfoutput&gt;#default#&lt;/cfoutput&gt;.&lt;/p&gt;
      
&lt;/cfif&gt;

&lt;form action = &quot;setprofilestring.cfm&quot;&gt;
&lt;hr size = &quot;2&quot; color = &quot;#0000A0&quot;&gt;
&lt;table cellspacing = &quot;2&quot; cellpadding = &quot;2&quot; border = &quot;0&quot;&gt;
&lt;tr&gt;
  &lt;td&gt;Full Path of Init File&lt;/td&gt;
  &lt;td&gt;&lt;input type = &quot;Text&quot; name = &quot;IniPath&quot; 
            value = &quot;C:\myboot.ini&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Timeout&lt;/td&gt;
  &lt;td&gt;&lt;input type = &quot;Text&quot; name = &quot;MyTimeout&quot; value = &quot;30&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;&lt;input type = &quot;Submit&quot; name = &quot;Submit&quot; value = &quot;Submit&quot;&gt;&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="INIPATH">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">INIPATH</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Absolute path of initialization file</p>

  </td>
  </tr>
  </table>
</div>
<div id="SECTION">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">SECTION</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Section of the initialization file in which the entry is to be set</p>

  </td>
  </tr>
  </table>
</div>
<div id="ENTRY">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ENTRY</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Name of the entry to set</p>

  </td>
  </tr>
  </table>
</div>
<div id="VALUE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VALUE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Value to which to set the entry</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
