Bob,

I've seen this exact behavior when trying to read a file for which I do not have write permission. (If memory serves, checking the result right after the open file or read from file with give you an error message.) Try using

open file myfile for read

before you do read from file. Either that or change the permissions on the files you're reading.

Devin

On Sep 26, 2006, at 11:36 AM, Robert Sneidar wrote:

This script was working on a PowerPC based G4 laptop. I dropped the laptop whacking the backlight, but that is another story. I was able to import all my programs and data to a brand spanking new Intel Macbook Pro. Now this script is NOT working. THE IT variable does NOT CHANGE when I read from a file! It remains the path to the file I chose in the answer file dialog. Is read from file broken for the Intel machines??

ON mouseUp
    breakpoint
    answer file "Select the program file to import:" of type "F+PR"
    put it into mfile
    IF mfile is empty THEN exit mouseup

    put slyfilefrompath(mfile) into mshortfile
    IF char -4 of mshortfile is "." THEN
        put char 1 to -5 of mshortfile into mmodule
    END IF

    IF there is a card (mmodule) THEN
        go card (mmodule)
    ELSE
        new card
        set the name of this card to tolower(mmodule)
    END IF

    -- here is the important part
    open file mfile
    read from file mfile at 1 until END
-- at this point it still contains the result of the answer file dialog!!!!! EEEEEEKKKKKK!!!!!!
    put it into field code
    -- close file mfile
set the text of field "lblcode" to "Code: " & slyfilefrompath (mfile)
END mouseUp


Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to