Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9226207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:46:27+00:00 2026-06-18T04:46:27+00:00

I have this code: if (LR.Count > 0) { for (int i = 0;

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:46:28+00:00Added an answer on June 18, 2026 at 4:46 am

    If you want to add start and then end to _fts, then try

    for (int i = 0; i < LR.Count; i++)
    {
      _fts.Add(LR[I].start);
      _fts.Add(LR[I].end);
    }
    

    If you want one entry in _fts, then you need another class to contain a start and end and redefine the _fts variable.

    public class Range
    {
        public int Start { get; set; }
        public int End { get; set; }
    }
    
    public List<Range> _fts = new List<Range>();
    
    _fts.Add(new Range {Start = LR[I].start, End = LR[I].end} );
    

    You should also use a foreach instead of if then for:

    foreach (var lr in LR)
    {
       _fts.Add(new Range {Start = lr.start, End = lr.end} );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code : String check=SELECT COUNT(*) as check FROM recordstudent WHERE STUDENT_ID=+T_STUDENT_ID+
I have this C# code. j = myAccountDataset.Tables[AccountsTables].Rows.Count; for (i = 0; i <=
I have this SQL code here.. SELECT cl.clientid, cl.clientname, cl.billingdate, cp.startdate, cp.expiration, (SELECT COUNT(*)
I have code like this: <?php if(isset($global_info_results)): ?> <?php echo count($global_info_results) ?> <span>Mali Oglasi:
I have javascript code some thing like this -- var count=3; var pl=new Array(count);
I have this error: Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.List' For the following
I encountered something that I can't understand. I have this code: cout << f1
I have this code in my program: (I included the cout statements for debugging
I have 1 compiler error. It is from this line in my code: cout
I have this code <div id=main style=background:#aaaaaa;float:left;height:160px;margin:5px;position:relative;display:block;width:630px;> <div id=1 class=item style=background:#ffaacc;float:left;width:200px;height:150px;margin:5px;position:absolute;left:0px;top:0px;> </div> <div id=2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.