★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum1/HTML/000197.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  HTML / DHTML
  VBScript Functions optional parameters

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   VBScript Functions optional parameters
Kerschi
Junior Member
posted March 14, 2000 07:46 AM     Click Here to See the Profile for Kerschi     Edit/Delete Message Reply w/Quote
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
%>

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.