Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

How to append newline to a block

 [1/3] from: carlos:lorenz:gmai:l at: 23-Apr-2009 13:55


Hi list, I have a block full of strings I want to save to a file using SAVE. Then when my user opens the file using notepade.exe he must see something like this: string 1 string 2 string 3 Which is the best way to append a newline at the end of each string without having to show the user the newline char #"^/" ? Thanks for any help -- Carlos Lorenz Unidade Lorenz Ltda www.revistaeletronica.com.br (11) 4034 1971 (11) 7100 1540 pessoal

 [2/3] from: dhsunanda:gma:il at: 23-Apr-2009 18:30


Carlos Lorenz wrote:
> Which is the best way to append a newline at the end of each string without > having to show the user the newline char #"^/" ?
Does this do what you want? blk: ["a" "b" "c"] new-line/all blk 1 save %temp.tmp a print read %temp.tmp a b c Sunanda

 [3/3] from: christian::ensel::gmx::de at: 28-Apr-2009 11:09


Late answer to your question, Carlos, but if each of your strings resembles exactly one line in the desired output, you'd normally want to use WRITE/LINES:
>>help write
USAGE: WRITE destination value /binary /string /direct /append /no-wait /lines /part size /with end-of-line /allow access /mode args /custom params DESCRIPTION: Writes to a file, url, or port-spec (block or object). WRITE is a native value. : REFINEMENTS: : /lines -- Handles data as lines. : So, just WRITE/LINES %temp.tmp blk HTH, Christian Sunanda schrieb: