Click to See Complete Forum and Search --> : Conversion Functions


ldoodle
04-30-2009, 03:12 AM
Hiya,

I've just had to use CInt to convert a QueryString value, and it got me thinking:

When should the other conversions (CStr, CBool etc) be used?

Is there a definitive answer, other than "when you need to"?

Cheers

Kuriyama
04-30-2009, 02:59 PM
CStr is pretty useless in most cases. I assume that everything is a string unless specified otherwise.

This is a case by case thing. One thing that you will want to keep in mind is that you can just use CInt or CBool. CInt will crash if you pass it anything other than a number. There is also a size limit for Cint. You are better off using isNumeric