create outline numbering for paragraphs

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
netgeorger
Posts: 4
Joined: Sun May 10, 2009 7:18 pm

create outline numbering for paragraphs

Post by netgeorger » Sat Aug 04, 2012 1:26 pm

I want to use paragraphs to create a document inserting them in a template form made up of paragraphs
formated with outline numbering when I insert a new paragraph I want the outline to update and the TOC to update as well the problem is to get an automatic number outline on insertion or when a paragraph is deleted. I want something that will create an number outline 1.1 1.2 1.3 or 2.a 2.b etc.. Is there a way to use the new liststyle features to create outline numbering scheme of a mixed type? or is there some programing trick that could acomplish it?
Thanks
George

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: create outline numbering for paragraphs

Post by dunbarx » Sat Aug 04, 2012 3:28 pm

Hi.

It would be straightforward for LC to examine the existing text and parse what i think would be the salient feature of a paragraph, namely two returns in a row.

You can trap "returnInField" and either of "textChanged" or "rawKeyUp" (to detect the delete key).

In fact, your script could simply trap all "rawKeyUp" messages, check out the character of interest, and append it to your text field. So instead of letting the computer write your text, you are preprocessing it and building under script control as you type. In this way you can check to see where the double returns are, whether added or deleted, and renumber the whole as required. Speed will not be an issue.

I do not see a way to manage subParagraphs, unless they contain, say, a tab character. In that case, you check for that pattern as well, (return, return,tab) and number accordingly.

This will be an involved but simple task. Write back if you need more.

Craig Newman

netgeorger
Posts: 4
Joined: Sun May 10, 2009 7:18 pm

Re: create outline numbering for paragraphs

Post by netgeorger » Wed Aug 08, 2012 12:11 pm

Craig thanks for your reply
I will give a stab at it and see what I can do. I am so new to all of this I can barely get the Idea
Thanks

Post Reply