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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:18:51+00:00 2026-05-22T21:18:51+00:00

This function is meant to find the highest variable in a list of variables,

  • 0

This function is meant to find the highest variable in a list of variables, which have five id letters, and one number. It works fine with all the other slots, 2, 3, 4, 5, 6, 7, 8, 9, 10, but not 1. I need another set of eyes here.

The getVer function takes the number from the id; so ImpHt1 with getVer would be 1, while getShtNm gets ImpHt.

function find_max_feat(array_input,ShtNm) {
    if (String(array_input[0]).length == 1) {
        var max = 0;
    }
    else {
        var max = getVer(array_input[0]);
    }
    var maxver = 0
    var len = array_input.length;
    for (var i = 0; i < len; i++) {
        if (String(array_input[i]).length > 1) {
            if (getShtNm(String(array_input[i])) == ShtNm) {
                if (getVer(String(array_input[i])) > maxver) {
                    var max = array_input[i];
                    var maxver = getVer(String(array_input[i]));
                }
            }
        }
    }
    return max;
}

0,DmnHt1_0,AltFm1_,0,0,0,0,0,0,0

An example of the array, which is why getVer is needed.

This is for a sheet generator, to be clear, but I’ve been working on the entire thing for at least a few days now, maybe even a week or weeks of on and off work.

The array above is generated any time a feat is selected, and the find_max_feat array is used to find the highest version in a group; it operates off of an infinite loop since nothing else I did could get it to work the way I wanted it to.

function checkFeats() {
    updateFeatsel();
    t=setTimeout("checkFeats()",1000);
}

function updateFeatsel() {
    curselarray = new Array();
    var selinc = 1;
    while (selinc <= 10) {
        var selincar = selinc - 1;
        var selid = document.getElementById(String('ftlst' + selinc));
        if (getVer(selid.options[selid.selectedIndex].title)) {
                curselarray[selincar] = selid.options[selid.selectedIndex].title;
        }
        else {
            curselarray[selincar] = 0;
        }
        selinc++;
    }
    document.getElementById('debug1').innerHTML = curselarray.valueOf();
    featSelch('hlthm','ImpHt',healthom);
    featSelch('strdmgm','ImpPd',Strpdom);
    featSelch('strwhtm','ImpLi',Strwhtom);
    featSelch('strsltm','EnhIt',StrSltom);
    featSelch('endsurm','ImpEn',EndSurom);
    featSelch('endsokm','ImpDf',EndSokom);
    featSelch('intelmpm','ImpMg',Intelmom);
    featSelch('willsokm','ImpMs',Willsokom);
    featSelch('luckrllm','ImpLu',Lukrllom);
    featSelch('luckpntm','EnhLu',Lukpntom);
    featSelch('hlthbn','DmnHt',0);
    featSelch('strbn','SupSt',0);
    featSelch('luckbn','DmnLu',0);
    featSelch('endbn','Armor',0)
    document.getElementById('debug2').innerHTML = find_max_feat(curselarray,'DmnHt');
    updateAmounts();
}

function featSelch(sid,fshtnm,defval) {
    return document.getElementById(sid).innerHTML = getFeatvalue(fshtnm,defval);
}
  • 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-22T21:18:51+00:00Added an answer on May 22, 2026 at 9:18 pm

    That is because you are initialising max using getVer(array_input[0]) instead of array_input[0]. If the first item is the highest and has the version number zero, the initial value is used.

    Change this:

    var max = getVer(array_input[0]);
    

    into:

    var max = array_input[0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a c99 function that uses openmp, which works as expected. I also
What does the following mean? Class.Function(variable := 1 + 1) What is this operator
Is this function declaration in C#: void foo(string mystring) the same as this one
I need to write some function using ML, this function receives the list of
Trying to find out what the (float) in this function means: static float avgEndpoints
I have tried to find information about this but have come up empty handed:
I have the user submit a single line (description) that must have one number
I've been searching the answer but didn't find any information about this function except
i have a problem with this jquery, in the success function call, its mean
In a C++ function like this: int& getNumber(); what does the & mean? Is

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.