Create a List

Create a List

Hi,

I would like to create a list List01  based on other fields values like when Sub01 is not null then List01 contains 1, then when Sub02 is not null then List01 will add another value 2 so Final list will be {1,2} . This is something looks like below

if ( Sub01 != null)

{

List01 = {1};

}

if ( Sub01 != null && Sub02 != null)

{

List01 = {1,2};

}


then, 

If (Sub01  =  null && Sub02 != null)
{
List01 = {2};
}


Could anyone please help me how do I can create the above list ?

Thanks

Arfater