gettingstarted
[Top] [All Lists]

RE: wrap and array

To: "'Getting Started'" <gettingstarted at lists dot realsoftware dot com>
Subject: RE: wrap and array
From: "POIDINGER, Michael [JJRAU]" <MPOIDING at MEDAU dot JNJ dot com>
Date: Tue, 24 May 2005 16:36:58 +1000
Delivered-to: gettingstarted at lists dot realsoftware dot com

  

> -----Original Message-----
> From: gettingstarted-bounces at lists dot realsoftware dot com 
> [mailto:gettingstarted-bounces at lists dot realsoftware dot com] On 
> Behalf Of GAmoore at aol dot com
> Sent: Tuesday, May 24, 2005 3:33 PM
> To: gettingstarted at lists dot realsoftware dot com
> Subject: Re: wrap and array
> 
>  Thanks Charles. I appreciate that example. See questions below.
> 
> > Sub Append(theEmployee as EmployeeClass)
> >    //you can append a nil EmployeeClass object, but do you want to?
> >    me.pList.Append theEmployee
> > End Sub
> > 
> 
> Does your comment mean that you should have something like this:
> if  theEmployee <>   nil then me.pList.Append theEmployee
> 

Or perhaps kick up a warning, or an error.


> > 
> > Sub Insert(theEmployee as EmployeeClass, index as Integer)
> >    me.pList.Insert index, theEmployee
> > End Sub
> > 
> 
> This insert method seems to be calling itself and not really 
> doing anything else, unless its using a built-in insert method.

The Insert method on the class is wrapping the insert method of the array.
In this case, the methods just happen to have the same name

Sub MyNiftyFunction(theEmployee as EmployeeClass, index as Integer)
> >    me.pList.Insert index, theEmployee
> > End Sub
> > 

Will do the same job, just with a less intutive method name

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

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