jhp
|
Posted: 02/05/2004, 12:31 AM |
|
Perhaps its just me, but I have been using ccs for awhile not and I also find the documentation poor. A good example follows.
I have never been able to get the CCGetParam function to work, I always get errors the page won't display. I discovered tonight that the 2nd parameter is required! ("Empty" or other) you must put in ,Empty etc... CCGetParam("Logout,,Empty ).
Here is the help file explanition. Are my eyes bad or does it say optional for to the 2nd parameter?
I find this true for most of the documentation.
CCGetParam Function
Description
Retrieves a GET or POST input parameter value. The function first attempts to retrieve the parameter from the GET query string and if no value is returned, then the function checks for a POST input parameter with the same name. If no value is returned by a GET or POST input parameter, the function returns the default value specified in the function call.
Syntax
CCGetParam(ParameterName, DefaultValue)
Specification
ParameterName
Required.
Name of the parameter to retrieve.
Type: string
DefaultValue
Optional.
Value to return if parameter is not set.
Type: variant
Return Value
Type: variant
Example 1
This code would usually be placed in the After Initialize event of a Page.
If NOT IsEmpty(CCGetParam("Logout", Empty)) Then
CCLogoutUser
Redirect = "Login.asp"
End If
Example 2
The following code disables record updates if a task is not assigned to the current user. CCGetParam function is used to retrieve the current task id from the GET or POST data being submitted. This code would usually be placed in the Before Update event of a Record form.
Dim current_task
current_task = CCGetParam("task_id", Empty)
if current_task <> 0 and CCGetUserID <> CCDLookUp("user_id_assign_to", "tasks", "task_id=" & CCToSQL(current_task, "Integer"), DBIntranetDB) Then
tasks.UpdateAllowed = False
end if
Comments anyone?
|
|
|
peterr
Posts: 5971
|
Posted: 02/05/2004, 4:23 AM |
|
Since you are seeking comments, I can confirm that yes, you are right that the documentation is incorrect here.
Possibly I should also clarify that VBScript does not support optional parameters for user defined functions, therefore the documentation should explain that "optional" here means that the parameter can be Empty. The standard nomenclature for optional parameters is to document them in brackets [ ], like: CCGetParam(ParameterName[,DefaultValue])
This may also clarify the other areas of the documentation where you see "optional" parameters, as well as explains why you see Empty in Examples.
If you find other missing or incorrect information please let us know.
Of course the documentation needs more work (always) and we plan to improve it continually.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
jhp
|
Posted: 02/05/2004, 11:55 AM |
|
peterr,
Thanks for your comment, I guess what I mean is that the word Empty in this case is also misleading as well. It could mean blank or not required. I now know in the future when I see Empty I need to put it in or my value.
In the past to get around this problem I used session varables to pass parameters.
In ways I feel dumb since I've been a registered user since April 2003.
I didn't see this as a big enough problem to contact ccs support.
CCS is a great product. The new forum is great since a Yes support person is active on it,
Thanks,
Joe
|
|
|
|