In einer eMail vom 10.03.00 01:12:44 (MEZ) Mitteleurop�ische Zeit schreibt 
[EMAIL PROTECTED]:
[do load], not [load] ?
Your Database contains [make object[..]] ? This are, simply loaded, 
three elements, 'make , 'object! , [..]
they must be [do]ne to create the structure.

rugly, try this:

a: make object! [ a: none ]
probe a
save %t.txt a
print "dump file, load, do load"
print read %t.txt
probe load %t.txt
probe do load %t.txt

gives (editied)
; original:
make object! [
    a: none
]
dump file, load, do load
; code in file
make object! [
    a: none
]
; simply loaded, wrong!
[
    make object! [
        a: none
    ]]

; do loaded, ok:
make object! [
    a: none
]

and correct my english :)
Volker

> The example below reads a web page of alternating headlines and
>  associated stories.  If the same headline appears on a later scan
>  the story is ignored.  It saves elements parsed from the webpage
>  as an array (block) of structs (object!s).
>  It cannot seem to restore them cleanly when rerun later.
>  why? How do I get around it for now?
>  
>  I have simplified the example below.
>  
>  REBOL [title: "sample story fetcher" ]
>  
>  stories: make block! 25
>  story-tmpl: make object! [
>   head: none
>   body: none
>   topics: none
>   dest: none
>   fileto: none
>   ]
>  
>  page-parser-rules: [
>   any [
>   thru "headline:"
>   copy headl  to "story:"
>   thru "story:"
>   copy story-body      [ to "headline:" | to  | to end ]
>   (store-story)
>   ] ]
>  
>  headl: make string! 30
>  topic: make string! 30
>  story-body: make string! 300
>  
>  store-story: func [ /local  sry ] [
>          ; drop dupes...
>          foreach st stories [
>            if st/head = headl [ return false ]
>                 ]
>  
>  ; fill in struct
>          sry: make story-tmpl []
>          sry/head: copy headl
>          append stories sry
>          ]
>  
>  go: func [ /local c ] [
>      if exists? %articles/stor  [ stories: load %articles/stor ]
>      c: read  http://localhost/storygenerator.cgi
>  
>      parse c page-parser-rules  ; calls store-story when "headl" filled
>      save %articles/stor stories
>      ]
>  
>  go
>  q
>  
>  
>  ;# mailto: [EMAIL PROTECTED]
>  


Volker

Reply via email to