Checking for Nulls in Custom Functions

I am attempting to write a custom function in Crystal that checks to see if a string is null.  If it is null, it returns "" (empty string).  If it is not null, it returns the original string.  Unfortunately,  using IsNull results in "This function cannot be used within a custom function."  How can I check for Null in a Custom Function?

My current code is

Function (stringVar strCurrent)
If isnull(strCurrent) then "" else strCurrent

Thanks!
pmetechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
You may not be able to.

Try this.

If (StrCurrent = '') then
    ''
else
    StrCurrent

If that doesn't work try
If Length(StrCurrent) = 0 then
    ''
else
    StrCurrnet

mlmcc
0
pmetechAuthor Commented:
Sorry, neither one worked.
0
mlmccCommented:
I just tried to create one and couldn't figure out how to test for NULL.

How are you planning to use this?

Can you write a Crystal formula to do it?

mlmcc
0
pmetechAuthor Commented:
I have a number of strings that I'm concatenating into one long string.  Currently, I'm using "List of Values: " & (If isnull(Value1) then "" else Value1) & ", " (If isnull(Value2) then "" else Value2) & ", " (If isnull(Value3) then "" else Value3) & ", " (If isnull(Value4) then "" else Value4).  I would like to replace each if statement with a custom formula.
0
mlmccCommented:
It would be nice, but it appears that isn't a test you can do in a custom formula.

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.