realbasic-nug
[Top] [All Lists]

Re: Help please - "Moving files"

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Help please - "Moving files"
From: Charles Yeomans <charles@declareSub.com>
Date: Thu, 12 Jun 2008 15:08:58 -0400
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <399980.7599.qm@web65606.mail.ac4.yahoo.com>
References: <399980.7599.qm@web65606.mail.ac4.yahoo.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
There is exactly one object reference in that line of code. Ergo, the NilObjectException is almost certainly raised because f is nil. That object reference is obtained by assignment from dir.TrueItem(i). That means that dir.TrueItem(i) returned nil. This can certainly happen, so you should check for and handle that possibility.

Charles Yeomans

On Jun 12, 2008, at 2:51 PM, Lennox Jacob wrote:

Hi Dennis,

It recognises the new files
I added msgbox "i = " + str(i) and it does give the correct number of files.

The error comes here

      if f.name.Left(12) =  "New Appts - "   then

but I cannot figure it out

Lennox.

Dennis Birch <dennisbirch@gmail.com> wrote: On Thu, Jun 12, 2008 at 10:43 AM, Lennox Jacob wrote:
So when I click the pushbutton, all the files are moved from Folder DDD to Folder C C C

Now if I move back some or all of those files from C C C to DDD and click the pushbutton again I get a NilObjectException error, how do I fix that?

The first thing you should do is add a breakpoint to the beginning of
the method and step through it to see where you are getting the
nilobjectexception. Then you'll be able to ask a more pointed question
that somebody might be able to help you with, or perhaps you'll grok
the answer yourself.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>