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 6702283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:02:11+00:00 2026-05-26T07:02:11+00:00

I have a small application with two arrays. One array is the names, one

  • 0

I have a small application with two arrays. One array is the names, one array is the scores. I have the below code in a “sort” button. There are also 6 radio buttons that sort by different ways. 5 of these buttons work, but I cannot seem to get the sort by “Region Name” working. Sometimes when I enter two rows into the arrays it works, sometimes not. I have been trying to figure this out for nearly an hour but cannot seem to figure out why it will not work. Any ideas out there?

private void btnSort_Click(object sender, EventArgs e)
        {
            int n;
            decimal temp;
            int sortCol = 0;
            string ntemp;
            bool swapFlag;


            if (rb1.Checked)
                sortCol = 0;

            if (rb2.Checked)
                sortCol = 1;

            if (rb3.Checked)
                sortCol = 2;

            if (rb4.Checked)
                sortCol = 3;

            if (rbTotal.Checked)
                sortCol = 4;

            do
            {
                swapFlag = false;
                for (n = 0; n < lastIndexUsed; n++)
                {
                    if(quarters[n,sortCol] < quarters[n+1, sortCol])
                        {

                        //column 4
                            temp = quarters[n, 4];
                            quarters[n, 4] = quarters[n + 1, 4];
                            quarters[n+1, 4] = temp; 

                        //col 3
                            temp = quarters[n, 3];
                            quarters[n, 3] = quarters[n + 1, 3];
                            quarters[n + 1, 3] = temp; 

                        //col 2

                            temp = quarters[n, 2];
                            quarters[n, 2] = quarters[n + 1, 2];
                            quarters[n + 1, 2] = temp;

                        // col 1
                            temp = quarters[n, 1];
                            quarters[n, 1] = quarters[n + 1, 1];
                            quarters[n + 1, 1] = temp;

                        //col 0
                            temp = quarters[n, 0];
                            quarters[n, 0] = quarters[n + 1, 0];
                            quarters[n + 1, 0] = temp;

                        //name

                            ntemp = Branch[n];
                            Branch[n] = Branch[n + 1];
                            Branch[n + 1] = ntemp;

                            swapFlag = true;

                        }//endif

                }//for end

            } while (swapFlag);
  • 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-05-26T07:02:11+00:00Added an answer on May 26, 2026 at 7:02 am

    A shot in the dark: You say you have six radio buttons, but you’re only checking five and assigning the sort column by that. If five of your sorts are working and one isnt, maybe that’s the button you omitted?

    It is difficult to tell if this really the problem. The names of those fields are very unclear – in your mind is it “radio button 6” or “the button to sort by region name”? Name something for what it means.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small test application that executes two threads simultaneously. One increments a
I am building a small web application. I have two divs. One is absolute
I have a small problem with UINavigationController animation between two view. My application build
I have a small application I am working on that at one point needs
Let's say I have the following dictionary in a small application. dict = {'one':
I am working on a small reporting application. I have two tables Agent Table
Hi here i developing small application. In a subclass screen i have two buttons.
I have written small C++ console application and this is source code : #include<stdio.h>
I have a small application to convert several file formats, with a main windows
I have a small application that I am building a Chat application into, so

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.