In einer eMail vom 14.03.00 16:49:23 (MEZ) Mitteleuropäische Zeit schreibt 
[EMAIL PROTECTED]:

<< Thanks for the rescue. will paste it. BTW, one missing thing is "^^"? :)
 
"^^"?? Hahaha, no, Your code is ok :-) 
I changed it a bit for my needs, see below. Thank you, database runs again :)
(Have not really testet the 'save-history yet, should be the right syntax)

Volker

;
; nearly History save and load by Christoph Mammitzsch
;
save-history: func[
   "Saves system/console/history to file."
   file [ file! ] "the file to save to"
][write file mold-string-series system/console/history]

mold-string-series: func [
   history [ series! ] "the series to save"
   /nocopy "trashs input, but saves memory. >2mb mails yet"
   /local line subst
][
   if not nocopy [history: copy history]
   forall history [
      line: mold first history
      if equal? first line #"{" [
         line: change line #"^""
            forall line [
                subst: select [
                    #"^""   "^^^""
                    #"^/"   "^^/"  
          ;There must be more. I'm sure I forgot something :)
                ] first line        
                if not none? subst [
                    remove line
                    line: back insert line subst
                ]
            ]
            change back line #"^""
         line: head line
      ]
      change/only history line
   ]
   history: head history  
]

load-history: func [
   "Restores system/console/history from file."
   file [ file! ] "the file to load from"
   /local history
][
   system/console/history: load file
   exit
]


 In einer eMail vom 14.03.00 13:08:23 (MEZ) Mitteleuropäische Zeit schreibt 
 [EMAIL PROTECTED]:
 
 << Hi Volker,
  
  this problem has been found before, when trying to save
  history to files, here's a history save function, that 
  does it right ...
  
  >>


Volker

Reply via email to