dcsimg
Linux Today: Linux News On Internet Time.





Linux.com: OOoBasic Crash Course: Replacement Therapy

Sep 15, 2006, 06:00 (0 Talkback[s])
(Other stories by Dmitri Popov)

"In a perfect world everyone would write in standard English and all publications would use a universal style guide. In the real world, however, you have to deal with different versions of English (British, American, Australian, etc.), and every publication has its own set of writing guidelines. If you write for several markets, things can get pretty complicated. But instead of wasting time on language idiosyncrasies, you can let an OOoBasic macro do the donkey work. Let's create a macro that converts from British English to US English. You can easily modify it later for other text conversion purposes.

"The building block of this macro is a 'replacement' object, which has the properties necessary to perform the replacement operation. If you define the oSearch variable as such an object, its 'replacement' properties will be oSearch.SearchString, oSearch.ReplaceString, and oSearch.SearchWords..."

Complete Story

Related Stories: