|
|
 |
RE: FN-FORUM ASP code help
date posted 12th September 2002 17:12
> By the way, the Response.Writes and the RecordSet stuff is
> not the issue here. As far as I can see, the two response
> writes at the top show nothing surrounded by asterisks.
> Surely showing the len() of something should show a number
> even if it is zero? Equally, as you go further down, the If
> statement is checking the len() of the variable and finding
> it to be not zero therefore outputting "hello" instead of
> "none" if it was zero. What I don't understand is how when
> writing a variable to the screen and showing that it is
> nothing, why doesn't the len function return 0?
Have you got any error checking anywhere? Try putting On Error Goto 0
before this snippet of code to see if it shows up any errors. Use the
IsNull function to check the value returned from the DB is not null.
As a quick fix, you could try
Dim theLength
theLength = len( trim( strAffiliateID))
If IsNumber(theLength) Then
If = 0 Then
Response.Write( "None")
Else
Response.Write( strAffiliateID & "hello")
End If
Else
Response.Write( "NaN" )
End If
Out of interest, have you done a view source in your browser to see if
there are any extraneous characters being output when you
Response.Write(strAffiliateID")?
Darran.
|
 |
|