Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-08-2012, 07:26 PM   PM User | #16
hughesmi
Regular Coder

 
Join Date: Jul 2002
Location: UK
Posts: 301
Thanks: 16
Thanked 0 Times in 0 Posts
hughesmi is an unknown quantity at this point
Thanks. I got it working by doing the following

Code:
    If IsNull(NumberProvider) OR IsEmpty(NumberProvider) OR Len(NumberProvider)=0  Then Exit For
__________________
Kind regards,
Mike Hughes
hughesmi is offline   Reply With Quote
Old 08-08-2012, 08:25 PM   PM User | #17
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
If that's all your problem was, a better fix is just
Code:
     NumberProvider = Trim( Request.Form("NumberProvider" & row) )
     If Len(NumberProvider) = 0 Then
TRIM() guarantees that you will get a NON-empty, NON-null value. If the form value really was empty or null, it converts it to a "" string. So now you can just ignore the empty and null test and check for the empty (length zero) string.

In general, it's a good idea to use TRIM() on all human input. Humans do often put a space before or after their values, often by accident. So TRIM() tends to fix many problems easily.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Users who have thanked Old Pedant for this post:
hughesmi (08-12-2012)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:57 AM.


Advertisement
Log in to turn off these ads.