12. Report-Writer Statements : Text Positioning Statements : .Right Statement—Right Justify the Text : Description
 
Share this page                  
Description
The .right statement right justifies the text printed in the next .print statement to one of the following locations:
Specified position
Position corresponding to a specified column
Value of a numeric expression that evaluates to a specified position
Value of a string expression or variable that evaluates to a column name
Report-Writer evaluates any expressions that are used as parameters to the .right statement during runtime.
You can specify all the values for these parameters as either absolute or relative to the last output. Report-Writer removes all leading and trailing blanks from the text before placing the text in the output line.
If you specify n or a numeric expression that evaluates to n (either relative or absolute), Report-Writer right justifies the text to that position. If you specify nothing, Report-Writer right justifies the text to the right margin of the report. Report-Writer determines the right margin either from the .rightmargin statement, if specified, or by default as described in Automatic Determination of Default Settings.
If you specify right justification with the columnname parameter or through a string expression that evaluates to a columnname, Report-Writer right justifies the text to the right edge of that column, as determined from the following:
Default position of the column, as determined from the .position statement or by default
Width of the column, as determined by the default width or the width of the format specified in a .format statement for that column, or by the width specified in .width or the .position statements
The .right statement justifies to a position calculated as:
justification position =
default column position + default width
The meaning of the .right statement is slightly changed when the .right statement is executed within column formatting mode (that is, when the .within statement is in effect and default column widths and positions are assumed). When the .right statement is so executed without a parameter, the current position becomes the right margin as defined by the .within statement, not the right margin of the report. For more information about column formatting mode, see the .within/.endwithin statements.