realbasic-nug
[Top] [All Lists]

Re: Class Question

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Class Question
From: Louis G5 Batayte <loug5@batayte.com>
Date: Thu, 30 Jul 2009 23:05:41 -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: <4A7257C5.9060902@rochester.rr.com>
References: <4A7257C5.9060902@rochester.rr.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Tom,
it sounds like you are reusing the fileprops that you said: fileprops = New TheNewFiles

If so, you need to call this for each new TheNewFiles you want
If you just call it once, you will store the same ref in each of the NewFiles() aray elements

Lou


On Jul 30, 2009, at 10:32 PM, Tom Russell wrote:

I am doing something dumb and cannot see it.

Here's what I have:

A class called "TheNewFiles".

Then I have a global property called "NewFiles() as TheNewFiles"

Then in a thread I have this:

dim fileprops As TheNewFiles
fileprops = New TheNewFiles


Then farther in my code I have this:

          fileprops.CRC = somedata
          fileprops.MyID = somedata
          fileprops.Path = somedata
          fileprops.name = somedata
          fileprops.f =somedata
          NewFiles.Append fileprops

Basically I am just loading file names and the paths and some other calculated data into the fileprops structure.

My problem is that I can see when I debug my code that the somedata values are changing and all, however when the appending of the NewFiles happens, it keeps adding the same item Im appending. I essentially get a NewFiles array that is the same file data all the way through it even though I could see the fileprops was different each time I went to append it.

Any ideas on why this is happening and not doing what should be pretty straight forward?

Thanks,

Tom

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

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


_______________________________________________
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>