EBOLII Posted April 13, 2016 Share Posted April 13, 2016 How do I fix both a local variable never assigned a valueunreferenced local variable Link to comment Share on other sites More sharing options...
zingfharn Posted April 13, 2016 Share Posted April 13, 2016 Perhaps a little more data? One looks like a warning, though. like when you do function() { local int a, b; a = 2; }it'll warn about b. Link to comment Share on other sites More sharing options...
abeclancy Posted April 13, 2016 Share Posted April 13, 2016 This is actually something that I would be interested in knowing as well, although EBOLI's description leaves much to be desired. Basically, it would be nice if someone knew of a way to disable compiler warnings selectively, on individual statements or variables ideally. The compiler often incorrectly complains that a variable is never assigned a value, even though it is as part of a different function's OUT parameter. For example, the following is legitimate, but the compiler will (probably anyways, I'm not actually testing this but I get this warning a lot) generate a warning about the variable not being assigned a value, even though it DOES get assigned a value in the called function due to it being an "out" parameter. local MissionSchedule ActiveSchedule; `TACTICALMISSIONMGR.GetActiveMissionSchedule(ActiveSchedule);So yeah, being able to remove these compiler warnings would be nice if only just to clean up the output. Link to comment Share on other sites More sharing options...
zingfharn Posted April 13, 2016 Share Posted April 13, 2016 What level of logging do you have set? Link to comment Share on other sites More sharing options...
EBOLII Posted April 13, 2016 Author Share Posted April 13, 2016 How do you tell? Link to comment Share on other sites More sharing options...
zingfharn Posted April 14, 2016 Share Posted April 14, 2016 Tools -> options -> projects -> build and run Link to comment Share on other sites More sharing options...
EBOLII Posted April 14, 2016 Author Share Posted April 14, 2016 lol thought you was referring to something else Link to comment Share on other sites More sharing options...
Deleted32045420User Posted April 14, 2016 Share Posted April 14, 2016 (edited) TBH (and I don't want to sound arrogant or anything) if you don't know what these errors mean you should try learning coding some more, these are pretty simple and common compilation errors and they are also stated in clear English, now I know some people don't speak English as their native tongue (including myself) but this is the basics that you have to know to code properly, cold hard truth - I know I've run into that brick wall a few times myself. I know I'm not the most helpful right now but I'm on my phone proper explanations will come soon in an edit EDIT: sorry i was so tired yesterday, the first issue "local variable never assigned a value" means that you have a local variable (like local int x;) that you never assigned any value to, that means that when you will try to access it all kinds of interesting different things might happen, you want to get that variable a value to start with like x=0; for and int or any other value you'd like. The second issue "unreferenced local variable" means that you have a variable that you declared but never used, that is not a problem just a minor warning the compiler gives you in order to make sure that you know what you are doing in the code, actually looking at the "errors" i can see they are not even errors (well the first one might be but i cant remember) but are warnings which means that your code will run and compile just with some warnings in there. Now for some real talk about programming- if you want to program it's awesome! do it and i wish you the best of luck, but starting with modding is a mistake at least in my eyes- you have to jump through so many hoops and work on all kinds of workarounds it's unsuitable for a person just learning to code. IMHO the best way to start learning how to code will be to take a java/c#/python compiler, watch some crash courses on youtube on these languages and just mess around with it- find something that you are interested in, find a challenge and overcome it! Edited April 15, 2016 by Guest Link to comment Share on other sites More sharing options...
Recommended Posts