[thelist] okay, this one's real (and free code!!!)

Matt Warden errorwun at fuse.net
Sat, 14 Aug 1999 00:07:04 -0400


Kinda on the same wavelength... maybe it can eliminate some different
headaches...

FUNCTION TrimNull(strString)
    IF Trim(strSting) = "" OR IsNull(strString) TrimNull = NULL ELSE
TrimNull = Trim(strString)
FUNCTION

FUNCTION TrimZero(intInt)
' for integers..
    IF intInt = 0 OR IsNull(intInt) OR NOT (isNumeric(intInt)) THEN TrimZero
= 0 ELSE TrimZero = intInt
END FUNCTION


You wouldn't believe how often I use these functions... especially
TrimNull()

Matt Warden

> <tip type="ASP,VBScript" Title="Empty, Nothing, and Null. How do you feel
> today?">
> Okay, lemme 'splain... no time, lemme sum up:
>
> in VBScript there are three (yup, three) states of a variable not having a
> value (well, a usable one anyway).
>
> Empty == Uninitialized
> Null == actually, well, Null. Okay, so technically this is a value. More
in
> a sec.
> Nothing == for objects only, basically the same as Empty