is it possible to make a static with 3 different variables (double, string, bool)

double oldNumber = -0;
string active = "off";
bool Activet = false;
double oldNumber = -0;
string active = "off";
bool Activet = false;
13 Replies
Tvde1
Tvde1β€’2y ago
are you looking for an enum?
mtreit
mtreitβ€’2y ago
What does "a static" mean?
eult πŸ‡΅πŸ‡ΈπŸ‡΅πŸ‡Έ
what u mean ?
eult πŸ‡΅πŸ‡ΈπŸ‡΅πŸ‡Έ
aha but what I can use for another option ( a function that's take a different variables in same time) would love to send a doc if anyone found
mtreit
mtreitβ€’2y ago
I'm really not sure what you're asking If you need to group values together make a record (or class) or a struct.
eult πŸ‡΅πŸ‡ΈπŸ‡΅πŸ‡Έ
public class Reset
{
public double oldNumber;
public string active;
public bool Activet;
public Reset(double x, string y, bool z)
{
oldNumber = x;
active = y;
Activet = z;
}

}
public class Reset
{
public double oldNumber;
public string active;
public bool Activet;
public Reset(double x, string y, bool z)
{
oldNumber = x;
active = y;
Activet = z;
}

}
okey i made this class how i can use it ? sorry I'm a beginner trying to learn
atakancracker
atakancrackerβ€’2y ago
private void MyMethod(double oldNumber, string active, bool activet)
{
Console.WriteLine(oldNumber);
Console.WriteLine(active);
Console.WriteLine(Activet);
}
private void MyMethod(GroupOfVariables variables)
{
Console.WriteLine(variables.OldNumber);
Console.WriteLine(variables.Active);
Console.WriteLine(variables.Activet);
}

class GroupOfVariables
{
public double OldNumber { get; set; }
public string Active { get; set; }
public bool Activet { get; set; }
}
private void MyMethod(double oldNumber, string active, bool activet)
{
Console.WriteLine(oldNumber);
Console.WriteLine(active);
Console.WriteLine(Activet);
}
private void MyMethod(GroupOfVariables variables)
{
Console.WriteLine(variables.OldNumber);
Console.WriteLine(variables.Active);
Console.WriteLine(variables.Activet);
}

class GroupOfVariables
{
public double OldNumber { get; set; }
public string Active { get; set; }
public bool Activet { get; set; }
}
like this ?
mtreit
mtreitβ€’2y ago
Have you gone through a basic C# tutorial? We usually recommend at least going through something like $helloworld to get started if you are just beginning.
eult πŸ‡΅πŸ‡ΈπŸ‡΅πŸ‡Έ
yes thanks This is what i need
atakancracker
atakancrackerβ€’2y ago
still go for fundamentals πŸ˜„ Its better to go step by step, search tutorials and documents