~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Ricki Williams" <[EMAIL PROTECTED]>
Subject: RE: convert string to array
: As long as I'm at it...Here's another quick and easy one for you. I have
: some arrays that are not dynamic (I create them like this: Dim myArray(5))
: and then populate them based on form results.
:
: Question: Is there a way to tell how many of the indexes in myArray have
a
: value? such as myArray.count? right now I'm looping through and checking
: to see if the value is null, but I have a feeling there is a better way.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the array's elements are populated from the Request.Form() collection,
then none of the elements will be NULL. Some might be strings with zero
length (i.e. ""), but none will be NULLs.
Try it:
<%
If LCase(Request.ServerVariables("Request_Method")) = "post" then
strVar = Request.Form("txtTest")
If isNull(strVar) then
strOutput = "It is NULL!"
Else
strOutput = "It is not NULL"
End If
End If
%>
<html>
<head></head>
<body>
<form method="post">
<input type="text" name="txtTest">
<input type="submit">
</form>
<p><% =strOutput%></p>
</body>
</html>
Cheers
Ken
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]