21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Strings 11<br />

Dim Variable As String<br />

You can also write this declaration as:<br />

Dim Variable$<br />

When porting VBA applications, ensure that the maximum allowed string length in <strong>OpenOffice</strong>.<strong>org</strong><br />

Basic is observed (65535 characters).<br />

Specification of Explicit Strings<br />

To assign an explicit string to a string variable, enclose the string in quotation marks (").<br />

Dim MyString As String<br />

MyString = " This is a test"<br />

To split a string across two lines, add an ampersand sign at the end of the first line:<br />

Dim MyString As String<br />

MyString = "This string is so long that it " & _<br />

"has been split over two lines."<br />

To include a quotation mark (") in a string, enter it twice at the relevant point:<br />

Dim MyString As String<br />

MyString = "a ""-quotation mark." ' produces a "-quotation mark<br />

Source: http:/ / <strong>wiki</strong>. services. openoffice. <strong>org</strong>/ w/ index. php? title=Documentation/ <strong>BASIC</strong>_<br />

<strong>Guide</strong>/ Strings&oldid=108417<br />

Principal Authors: Fpe, Strompf, Ccornell, TJFrazier, Pitonyak

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!