Apr 26th, 2005, 11:10 PM
|
#3
|
|
Programmer
Join Date: Mar 2005
Location: Edmonton, Alberta, Canada
Posts: 37
Rep Power: 0 
|
Arla:
I think a more specific example of what you are trying to code is needed for me to really understand what you are trying to do. I see no problem with having a bunch of methods that are named the same but have different input params. From what I gather from you though, perhaps you can use something like this:
public void printGreeting( string Name, string Address, int Age, bool Married, int CustomerLevel )
{
switch( CustomerLevel )
{
case 1:
//do something
break;
case 2:
//do something
break;
case 3:
//do something
break;
case -1:
//perhaps this can be the case where this parameter is empty or
//should not have a value
break;
}
switch ( Name )
{
case "Jane Doe":
//do something
break;
case "John Smith":
//do something
break;
case "Englebert Humperdinck":
//with such a name he should always have his own case
//do something
break;
case "":
//again, perhaps this can be the case where this parameter is
//empty or should not have a value
break;
}
if ( Married )
{
//do something
}
else
{
//do something else, or not
}
}
...again, I am not sure exactly if that will help, or particularily what you are trying to accomplish. If you can post some of the code you already have , that would be great!
__________________
public class MySignature extends Post implements JavaSyntax throws NuttinHoney{
MySignature()
{
Salutation();
Name();
}
public string Salutation()
{
Screen.printLn( "Sincerely,\n" );
}
public string Name()
{
Screen.printLn( "Kevin Parkinson" );
}
}
|
|
|