problem importing tab delimited text files

Ian McKnight iangmcknight at gmail.com
Sun Jan 16 07:02:41 EST 2011


Thanks Richard

I just included your handler in my test stack and it returned "can't open
file(32)"
 - very useful indeed. I didn't think about sysError being used in that way
- message to self - must spend more time reading the dictionary! :)


On 15 January 2011 23:37, Richard Gaskin <ambassador at fourthworld.com> wrote:

> Ian McKnight wrote:
>
>  Thanks for the advice David. I went back and checked. As I still had the
>> text file open in Excel when I was trying to import it into LC the file
>> must
>> have been locked in some way by Excel - as soon as I closed the file in XL
>> it worked perfectly. Makes perfect sense really.
>>
>> I think I'll start writing down my gaffs down in a notebook to try and
>> save
>> time in future :)
>>
>
> Why write them down when you can have LiveCode write them for you? :)
>
> If you check "the result" after a command is run, a non-empty value will
> usually contain an error string.
>
> If you also include a call to the sysError function, you get the system's
> error code to guide you to the specifics of the error.
>
> And if you include all that in a handler call, you only need to write it
> once, e.g.:
>
> on SomeHandler
>  ...
>  put url ("file:"& tMyExportedDataFile) into tData
>  Err the result
>  ...
> end SomeHandler
>
> on Err s
>  if s is not empty then
>    put sysError() into tSysError
>    answer "An error occured: "& s &"(" &tSysError& ")"
>    exit to top
>  end if
> end Err
>
>
> --
>  Richard Gaskin
>  Fourth World
>  LiveCode training and consulting: http://www.fourthworld.com
>  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
Regards


Ian McKnight

iangmcknight at gmail.com
=======================



More information about the use-livecode mailing list