posted March 14, 2000 07:46 AM
Can anyone help me how to write a function which have a argument which can be optional, that meens there should be a default value when not given.
But this does not work. I always get a errormessage from the .ASP page.Foolowing Source:
<%
FUNCTION GetUserID(cOrgUserID)
GetUserID = ""
' Here i check for existance of the parameter
' But without success!!
IF cOrgUserID = NULL THEN
cOrgUserID = Request.ServerVariables("AUTH_USER")
cOrgUserID = "\MEGA"
END IF
pos = INSTR(cOrgUserID,"\")
IF pos > 0 THEN
USERID = UCASE(MID(cOrgUserID, pos+1))
ELSE
USERID = UCASE(cOrgUserID)
END IF
GetUserId = USERID
END FUNCTION
%>