Beste Weg, um zu definieren, eine große vba-string - d.h. der heredoc-äquivalent?

Wie soll ich definieren, die großen strings in VBA? Gibt es einen besseren Weg, als mit der Programmierung etwas wie die unten?

Dim largeString as String
largeString = "This is a long block of text that I want to fill " & _
              "into a form field. I need to make sure I pay attention " & _
              "to spacing and carriage return issues while doing so. " & _
              "I also have to use quotes liberally, the concatenation " & _
              "operator, and the continuance underscore to make sure " & _
              "VBA can parse my code." & vbCr & vbCr & _
              "It's kind of a pain in the ass and I wish I could use " & _
              "a heredoc instead, letting me copy and paste the block" & _
              "of text I need from another source and shove it into " & _
              "a string."

Edit: Ugh, und es ist ein 25-line-Fortsetzung-Grenze zu? So viel zum schönen Einrücken und 80 Zeichen Breite, nur gibt mir genug Platz für ein paar anständige Absätze.

oder erstellen Sie eine Zeichenfolge, die auf Fliegen Dim s as String und s = String(1337, "a")

InformationsquelleAutor Oesor | 2010-09-08

Schreibe einen Kommentar