Conclusion


It pays to know the different functions supported by OOo Basic. Before I was aware of the Split function, I spent a lot of time writing a macro that parsed a string into pieces. I rewrote my code using the Split function and the macro was significantly faster. It's also important to know the limitations of strings. Some string functions accept integer arguments, which have difficulty with values larger than 32,767. I saw a macro that counted words in a document by first converting the entire document into a single string. This technique worked well, and it was very fast, but it failed when the number of characters in the document exceeded 65,535.

There are a lot of very powerful capabilities for formatting text in OOo Basic. Among other things, the use of the Unicode character set allows processing of nearly any language in the world. There are also a number of good functions for joining, splitting, and formatting text strings. However, some of the functions that are advertised don't behave quite correctly; empirical testing is required to confirm that your code works as intended.

start sidebar

Updates and corrections to this chapter can be found on Hentzenwerke's Web site, www.hentzenwerke.com . Click "Catalog" and navigate to the page for this book.

end sidebar
 



OpenOffice.org Macros Explained
OpenOffice.org Macros Explained
ISBN: 1930919514
EAN: 2147483647
Year: 2004
Pages: 203

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net