Re: Redundency of IsNull(Trim(myvar)) ?
From: songie D (songie_at_d.com)
Date: 05/20/04
- Next message: Bob Butler: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Previous message: Andy: "Re: Redundency of IsNull(Trim(myvar)) ?"
- In reply to: Andy: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Next in thread: J French: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Reply: J French: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 May 2004 21:09:32 +0100
If myvar is a string, then it won't ever be null.
As far as I know the only things that can be 'null'
in VB6 are possibly objects and variants.
"Andy" <Andrzej7@hotmail.com> wrote in message
news:fd7401c43ea5$6d80f3b0$a101280a@phx.gbl...
>
> I think
>
> Trim(myVariable) where myVariable is NULL
> will give you an error - Invalid use of Null or something
> because you can not Trim NULL.
>
> You can do:
> Trim(myVariable & "") where myVariable is NULL
>
> --- Andy
>
> >-----Original Message-----
> >Hi,
> >
> >I am wondering if the following two statements always
> yield the same
> >results:
> >
> >1) If IsNull(Trim(myVariable)) Then [...]
> >
> >2) If IsNull(myVariable) Then [...]
> >
> >Basically, if myVariable is Null, then won't Trim
> (myVariable) also be Null?
> >Are there any instances when I would want to leave the
> Trim() function in
> >the above statement?
> >
> >Also, are the answers to these questions dependent on
> which VBA platform is
> >used (i.e. VB6 vs. VBScript)?
> >
> >Thanks in advance!
> >
> >JC
> >
> >
> >.
> >
- Next message: Bob Butler: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Previous message: Andy: "Re: Redundency of IsNull(Trim(myvar)) ?"
- In reply to: Andy: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Next in thread: J French: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Reply: J French: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|