A More Convenient cInt
page 1 of 2
Published: 07 Oct 2003
Abstract
The cInt function raises an exception when passed a null value, blank string, or non-numerical string. You can adapt the function to cInt2 to handle these values and use it in the same manner.
by Dan Powderhill
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 11356/ 98
Article Contents:

Introduction
When you work with forms and databases a lot you will often want to save the numerical value of a form element, in particular a group of radio buttons, to a database. In general this is easy, however if the field is not mandatory and the user chooses not to answer then the value which gets passed is null, or a blank string. If you pass the cInt function a null value, blank string, or non-numerical string it raises an exception.

Whilst that in itself isn’t a problem as you can write a routine to check the value before using cInt and make sure it is a valid number, it is easier simply to adapt the cInt function to handle them.

View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 6 and 8 and type the answer here:

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 






Ads Powered by Lake Quincy Media
Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 5/12/2008 1:12:40 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search