TEXTFILLファンクションは、テキスト値の書式を再設定して、現行の書式にかかわらず指定した幅の行に収めるファンクションです。TEXTFILLは通常、行の幅に統一性がなく右側に不必要な余白があるテキストや、特に幅の大きい行があるテキストの書式を再設定する際に使用されます。
|
注意: TEXTFILLは書式の再設定時にテキストの行を結合し、一方、ROWおよびREPORTは行を結合せずに書式を再設定します。例8-135「ROW内でのTEXTFILLの影響」を参照してください。 |
パラメータ
データの現行の書式にかかわらず、指定した幅に書式を再設定する対象のテキスト式。TEXT式を指定すると、戻り値はTEXTです。NTEXT式を指定すると、戻り値はNTEXTです。
データの書式が再設定される幅。1から132までのINTEGER値として指定します。
構造化されたレポートでは、指定された幅がレポートの列の幅を超えない場合、TEXTFILLはtext-expressionの書式をその幅に再設定します。widthの値が列の幅を超える場合、TEXTFILLはそれを無視し、式の書式は列の幅に再設定されます。
TEXTFILLは、単語間に空白を1つのみ配置して余分な空白を削除することにより、text-expressionの単語をできるだけ多く1行に収めます。単語がwidthより長い場合、TEXTFILLは2行以上に分割します。この場合、行の最後に余分な空白が配置されることがあります。
例
例8-135 ROW内でのTEXTFILLの影響
次の例は、適切に書式が設定されたテキスト変数textvarを使用して、ROWコマンド内でTEXTFILLを使用した場合の影響を示しています。
次の文
SHOW textvar
によって、次の出力が生成されます。
You can use the following options to control the format of your display. BMARGIN Controls the bottom margin. COLWIDTH Controls column width. COMMAS Controls the use of commas in numbers. DECIMALS Controls number of decimal places in numbers. LSIZE Controls the maximum length of a line. NASPELL Controls the spelling of NA values in output.
次のROW文
ROW W 50 textvar
によって、次の出力が生成されます。
You can use the following options to control the format of your display. BMARGIN Controls the bottom margin. COLWIDTH Controls column width. COMMAS Controls the use of commas in numbers. DECIMALS Controls the number of decimal places in numbers. LSIZE Controls the maximum length of a line. NASPELL Controls the spelling of NA values in output.
それに対して、TEXTFILLを指定したROW文
ROW W 50 TEXTFILL(textvar, 50)
によって、次の出力が生成されます。
You can use the following options to control the format of your display. BMARGIN Controls the bottom margin. COLWIDTH Controls column width. COMMAS Controls the use of commas in numbers. DECIMALS Controls the number of decimal places in numbers. LSIZE Controls the maximum length of a line. NASPELL Controls the spelling of NA values in output.