C
C#7mo ago
Shovel

✅ how to swap 2 numbers c# forms

how to swap 2 numbers in c# forms?
33 Replies
Jimmacle
Jimmacle7mo ago
$ask
MODiX
MODiX7mo ago
How to get the best help :catpog: Make a post in #help or one of the topic channels under Development. Avoid asking :catthinking: Can anybody help me? :catthinking: Has anyone used XYZ? :catthinking: Why doesn't my code work? C# is a big area! No one knows they can help unless you tell them about the small area you're trying to work in. Explain what you are doing, and potentially why for as much context as possible. Avoid screenshots where possible, share code directly in Discord. Type $code into chat to learn how to post code. See https://www.nohello.net and https://dontasktoask.com if you want common help chat room etiquette.
Jimmacle
Jimmacle7mo ago
you never responded to your previous question with an adequate amount of detail
Shovel
ShovelOP7mo ago
made new one and explained my question
Jimmacle
Jimmacle7mo ago
where?
leowest
leowest7mo ago
you dont need to make new ones u can just edit your message and include the details or send a new message replying in details in the same thread
Jimmacle
Jimmacle7mo ago
No description
Shovel
ShovelOP7mo ago
ok so can you help
Jimmacle
Jimmacle7mo ago
can you provide more detail?
leowest
leowest7mo ago
you're already being helped on the other thread to reply to the other thread instead and /close this one
Jimmacle
Jimmacle7mo ago
if this is the same question as the other post ill just close this one
Shovel
ShovelOP7mo ago
like if you got 2 digits and wanna swap the 2
Jimmacle
Jimmacle7mo ago
what is "forms" where are the digits?
leowest
leowest7mo ago
post a screenshot of your visual studio that will help us to see what u have
MODiX
MODiX7mo ago
Angius
REPL Result: Success
var a = 10;
var b = 92;
Console.WriteLine($"a: {a}, b: {b}");
(a, b) = (b, a);
Console.WriteLine($"a: {a}, b: {b}");
var a = 10;
var b = 92;
Console.WriteLine($"a: {a}, b: {b}");
(a, b) = (b, a);
Console.WriteLine($"a: {a}, b: {b}");
Console Output
a: 10, b: 92
a: 92, b: 10
a: 10, b: 92
a: 92, b: 10
Compile: 449.146ms | Execution: 38.441ms | React with ❌ to remove this embed.
Shovel
ShovelOP7mo ago
c# forms, I'm talking about how to code it
leowest
leowest7mo ago
because there is winforms, there is webforms
Jimmacle
Jimmacle7mo ago
c# forms is not a thing you're either talking about ASP.NET WebForms or Windows Forms which one are you using?
leowest
leowest7mo ago
👆
Shovel
ShovelOP7mo ago
No description
Jimmacle
Jimmacle7mo ago
so windows forms idk why you said asp.net before
Shovel
ShovelOP7mo ago
idk either
Jimmacle
Jimmacle7mo ago
so are you swapping numbers or digits?
Shovel
ShovelOP7mo ago
numbers
Jimmacle
Jimmacle7mo ago
and where are you stuck on that?
Shovel
ShovelOP7mo ago
idk what to use to actually swap them
Jimmacle
Jimmacle7mo ago
variables
Angius
Angius7mo ago
.
Jimmacle
Jimmacle7mo ago
or tuples like z's example
Shovel
ShovelOP7mo ago
this is hot how u write code in win forms
Jimmacle
Jimmacle7mo ago
okay, so show us the code you have now z's code will work just fine in winforms, it's plain C# it's an example, not a copy and paste solution
Shovel
ShovelOP7mo ago
ok
Want results from more Discord servers?
Add your server