

Some of these functions (see Table 2) have in-depth coverage in other chapters, because they are directly related to the content in those chapters. The subroutines and functions related to string handling in OOo Basic are listed in Table 1. Split a string into an array based on an optional delimiter. This is the inverse of the Join function. Table 2: These string-related functions are covered in other chapters. This is very tolerant to non-numeric text. Return a copy of the string with all leading and trailing spaces removed.Ĭonvert a string to a double. The first argument is the number of times to repeat the second argument is the character or ASCII value. Return a string with a single character repeated multiple times. The default is 1 for a case-sensitive comparison. Set the optional third argument to zero for a case-insensitive comparison. Inverse of the Join function.Ĭonvert a number to a string with no localization.Ĭompare two strings returning -1, 0, or 1 if the first string is less than, equal to, or greater than the second in alphabetical order. Return a string with the number of specified spaces. Return a copy of the string with all trailing spaces removed. Right-justify a string into the space taken by another string. and downloadable excel templates i need to create a macro which will take. Return the octal representation of a number as a string. OpenOffice Calc, or Google Sheets Stability More Calculated columns in.


If the final string argument is included, this replaces the specified portion of the first string with the last string. If the length is omitted, the entire end of the string is returned.

Return a copy of the string with all leading spaces removed. Left-justify a string into the space taken by another string. Return the leftmost n characters from the string. Setting mode to 0 performs a case-sensitive comparison.Ĭoncatenate the array elements, separated by the optional string delimiter, and return the value as a string. The default value for mode is 1 (case-insensitive comparison). The optional start argument indicates where to start looking. Returns 0 if not found and starting location if it is found. Return the hexadecimal representation of a number as a string.Īttempt to find string 2 in string 1. This supports 16-bit Unicode values as well.įancy formatting works only for strings. Return the integer ASCII value of the first character in the string. Table 1: These string-related functions are covered in this section. The functions listed in Table 2 are related to strings as well as either numerical or array manipulations these are covered in other chapters. The functions listed in Table 1 are the string functions covered in this chapter. These string-manipulation operations range from converting uppercase to lowercase (or vice versa) to selecting substrings out of a longer string. has a large number of functions that allow you to manipulate strings. The remaining 65,280 values-of which only about 34,000 are currently used-are used for a wide variety of worldwide text characters, mathematical symbols, accent marks (diacritics), and technical symbols. The next 128 characters (numbered 128 through 255) consist of special characters such as accent marks, Latin-based characters, and a few symbols. The first 128 characters (numbered 0 through 127) correspond to the letters and symbols on a standard U.S. The Unicode Worldwide Character Standard is a set of binary codes representing textual or script characters designed because ASCII, the original standard, can handle only 256 distinct characters. Text data is stored in strings as a sequence of 16-bit unsigned integer Unicode version 2.0 values. This includes functions to manipulate strings, convert other data types to strings, and to perform special formatting. OpenOffice.This chapter introduces the subroutines and functions supported by Basic that are related to strings.CreateSpace Independent Publishing Platform. Whether and how python would be a better option, you should ask the people which comment this would be so much better -).
Openoffice basic macros code#
See screenshot: I have called the function as MYFUNC (23) in a Calc cell, then I have fetched the IDE window to front and have run the code step by step. SupportsService ( ".Paragraph" ) Then Count = Count + 1 End If Wend 'Display result MsgBox Count, 0, "Paragraph Count" End Sub See also For using the observer of course the IDE has to remain open. NextElement ' Is the component a paragraph? If TextEl. SupportsService ( ".TextDocument" ) Then MsgBox "This macro must be run from a text document", 64, "Error" Exit Sub End If Count = 0 ' Examine each component - paragraph or table? Enum = Doc. Sub ParaCount ' ' Count number of paragraphs in a text document ' Dim Doc As Object, Enum As Object, TextEl As Object, Count As Long Doc = ThisComponent ' Is this a text document? If Not Doc.
