RE: static function question



Hi,

Can you post the code, remember that you should call the object using the
class name and not the instance to access the static ones:

public class MyStaticClass
{
public static int StaticVar;
public int InstanceVar;
}

// To access the static one
MyStaticClass.StaticVar;

//To access the instance one
MyStaticClass MyInstance = new MyStaticClass();
MyInstance.InstanceVar;

Cheers
Salva


"juli jul" wrote:

> Hello!
> If I want to pass some class variable from one class to another : how
> can I do it with the static function?
> I tried but I can't see the class variables in the static function I
> made-are there some other methods to do it?
> Thank you!
>
> *** Sent via Developersdex http://www.developersdex.com ***
>
.


Loading