Re: Redundency of IsNull(Trim(myvar)) ?
From: Bob Butler (tiredofit_at_nospam.com)
Date: 05/20/04
- Next message: songie D: "Re: DLLs - Which To Distribute?"
- Previous message: songie D: "Re: Redundency of IsNull(Trim(myvar)) ?"
- In reply to: Andy: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Next in thread: MikeD: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 May 2004 13:11:34 -0700
"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.
Trim(Null) is fine and will return Null; the function takes a variant
argument and handles null values
Trim$(Null) is an error; the function takes a string argument and does not
accept null values
>> I am wondering if the following two statements always yield the same
>> results:
>>
>> 1) If IsNull(Trim(myVariable)) Then [...]
>>
>> 2) If IsNull(myVariable) Then [...]
My guess is that the original code should have been
If Len(Trim(myvariable))=0 Then
in which case the Trim would be important to have
-- Reply to the group so all can participate VB.Net... just say "No"
- Next message: songie D: "Re: DLLs - Which To Distribute?"
- Previous message: songie D: "Re: Redundency of IsNull(Trim(myvar)) ?"
- In reply to: Andy: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Next in thread: MikeD: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|