I have this code:
if (LR.Count > 0)
{
for (int i = 0; i < LR.Count; i++)
{
}
}
LR is a List type of class.
In this List I have 15 indexes for example in index [0] I have:
[0] = {Lightnings_Extractor.Lightnings_Region}
Now in this index[0] I have two int’s variables end 88 and start 96
In this for loop up here what I need to do is:
if (LR.Count > 0)
{
for (int i = 0; i < LR.Count; i++)
{
_fts.Add(
}
}
_fts is a List<int> what I want is to add from each index in the LR List the two numbers.
So if I’m trying to do just:
_fts.Add(LR[I]);
I’m getting two errors:
Error 31 The best overloaded method match for ‘System.Collections.Generic.List.Add(int)’ has some invalid arguments
And
Error 32 Argument 1: cannot convert from ‘Lightnings_Extractor.Lightnings_Region’ to ‘int’
How can I just get the two numbers from each index of the List LR and add this two numbers each time to the List _fts ?
If you want to add
startand thenendto_fts, then tryIf you want one entry in
_fts, then you need another class to contain astartandendand redefine the _fts variable.You should also use a
foreachinstead ofifthenfor: