wordWrapPrint()

textReport.wordWrapPrint() 関数を使用して、マージンを超える場合に語を強制的にラップする一時右マージンを使用する次の print ステートメントを出力します。印刷エンジンは、print ステートメントが実行された後ワード・ラップ機能を使用不可にします。

構文

  textReport.wordWrapPrint(
     [tempRightMargin INT? in])
textReport
TextReport 外部型に基づく変数の名前。
tempRightMargin
次の print ステートメントの間にワード・ラップを強制するマージン。 ここでマージンを指定しないと、印刷エンジンはデフォルトの右マージンを使用します。

次の例では、wordWrapPrint() 関数が 80 列で一時マージンを作成します。 myCustomer.customerName が 25 文字よりも長い場合、名前は次の行に折り返されます。

myReport TextReport = new TextReport();
...
myReport.column(55);
myReport.wordWrapPrint(80);
myReport.printText(myCustomer.customerName);

フィードバック