ParameterExists()
Determines if the parameter exists
ParameterExists( parameter=variableString );
Returns: Boolean
Argument | Description |
---|---|
parameter
variableString,
required
|
Name of the string variable to test for. Alias: param |
Examples
bool = true;
string = "I'm a string";
numeric = 100;
<span class="nv">boolean_exists</span> <span class="o">=</span> <span class="nf">ParameterExists</span><span class="p">(</span><span class="s2">"bool"</span><span class="p">);</span>
<span class="nv">string_exists</span> <span class="o">=</span> <span class="nf">ParameterExists</span><span class="p">(</span><span class="s2">"string"</span><span class="p">);</span>
<span class="nv">number_exists</span> <span class="o">=</span> <span class="nf">ParameterExists</span><span class="p">(</span><span class="s2">"number"</span><span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span><span class="nv">boolean_exists</span><span class="p">);</span> <span class="c">//true</span>
<span class="nf">dump</span><span class="p">(</span><span class="nv">string_exists</span><span class="p">);</span> <span class="c">//true</span>
<span class="nf">dump</span><span class="p">(</span><span class="nv">number_exists</span><span class="p">);</span> <span class="c">//false</span>
See also
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)