Hi eSp,<br><br>Since Cold-Fusion is tag based ..so u get differrent tags ..i.e cfout..cfin..cfif..etc..etc..coz..i havent worked more in cfm..but in asp..everything is written in <br><% ur code here %><br>..or <br><script lang="javascript or vbscript" runat=server..etc..> code..<br></script><br>so if u explain what actually u want ,then it would have been a lot simpler.<br>Regards<br>Vinod
Hullo,<br>CFParam is ( Alaires description not mine....)<br><br><br><br><i>CFPARAM is used to test for a parameter's existence, and optionally test its data type, and provide a default value if one is not assigned. <br><br>Syntax<br><CFPARAM NAME="param_name"<br> TYPE="data_type"><br> DEFAULT="value"><br><br>NAME<br>The name of the parameter you are testing (such as "Client.Email" or "Cookie.BackgroundColor". If you omit the DEFAULT attribute, an error occurs if the specified parameter does not exist. <br><br>TYPE<br>Optional. The type of parameter that is required. The default value is "any."<br><br><br> Type Values <br>Type Value Description <br>any any value. <br>array any array value. <br>boolean a Boolean value. <br>date a date-time value. <br>numeric a numeric value. <br>query a query object. <br>string a string value or a single character. <br>struct a structure. <br>UUID a Universally Unique Identifier (UUID) formatted as `XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXX' where `X' stands for a hexadecimal digit (0-9 or A-F). See CreateUUID. <br>variableName a valid variable name. <br><br><br>DEFAULT<br>Optional. Default value to set the parameter to if it does not exist. <br><br>Usage<br>There are three ways to use CFPARAM: <br><br>Test for a required variable -- Use CFPARAM with only the NAME attribute to test that a required variable exists. If the variable does not exist, ColdFusion server stops processing the page and returns an error. <br>Test for a required variable and for the type of variable -- Use CFPARAM with the NAME attribute and the TYPE attribute to test that a required variable exists, and that it is of the specified type. <br>Test for an optional variable -- Use CFPARAM with both the NAME and DEFAULT attributes to test for the existence of an optional variable. If the variable exists, processing continues and the value is not changed. If the variable does not exist, it is created and set to the value of the DEFAULT attribute. </i><br><br>I presume therefore that param is a variable?<br>Wouldn't have this problem in a strongly typed language i.e. Pascal, Fortran, Bulls**t, Boll**ks..<br>New to ASP but old to VB....<br><br>I trust this may help a bit....<br><br>Gram Nez<br><A HREF="
I've been searching the web like crazy and have found no real equivalent.
I suspect one has to look separately at the main uses of CFPARAM and find a functional equivalent (if any) for each. I think the 2 main uses of CFPARAM are:
* making sure you get all the Form / URL values needed to start processing a request.
* allowing you to use optional arguments for CF custom tags (or templates called by CFMODULE).
Form / URL values
-----------------
Form values in ASP are almost as easy as CFPARAM, because Request.Form returns a zero-length string ("" if there is no such form variable. So for example:
Response.Write("Dummy: |" & Request.Form("myVal" & "|"
displays:
Dummy: ||
URL parameters are harder work in ASP because you have to parse Response.QueryString yourself and there's no built-in functionality which returns a zero-length string if the URL parameter was not supplied. But it's not hard to write a package of general-purpose functions which returns the actual value or a null string if none found. I'm working on one which uses a Scripting Dictionary object - created by
set myDict = New Server.CreateObject("Scripting.Dictionary"
The Scripting Dictionary object provides an associative array, which is how CF stores all variables any way.
Optional arguments for "sub-routines"
-------------------------------------
Depends whether you script in VBSCript or Javascript, but either way you can't treat all arguments as optional the way you can in CF.
VBScript does not allow optional arguments at all.
Javascript does in part, but with the restriction that, if any argument is present, all arguments to the left of it must be present. In Javascript you can code
if (typeof optional_arg == "undefined" var optional_arg = "";
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.