Hammering on about Paragraphs

Sivakatirswami katir at hindu.org
Tue Dec 23 21:25:32 EST 2008


Richmond Mathewson wrote:
> Dear Sivakatirswami,
>
> [snip]
>
> I would like to delude myself that, although a mole,
> shovelling away in the dark, I have at least one eye
> open to look at higher things. Where you and I differ,
> perhaps, is that, at present, "higher things" means
> becoming a highly competent Runtime Revolution
> programmer. While this may not result in a particularly
> long-lasting type of peace, it will guarantee that the
> rest of my time on earth is rather comfortable.
>
>   
None of the moles in the dream were meant to represent "Jolly Richmond." :-)

And, the allegory was never meant to fly to such dizzing teleological 
heights. I only hoped to thwart any effort made toward establishing some 
"British Paragraph" (indented) vs "American Paragraph" (block style) in 
Revolution syntax, by our dear RunRev engineers As has been pointed out, 
it would appear, on the surface a least, it a simple matter to test for 
firstIndent property, or   "cr & space" or "cr & cr" etc.

    If anything is every to be achieved toward that end it needs to be, 
as as oft been begged for, full paragraph level styling, ala any old 
word processing program or ala CSS if the latter be more doable. Either 
way would work for me, though the latter seems more appealing -- unless 
we  want portability across processing environments.

Back on Topic:

hmmm me thinks I never did get clarity on precisely what your 
need/problem/challenge is here. What are you trying to solve?

Given the never-to-be-overcome idiosyncracies of data entry, you will 
*still* have to parse and clean up "cr & space&space " invariably 
entered by those who think this is the standard. e.g. you have fields 
set up with no first indent and your users will balk and enter spaces in 
the first line whether you like it or not. In my own apps for volunteers 
doing audio transcriptions, I have, on save,  stuff like this, sweet 
old, non-optimized baby xTalk:

# restore block paragraphs separated by one blank line

replace (cr & " ") with cr in fld "Entry"
replace (cr & "  ") with cr in fld "Entry"
replace (cr & "  ") with cr in fld "Entry"
replace (cr & "    ") with cr in fld "Entry"
replace cr with (cr &cr) in fld "Entry"
repeat 4 times
  replace (cr &cr &cr) with (cr & cr) in fld "Entry"
repeat time

just prior to

replace (cr & cr) with "</p>& cr & <p>"  just prior to converting the 
field to XML for later XSLT transformations...

Not too elegant, but soooooo very obvious -- which is what I so love 
about xTalk.

You could then easily follow up with

# set to indented style

replace (cr & cr) with cr in fld "entry"
set the firstIndent of fld "Entry" to true

skts





More information about the use-livecode mailing list