C
C#14mo ago
Alex

❔ CS1077 here which I don't know how to resolve. Something to do with the out parameters

https://paste.mod.gg/esakwzvzaedv/0 It wants me to assign some value to the variables but then they're useless
BlazeBin - esakwzvzaedv
A tool for sharing your source code with the world!
4 Replies
Pobiega
Pobiega14mo ago
you MUST assign a value to out variables for any and all branches of your program also, with iChoice seeming to be a stateful variable, should this really be static?
Florian Voß
Florian Voß14mo ago
the easiest way to do what @Pobiega suggests is to choose a default value for it and assign that default value in the first line before doing anything else
Alex
Alex14mo ago
thanks its accessed in a few other methods aswell so this is just a bit easier for me
Accord
Accord14mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ avalonia cross platform issueIm trying to port my avalonia project to android, but it just shows a white screen, android code is ❔ Why deconstuctor/Finalize example not working in vs 2022. Anything missing``` using System; class GCcollection { public GCcollection() { Console.WriteLine("H❔ Blazor Project won't compile - Previously did without any changes.Hi, I have a blazor project, which previously compiled and ran without issue. My last commit was sub❔ How can I import json file inside a sass file?I have looked around in the web for various solutions and found it could be done easily in javascrip❔ .NET Core 7.0 SDK shown as installed by "apt-get" but not used by "dotnet" commandI am using dotnet-cli and I have been facing this issue with my dotnet installation on Ubuntu Jammy ❔ EF Core Fluent API - Unidirectional one to many relationshipHow can I implement a one to many unidirectional relationship using EF Core fluent API? (Image 1) I❔ Is it a problem to be creating lots of empty lists etc just to avoid null checks?Over thousands of items, is this expensive or a problem? What is a better way to avoid null checks? ❔ Decent terminal UI library or solutionI'm writing a terminal-based application that requires a TUI. I've tried Terminal.Gui but I've found❔ Unable to bind CollectionView to DictionaryWhen binding a `CollectionView` to a Dictionary, MAUI throws a XAML exception of ``` Error: Cannot ✅ How to make program wait before executing next print line?```cs Console.WriteLine("This is line one"); // sleep 2 seconds Console.WriteLine("This is line two"