KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Resaving all 4D Write documents in a table
PRODUCT: 4D | VERSION: 13.1 | PLATFORM: Mac & Win
Published On: December 20, 2012

Sometimes a 4D Developer may want to re-save all 4D Write documents in a table.

Let's say you have a table named [Letters] and 4D Write documents stored in the Letters_ field. Re-saving all of the 4D write documents can be easily accomplished with the following code:

ALL RECORDS([Letters])
$Temporary:=WR New offscreen area
While (Not(End selection([Letters])))
   WR PICTURE TO AREA ($Temporary;[Letters]Letter_)
   [Letters]Letter_:=WR Area to picture ($Temporary;1;1)
   SAVE RECORD([Letters])
   NEXT RECORD([Letters])
End while
WR DELETE OFFSCREEN AREA ($Temporary)
ALERT("done")