Making Text Bold when you only know part of the text

General support questions.
Posts: 68
Joined: Tue Jan 25, 2005 1:45 pm
PostPosted: Tue Apr 29, 2008 6:58 am
If I will not know a complete phrase ahead of time only part of the wording, how can I make the complete phrase bold.

Example of text:

"Amount Received Via" Visa endinging in XXXX dated 4/08/2008.

The portion in quotes and the year is the only known segment.

Text in this field that does not start with Amount Received, will remain plain.

Is there a way to define text like : "Amount Received Via ..... 2008" so that anything beginning and ending would be caught.

thanks,

Jim
JIMBO
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Apr 30, 2008 6:04 am
How about the following, just change "n" to be the field containing your block of text, and change "start" and "end" to be the pieces of the text you know and want to contain the bold section:

Code: Select all
Let ( [
n = "Here is some text. Amount Received Via Visa endinging in XXXX dated 4/08/2008. And here is some more text" ;
start = "Amount Received Via" ;
end = "2008." ;
string = Middle ( n ; Position ( n ; start ; 1 ; 1 ) ; Position ( n ; end ; 1 ; 1 ) + Length ( end )- 1 - Position ( n ; start ; 1 ; 1 ) )
] ;

Replace ( n ; Position ( n ; start ; 1 ; 1 ) ; Length ( string )  ; TextStyleAdd ( string ; Bold ) )

)


Returns: Here is some text. Amount Received Via Visa endinging in XXXX dated 4/08/2008. And here is some more text
John Sindelar
SeedCode

Return to General Support

Who is online

Users browsing this forum: No registered users and 2 guests

(855) SEEDCODE
[email protected]
Follow us: