IsRequiredDateSold = requiredFields[9] == 'T', What does the 9 really mean. Index Value?

I have the following method below and I'm having a hard time understanding what does the following notation mean... The following code is reading from a table and converting it to a variable just not sure why the 9?

requiredFields[9] == 'T',  why a 9?

public static GeneralSetupProgramJobParameter GetProgramJobParameters(
            GeneralSetupProgramJobParameter item,
            string reqdfields,
            string prodparam,
            string chngparam,
            string estutilfld,
            bool defaultStatus0For2ndPrgm
            )
        {
                var requiredFields = reqdfields.ToCharArray();
                var productionDefaults = prodparam.ToCharArray();
                var changeParams = chngparam.ToCharArray();
                var estUtilFields = estutilfld.ToCharArray();

                item.DefaultToStatus0For2ndProgram = defaultStatus0For2ndPrgm;

                item.ProgramJobRequiredFields = new ProgramJobRequiredFields
                {
                    IsRequiredDateSold = requiredFields[9] == 'T',
                    IsRequiredSalesPerson = requiredFields[11] == 'T',
                    IsRequiredSource = requiredFields[10] == 'T',
                    IsRequiredSize = requiredFields[16] == 'T',
                    IsRequiredRoute = requiredFields[14] == 'T',
                    IsRequiredCancelDate = requiredFields[12] == 'T',
                    IsRequiredCancelReason = requiredFields[13] == 'T',
                    IsRequiredRejectReason = requiredFields[15] == 'T',
                    IsRequiredEstimatedBy = requiredFields[26] == 'T',
                };

                item.ProductionDefaults = new ProductionDefaults
                {
                    ProductAmounts = productionDefaults[0] == 'T',
                    StartTime = productionDefaults[1] == 'T',
                    EndTime = productionDefaults[2] == 'T',
                    WindSpeedAndDirection = productionDefaults[4] == 'T',
                    Temperature = productionDefaults[5] == 'T',
                    pH = productionDefaults[6] == 'T',
                    ConditionCodes = productionDefaults[8] == 'T',
                    Rating = productionDefaults[9] == 'T',
                    SaveAssociatedConditions = productionDefaults[7] == 'T',
                    Size = productionDefaults[10] == 'T',
                    Price = productionDefaults[11] == 'T',
                };

Open in new window

yguyon28Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yguyon28Author Commented:
Is it something that was auto generated by VS?
0
Chris StanyonWebDevCommented:
Your function recieves a string called reqdfields. That gets split into a character array and stored in a variable called requiredFields.

This line:

IsRequiredDateSold = requiredFields[9] == 'T'

sets the IsRequiredDateSold variable to either true or false, by checking whether the 10th item in the requiredFields variable is equal to the letter T.
0
Chinmay PatelChief Technical NinjaCommented:
Hi,

Yes it is the index value but the logic of using 9 or for that matter any other index value can't be determined without looking at other parts of the code , especially the input reqdfields string. I am sure it has more to do with the business logic developed by the developer rather the programming that will help you solve this puzzle. You have to debug the code or put alerts/traces to see from this reqdfields is coming and how it is being populated initially.

Regards,
Chinmay.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET MVC

From novice to tech pro — start learning today.