Brian Dunning's FileMaker Custom Functions

WrapupLine ( test ; lineheader, linedata )

If data exists for a field, give it a bold label and show it.

  Average rating: 4.5 (22 votes) Log in to vote

Dwayne Wright   Dwayne Wright
dwaynewright.com
http://www.dwaynewright.com

Share on Facebook Share on Twitter

  Sample input:
= field name<br> <br> Record 1<br> <Name> Dwayne<br> <Title> Dev<br> <br> Record 2<br> <Name> Jane Doe<br> <Title> (null) </div> </div> <div class="codewrapper">  Sample output:<br> <div class="code"> Record 1<br> Name: Dwayne<br> Title: Dev<br> <br> Record 2<br> Name: Jane Doe </div> </div> </div> <div style="clear:both;"></div> <p>  Function definition:<span class="grayital"> (Copy & paste into FileMaker's Edit Custom Function window)</span> </p> <textarea name="textarea" class="codearea" readonly id="textarea" style="height: 250px;">If ( IsEmpty(test) ; "" ; "ΒΆ" & TextStyleAdd ( lineheader & ": " ; Bold ) & linedata ) // Brought to you by Dwayne Wright - dwaynewright.com</textarea> <button id="copyBlock" class="cool_button">Click to copy</button> <span id="copyAnswer" class="redital"></span> <script type="text/javascript"> var textarea = document.getElementById( "textarea" ); var answer = document.getElementById( "copyAnswer" ); var copy = document.getElementById( "copyBlock" ); copy.addEventListener( 'click', function ( e ) { textarea.select(); try { var ok = document.execCommand( 'copy' ); if ( ok ) answer.innerHTML = 'Copied'; else answer.innerHTML = 'Unable to copy'; } catch ( err ) { answer.innerHTML = 'Unsupported Browser'; } } ); </script> <p> You may want to concantenate multiple fields into a single text string with a boldly formated label in between. You don't want to show the label if the field is empty. </p> <p> </p> <h2>Comments</h2> <p><a href="/filemaker-custom-functions/account.php">Log in to post comments.</a> </p> <p> </p> <blockquote> <p class="redital">Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.</p> </blockquote> </div> </div> <div style="text-align: center;"> <footer>Other resources: <a href="/sample-data">Sample data</a> <a href="mailto:brian@briandunning.com">Contact</a> </footer> <p>Under construction. <a href="mailto:brian@briandunning.com">Email me your wish list</a> for improvements.</p> </div></body> </html>