© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•16mo ago•
39 replies
Golbin Machine

✅ variable wont change

switch(vars.AfterMath)
{
     //vars is a class i got w all my variables in it
     //AfterMath is a variable that stores if you won or no
     case true:
          vars.money = vars.money + (vars.betAmount * 2);
          break;
     case false:
          vars.money = vars.money - vars.betAmount;
}
switch(vars.AfterMath)
{
     //vars is a class i got w all my variables in it
     //AfterMath is a variable that stores if you won or no
     case true:
          vars.money = vars.money + (vars.betAmount * 2);
          break;
     case false:
          vars.money = vars.money - vars.betAmount;
}

then when I go run the program again it says the money is "100$" as I had it at the start and it wasent changing???
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Change a variable in method.
C#CC# / help
4y ago
Variable changes when I leave a method
C#CC# / help
16mo ago
How to update UI easily on variable change in MAUI
C#CC# / help
2y ago