7.67.52015-05-06

BeginParagraph … EndParagraph (procedure)

Delimits a paragraph of formatted text.

The beginparagraphendparagraph structure can contain only the following commands: setstyle(), setstyleext(), show(), and % (indicating a commented line). Any other command included within this structure will yield unpredictable results. A margin() command should precede the beginparagraph...endparagraph structure, and each variable you reference within the structure must have its own procedure., as demonstrated in the second of the examples below. Also note that the first command within a beginparagraph...endparagraph structure must be the setstyle() command.

No crlf procedures are permitted inside a paragraph structure, since crlfs are paragraph delimiters.

If you do not need to change fonts or use variables within a paragraph, it is strongly recommended you use the text object in PlanetPress, as PlanetPress optimizes text objects to improve performance.

When a long string containing no spaces between its characters appears in the context of a show() command and the beginparagraph ... endparagraph() command, the line of text will not wrap. The same is true for a text object; no wrapping occurs when a long string has no spaces between its characters.

Note that when a Text object is converted to PlanetPress Talk, an extra argument is is added to the beginparagraphendparagraph syntax. Ignore this argument since it is strictly for internal use.

Syntax

beginparagraph( lmargin, rmargin, firstindent, align, leading,[opt, forcedwordwrap])

endparagraph()

Arguments

lmargin

Measure value specifying the left margin, in inches, of the text relative to the left border of the object.

rmargin

Measure value specifying the right margin, in inches, of the text relative to the left border of the object.

firstindent

Measure value specifying the indent, in inches, of the first line of the paragraph, relative to the lmargin parameter.

align

String value specifying the text alignment within the paragraph. Possible values are 'left', 'right', 'center' and 'leftright' (for both left and right justification of text).

leading

Measure value specifying the amount of vertical space, in inches, between each line of the paragraph.

opt

Optional boolean value used internally.  Default value is false.

forcedwordwrap

Optional boolean value that forces wordwrap at the defined paragraph size.  Default value is false.

Code Sample Examples

Example that displays a paragraph aligned to the right.

Example 1


beginparagraph(1,3,0,'right',0.16)
	setstyle(&Default)
	show('This long line of text should wrap around')
	show('This long line of text should wrap around')
endparagraph()

Example that shows how to include a variable within a formatted paragraph.

Example 2


define(&var,string,'very')
beginparagraph(1,3,0,'left',0.16)
	setstyle(&Default)
	show('This ')
	show(&var)
	show(' long line of text should wrap around')
endparagraph()