Code - Custom Function

ShowValue ( text; altText )

BrianDunning.com, Brian Dunning http://www.briandunning.com/filemaker-custom-functions/list.php


ShowValue ( text; altText )
Rate this function: Average rating: 0.0 (0 votes) Discuss this Custom FunctionChad Sager, IT Solutions Consulting, Inc.
http://www.itsolutions-inc.com/Filemaker
Attempts to show a value, if it's empty, shows an alternate value
==================== SAMPLE INPUT AND OUTPUT ====================
INPUT
ShowValue ( Student::LastName ; "No Last Name" )
OUTPUT
No Last Name
==================== DESCRIPTION ====================
PURPOSE: to show a value if it exists and if not, use an alternate.
PARAMETERS:
text - the text you want to display
altText - an alternate text to show if the primary text is empty
IMPORTANT NOTES: remember if you want any or all the parameters to be empty, just use "" (double quotes)
EXAMPLES:
ShowValue ( Student::LastName ; "No Last Name" )
Will return an "No Last Name" When last name is Empty
ShowValue ( Student::LastName ; "No Last Name" )
Will return an "Smith" When last name is "Smith"
==================== CUSTOM FUNCTION ====================

/*



NAME: ShowValue ( text; altText )

CREATORNAME: Chad Sager, IT Solutions Consulting, Inc.

CREATOREMAIL: chad.sager@itsolutions-inc.com

DATE CREATED: 2010-02-18

DATE LASTMODIFIED: 2010-02-18



PURPOSE: to show a value if it exists and if not, use an alternate.



PARAMETERS:

text - the text you want to display

altText - an alternate text to show if the primary text is empty



IMPORTANT NOTES: remember if you want any or all the parameters to be empty, just use "" (double quotes)





EXAMPLES:



ShowValue ( Student::LastName ; "No Last Name" )



Will return an "No Last Name" When last name is Empty



ShowValue ( Student::LastName ; "No Last Name" )



Will return an "Smith" When last name is "Smith"





*/









Case (

not IsEmpty ( text ) ; text ;

altText

)


Referring URL: 'http://www.briandunning.com/cf/1125'

Attached File:    

Screenshot:    


Keywords: ''

ClipManager: