Hi,

you can easily modify it to be non-SMC.

To resume processing all you need to do is run the function again. If you
want to see how many links are left to be processed it's easy, just type
source links. Self-modification is removed.

links: make block! 0

get-linked-pages: func [
    {retrieve information from the web}
    /local link
][
    if tail? links [
        parse read join some-url-path some-file-name [
            some [ thru {<A HREF="} copy link to {"}
                (append links link)
            ]
        ]
    ]
    while [ not tail? links ] [
        link: first links
        save to file link read join some-url-path link
        remove links
    ]
]



----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 21, 1999 4:12 PM
Subject: [REBOL] Self modifying code Re:


>
> Here is a useful example of self-modifying code. This function will hold
> a list of links to be retrieved, and retain it even if an error occurs.
> To resume processing all you need to do is run the function again. If you
> want to see how many links are left to be processed it's easy, just type
> source get-linked-pages. The self-modification is really quite trivial,
and
> easily read by humans.
>
> get-linked-pages: func [
>     {retrieve information from the web}
>     /local links link
> ][
>     links: []
>     if tail? links [
>         parse read join some-url-path some-file-name [
>             some [ thru {<A HREF="} copy link to {"}
>                 (append links link)
>             ]
>         ]
>     ]
>     while [ not tail? links ] [
>         link: first links
>         save to file link read join some-url-path link
>         remove links
>     ]
> ]
>
>
> Eric
>
>

Reply via email to