Hi,

Please see the example below. What you need is a method on your
class to interact whit you calss variables/objects. I have defined a
method called X() on my class Test1.

static void Job205(Args _args)
{
    array   classarray  = new array (types::class);
    test1   test1       = new test1();

    counter i;
    ;

    test1 = classarray.value(1, new test1());
    test1.x(10);

    test1 = classarray.value(2, new test1());
    test1.x(100);

    test1 = classarray.value(5, new test1());
    test1.x(1000);

    for(i=1;i<10;i++)
    {
        if (classArray.exists(i))
        {
            test1 = classarray.value(i);
            if (test1)
            {
                print test1.x();
            }
        }
    }

    pause;
}

method x() on class Test1

int x(int _x = x)
{
    ;

    x = _x;

    return x;
}

regards,
Karsten
Thy Data Center Development A/S

--- In [EMAIL PROTECTED], Andre Klopper
<[EMAIL PROTECTED]> wrote:
> Ok,
>
> This is a reel stupid question but still I can't get it to work...
>
> I declare an array TempArray of type class.
> I've created a class SomeClass with 2 variables. varOne, varTwo.
>
> Array TempArray= new Array(types::Class);
> SomeClass TempClass = new SomeClass();
> int x;
>
> then I set the data in the class... and assign it to the array.
>
> for(x=1;x<=3;x+=1)
> {
>   TempArray.value(x, TempClass.passData);
> }
>
> How do i see the data that has been added?
>
> print TempArray ???
>
> Regards
> Andre
> The information transmitted in this electronic communication is
intended
> only for the person or entity to which it is addressed and may
contain
> confidential and/or privileged material. PPS Insurance is neither
liable for
> the proper, complete transmission of the information contained in
this
> communication nor any delay in its receipt. Opinions, conclusions,
and other
> information contained in this message that does not relate to the
official
> business of PPS Insurance, shall be construed as neither given nor
endorsed
> by PPS Insurance. PPS Insurance accepts no liability whatsoever
for any
> loss, whether direct, indirect or consequential, arising from
information
> made available or actions taken in reliance upon this information
by persons
> or entities other than the intended recipient.
> Director's of Professional Provident Society Insurance Company
Limited:
> Dr. DR Anderson (Chairman), Adv. R Meyer (Deputy Chairman), Dr. NG
Campbell,
> Judge LI Goldblatt, Mr. I Kotz�, Mr. MJ Jackson (Chief Executive),
Mr. CJ
> Masson, Mr. EA Moolla, Mr. WF Mthembu, Dr. DGC Presbury, Mr. DK
Smith, Mr DD
> Gnodde, Dr JJ van Niekerk.                           Company
Secretary -
> Mrs. J Lester.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to