Re: CORRECTED TEST AND ANSWERS.
- From: "Rick Rothstein [MVP - Visual Basic]" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx>
- Date: Tue, 6 Dec 2005 23:58:40 -0500
> Create a different one-liner equivalent to this statement
>
> Value = IIf(Len(TextString) > 0, "'" & TextString & "'", "NULL")
>
> ---ANSWER
> Value = Format$(Len(TextString), Trim$(Left$(Join(Split(StrConv( _
> " " & TextString, vbUnicode), Chr$(0)), "\"), _
> 2 * Len(TextString) + 1)) & ";;\N\U\L\L")
I thought we decided (or at least I think I said) that it would be
unfair to ask this question. Also, this is not the only possible
one-liner solution. When I originally posted this, it was meant as a
joke (I'm pretty sure I included a <g> symbol in the posting). Later,
I suggested showing the If-Then-Else version of the IIF function you
posted, then showing that mess of a one-liner I posted and asking that
the person explain how and why they are equivalent (although Bob has
pointed out that I left out the single quotes). And I suggested that
it be either an extra-credit question OR a question to throw at a
know-it-all type applicant. But, to repeat, I don't think the question
is a fair one to ask straight-away.
Rick
.
- Follow-Ups:
- Re: CORRECTED TEST AND ANSWERS.
- From: Richard Jalbert
- Re: CORRECTED TEST AND ANSWERS.
- From: Bob Butler
- Re: CORRECTED TEST AND ANSWERS.
- References:
- Re: CORRECTED TEST AND ANSWERS.
- From: Richard Jalbert
- Re: CORRECTED TEST AND ANSWERS.
- Prev by Date: Re: CORRECTED TEST AND ANSWERS.
- Next by Date: Re: Problem with adding new text to TEXTBOX: it saturates after 65535 characters!!!!
- Previous by thread: Re: CORRECTED TEST AND ANSWERS.
- Next by thread: Re: CORRECTED TEST AND ANSWERS.
- Index(es):
Relevant Pages
|