Hi Steven,

This is pretty easy, once you know the trick. First, though, I'll ask
if you've looked into using EXISTS? ?

SW> TRANSFER-FILE: does [
SW>     either error? FTP-RESULT: try [
SW> ;;;;    read %nonexistent.txt   ;;;;; this file does NOT exist
SW> ;;;;    read %fileexists.txt    ;;;;; This file DOES exist
SW>         write %tempfile.txt read %fileexists.txt
SW>         ]

TRY returns the result of the block evaluation; in this case, the
result of WRITE. Fire up a console and see what WRITE returns. Now,
try assigning that value using a set-word!, like the above code.

What's happening is that WRITE returns an unset! value, which doesn't
work directly with set-word! syntax. You need to use SET/ANY. e.g.:

    either error? set/any 'FTP-RESULT try [
        write %tempfile.txt read %fileexists.txt
    ]

HTH!

-- Gregg                         

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to