WR Get styled text and WR INSERT STYLED TEXT can be used to programmatically consolidate text from multiple 4D Write areas into one 4D Write area without losing the text formatting. In the following code this is used to print all of the 4D Write documents stored in a BLOB field (PluginArea1_ in the example) in a table ([Table 1] in the example) as one 4D Write area. This can be useful if they are all short documents and a developer does not want to print each document on a separate page.
$Print:=WR New offscreen area ALL RECORDS([Table 1]) For ($I;1;Records in selection([Table 1])) $Temp:=WR New offscreen area WR BLOB TO AREA ($Temp;[Table 1]PluginArea1_) $char:=WR Count ($Temp;0) WR SET SELECTION ($Temp;0;$char) $BLOB:=WR Get styled text ($Temp) $char:=WR Count ($Print;0) WR SET SELECTION ($Print;$char;$char) WR INSERT STYLED TEXT ($Print;$BLOB) WR DELETE OFFSCREEN AREA ($Temp) NEXT RECORD([Table 1]) End for WR PRINT ($Print) WR DELETE OFFSCREEN AREA ($Print) |