Long text formatting question? (ie: \n\n\)

Hi guys,
I have a quick question. I am using scrollview to display my “help” page. In that effect I have help text like:

local helpText = " blah1\n\n… blah2"

As you can see I am using \n\ to put same blah1 and blah2 text. My question is there an text editor I can use (PC or Mac) that could make writing a long help text easier. Ie: automatically adding those \n\ by me simply typing the text with line jumps?

Thank you for any pointers. It will be very helpful to be able to type a long help text without having to manually insert those symbols (\n)

Mo

[import]uid: 100814 topic_id: 25436 reply_id: 325436[/import]

Hi Mo,
I suggest TextWrangler. It’s free and very powerful. In fact, after the Lua “code color” plug-in that I used in the XCode3 Editor stopped working in XCode4.x, I needed a new text editor for ALL of my Lua/Corona coding. I tried several and I liked TextWrangler the best of all.

Regarding your need to search/replace line breaks, this might help:
http://forums.macrumors.com/showthread.php?t=859410

On a side note, you state that the “special character” for a Lua “new line” is “\n”, but I believe it should be just “\n” (no ending backslash). Perhaps both versions work? I use the latter example in all of my string-matching code, but perhaps Lua isnt too picky on that one.

Brent Sorrentino
[import]uid: 9747 topic_id: 25436 reply_id: 102844[/import]

I would highly recommend using Sublime Text. It is the BEST text editor for most languages, and has a minimap for your code! There is also a Corona SDK plugin for it that includes all of the API’s on the forums. For doing to long text, why don’t you just write some sort of text wrapper etc:

[lua]–this is an example, it’s not perfect
local function wrapText()
text.length = text.length + 1
if text.length > 100 then
text.position = 0
text.length = 0
end[/lua]

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 25436 reply_id: 102947[/import]

Thanks guys! I may not have been clear in my question. Here an example:

[lua]local helpText = “njnnnvmveompvomdepeprvpeovmeporvmpeomvperomvepmvepoveprmpevm \n\nThe jeoiemveivmvepomvpemvpoemrpoemvepormvpeomvpeomveomvpeomrv. \n\n. eieivmeoirmvoemrvoeimvemvoerivmoeimveoivmeomvevoemrvoe.\n\n cnenmo moee ieoirmvoeim oem m rmomo momoim roemo meom ovm”[/lua]

Please note the use of “\n\n” to jump a line. The problem is that i had to add manually those symbols (\n) and I am trying to avoid doing that since it is time consuming for a long string.

I am not really looking for a text editor per se but simply to do be able to type the different paragraphs I need (for the help text) as in regulator text editor but then be able to export the all text with the symbols already embedded and visible like in my example above (helpText)

Still I am not sure if I making any sense:)

THANKS.

Mo

[import]uid: 100814 topic_id: 25436 reply_id: 102972[/import]

A text editor should still work (either TextWrangler or Sublime). Just type your paragraphs in there (or copy them from another application), do a simple “search-and-replace” (Search > Find, in TextWrangler) to swap 2-line returns with “\n\n”, then copy that to your Lua code, database, or whatever.

Brent [import]uid: 9747 topic_id: 25436 reply_id: 103002[/import]

Thanks Brent! I will try that. Easy enough.

Mo
(LairdGames) [import]uid: 100814 topic_id: 25436 reply_id: 103017[/import]