Questions tagged [unassigned-variable]

93 questions
0
votes
1 answer

C# Visual Basic Inheritance

I'm just getting started with C# and I've been stuck on this problem for two weeks. I have a main form that gets values from a class and a subclass. My problem is that when I try to create an object of the CorporateClass VB tells me that two of my…
0
votes
3 answers

"Use of unassigned variable" error

I am developing this website in ASP.NET and using C#. I am Getting the error that :Use of unassigned variable usn. The database is also not empty. My code is: protected void Button1_Click(object sender, EventArgs e) { SqlConnection cn = new…
0
votes
2 answers

use unassigned local variable 'multidimension'

I am getting an error use unassigned local variable 'multidimension' from below code. I am trying to put the data returned back from the text file in a multidimensional array by splitting them and put each row in in the array private void…
0
votes
1 answer

Is there a way to check a variable is already initialized in c++?

Let us say I'm initializing a vector vector V(n);. Is there a way I can know if V[n] is initialized or not? I need this for dynamic programming purposes. If the V[n] is initialized, I would utilize the value V[n] to obtain the result. If it's…
madhan01
  • 117
  • 5
0
votes
1 answer

How to assigne a dataframe mean to specific rows of dataframe?

I have a data frame like this df_a = pd.DataFrame({'a': [2, 4, 5, 6, 12], 'b': [3, 5, 7, 9, 15]}) Out[112]: a b 0 2 3 1 4 5 2 5 7 3 6 9 4 12 15 and mean out df_a.mean() Out[118]: a 5.800 b …
0
votes
2 answers

How to resolve this compilation error "Using unassigned local variable 'hak'" when using goto?

I'm trying below code. It gives me a warning "Use of unassigned local variable 'hak' ". I guess I'm missing something here. I want it to display "3 defa yanlış giriş yaptınız. Müşteri hizmetleri temsilcisiyle görüşünüz. İyi günler dileriz." when…
0
votes
1 answer

How to get around use of unassigned variable that can never happen?

In the following piece of code, the compiler gives a "Use of unassigned local variable" on 'intValue' on the return line. However, there is no case where "intValue > 500" will be reached where it will be unassigned (because if intValue is…
DMX David Cardinal
  • 599
  • 2
  • 7
  • 19
0
votes
2 answers

Unity 3D warning CS0414: The field is assigned but its value is never used

I'd like to know why this error happens in the code below. I assigned the correspondent GO's (Game Objects) in the inspector. PhotonNetwork.ConnectUsingSettings, OnConnectedToMaster, OnJoinedLobby working ok The method On_PlayerNameInput_changed()…
0
votes
0 answers

How to check unassigned value of enum in C++

Possible Duplicate: How to check if enum value is valid? I have a ENUM variable without intializing the values to each enum value. i.e. enum TEST ={VALUE1,VALUE2,VALUE3}; Now, I create a variable (ENUM_TEST) of type TEST and values VALUE2 to it.…
ASD
  • 1,441
  • 3
  • 28
  • 41
0
votes
1 answer

Variable 'Button' never assigned (Java using android studio)

First: Apologies if this question has been asked several times already. I just couldn't find a fix. Compiler in android studio returns "1 error": Button button_go2activity findViewById(R.id.button_go2activity); Error code: variable…
Constantin
  • 13
  • 4
0
votes
1 answer

Memory problems shown at run time because of the initialisation of an int data type

After running the program I can only insert data for the first student, and after that it only displays what I should insert, but does not give me the right to do so. No compile errors. Although I think that the problem is when I assign the…
0
votes
1 answer

UnboundLocalError: local variable '(Var)' referenced before assignment

This is my code, sorry it is in Swedish but it is basically rock, paper, scissors. I get the error UnboundLocalError: local variable 'Answer' referenced before assignment even though if the input is correct, the variable should be assigned. The…
0
votes
1 answer

error CS0165: Use of unassigned local variable `color'

I got this error when compiling a unity game. How to fix this ? Thanks Assets/spine-unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs(221,21): error CS0165: Use of unassigned local variable `color' And another Assets/spine-unity/Mesh…
mazpuff
  • 11
  • 2
0
votes
1 answer

HTTP input to javascript variable remains undefined

Okay, so I'm fairly new to javascript and I'm working on the front-end of a webapplication for my internship, and this just utterly baffles me. I have a select and an input element, both of which feed into a message model for a database Procedure…
TJanssen
  • 61
  • 1
  • 1
  • 4
0
votes
4 answers

use of unassigned local variable when using a foreach Loop

I have a code block that gets some data from a stored procedure. After I receive the data, I want to assign the value to "isExisting" depending on conditions. I don't want to assign a value to "isExisting" at the time of declaration. bool…
Rajat
  • 410
  • 4
  • 19