March 8, 200718 yr Name & Parameters: [color:red][big] GetStyledWords ( text ; style ) [/big] Description: GetStyledWords custom function revision 1: now finds plain text, too. Author: Daniele Raybaudi Format: GetStyledWords ( text ; style ) Parameters: text - the given text where there are some styled words style - the style to search for ; if it is empty the function will search for "plain" Returns all the styled words ( in list view ) within the given text Sample Input: I'm going to learn English GetStyledWords ( text ; "" ) Results: I'm to learn Sample Input: I'm going to learn English GetStyledWords ( text ; "bold" ) Results: going English Recursive: yes Formula: /* GetStyledWords custom function revision 1: now finds plain text, too. Author: Daniele Raybaudi Format: GetStyledWords ( text ; style ) Parameters: text - the given text where there are some styled words style - the style to search for ; if it is empty the function will search for "plain" Returns all the styled words ( in list view ) within the given text Example 1) text = I'm going ( bold ) to learn English ( bold ) GetStyledWords ( text ; "bold" ) returns: going English Example 2) text = I'm going ( bold ) to learn English ( bold ) GetStyledWords ( text ; "" ) or GetStyledWords ( text ; "plain" ) returns: I'm to learn */ Let ( [ style = If ( IsEmpty ( style ) or style = "plain" ; """" ; style ) ; svg = GetAsSVG ( text ) ; parseSVG = MiddleValues ( svg ; 2 ; PatternCount ( svg ; "Style#" ) ) ; nextSVG = RightValues ( svg ; ValueCount ( svg ) - 2 ) ; line = GetValue ( parseSVG ; 1 ); pos1 = GetAsNumber ( Middle ( line ; Position ( line ; "," ; 1 ; 1 ) + 1 ; Position ( line ; "," ; 1 ; 2 ) - Position ( line ; "," ; 1 ; 1 ) - 1 ) ) ; pos2 = GetAsNumber ( Middle ( line ; Position ( line ; "," ; 1 ; 2 ) + 1 ; Position ( line ; "<" ; 1 ; 2 ) - Position ( line ; "," ; 1 ; 2 ) - 1 ) ) ; string = Middle ( text ; pos1 ; pos2 - pos1 + 1 ); adjString = Substitute ( TrimAll ( Substitute ( Middle ( text ; pos1 ; pos2 - pos1 + 1 ) ; ¶ ; " " ) ; 1; 1 ) ; " " ; ¶ ) ; next = Trim ( Middle ( text ; Length ( string ) + 1 ; Length ( text ) ) ) ] ; Case ( PatternCount ( nextSVG ; style ); Case( PatternCount ( line ; style ) ; adjString & ¶ & GetStyledWords ( next ; style ); GetStyledWords ( next ; style ) ); Case( PatternCount ( line ; style ); adjString ; "" ) ) ) Required Functions: None Author(s): raybaudi Date: 03/08/07 Credits: Disclaimer: FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.
March 8, 200718 yr Author Hi all friends this is an example of use that custom: custom value lists from an unique field GetStyledWords.zip
Create an account or sign in to comment