Jump to content


I sure do love arrays


  • Please log in to reply
8 replies to this topic

#1 JARG

JARG

    Pinky Moe

  • Members *
  • 26486 posts
  • Gender:Male
  • Location:Just east of Lyra, northwest of Pegasus...
  • Interests:Cycling, guitar playing

Posted 30 May 2019 - 04:00 PM

var cellarray = [
"SO_ID",
"SALES_DOCUMENT",
"ITEM",
.
.
.
]



function prepColorChange(obj, current_color)
{
    objid = obj.id;
    objindex = objid.slice(objid.lastIndexOf("_")+1, objid.length);
    var to_color = "lightblue";
    if(current_color == "lightblue")
    {
        to_color = "transparent"
    }
    for (var i=0; i < cellarray.length; i++)
    {
        var cell_name = "GRIDVIEW_" + cellarray[i] + "_" + objindex;
        document.getElementById(cell_name).style.backgroundColor = to_color;
    }
}

Sponsored Post

#2 custom55

custom55

    The Sphere

  • Members
  • 9687 posts
  • Gender:Not Telling
  • Location:Nutley, NJ
  • Interests:Snowboarding & Retirement.

    I have tickets for the following show(s):

    Bob Dylan - Nov 2021
    Phish - Dec 2021
    Tool - Feb 2022
    Roger Waters - Aug 2022

Posted 30 May 2019 - 10:56 PM

I was a mainframe coder for many years ( since 1977 ) and PL/1 was the sh1t for programming arrays.   Also wrote assembler and COBOL code that handled intense array processing.   Wall Street trading systems.

Some of the code I wrote in the 80s and 90s is still functioning.

I'm retired.

Edited by custom55, 30 May 2019 - 10:57 PM.


#3 HemiBeers

HemiBeers

    The God Of Balance

  • Members
  • 5754 posts
  • Gender:Male
  • Location:kalamazoo, mi
  • Interests:playfully annoying on the verge of inappropriate.

Posted 31 May 2019 - 05:40 AM

C# correct? Death by curly brackets. ;) I start to learn c# off and on but didn't have current demands at my jobs for it.

First cut my programming teeth on Cobol on a PC out of college in 84. Cobol actually wasn't too bad. Hated RPG.

I did vb6 programming at my last job I left about 7 years ago. they still used vb6 although it was 'obsolete'. I'm still seeing demand for programmers for maintaining vb6 legacy systems. If a system works well and there's no need to 'modernize', then companies will find a way to keep it running. They still run a Document Management System I wrote and posted screen shots of it on their website. I really didn't think too much of the system. An HR manager I worked with back in the 90s contacted me to see if I still had the Attendance System that he could buy from me. Um, no traces of that left and no I don't want to re-do it thanks.

Hard to kill off old code if it works and still fits the needs.

Edited by HemiBeers, 31 May 2019 - 05:45 AM.


#4 Relayer2112

Relayer2112

    Prime Mover

  • Members
  • 627 posts
  • Gender:Not Telling

Posted 31 May 2019 - 07:19 AM

It looks like javascript to me.

#5 JARG

JARG

    Pinky Moe

  • Members *
  • 26486 posts
  • Gender:Male
  • Location:Just east of Lyra, northwest of Pegasus...
  • Interests:Cycling, guitar playing

Posted 31 May 2019 - 08:39 AM

View PostHemiBeers, on 31 May 2019 - 05:40 AM, said:

C# correct? Death by curly brackets. ;)

While there is plenty of C# elsewhere on the page, that bit is javascript.

#6 JARG

JARG

    Pinky Moe

  • Members *
  • 26486 posts
  • Gender:Male
  • Location:Just east of Lyra, northwest of Pegasus...
  • Interests:Cycling, guitar playing

Posted 31 May 2019 - 08:43 AM

I have a page that displays a table around 45 columns wide. The client wanted a way to highlight the row he intended to work on, similar to clicking the row number in Excel. The array contains a list of all the column IDs in the table and clicking the first cell on the table executes the function, which iterates through the array and sets background color of each cell in the row.

#7 HemiBeers

HemiBeers

    The God Of Balance

  • Members
  • 5754 posts
  • Gender:Male
  • Location:kalamazoo, mi
  • Interests:playfully annoying on the verge of inappropriate.

Posted 31 May 2019 - 12:11 PM

View PostJARG, on 31 May 2019 - 08:43 AM, said:

I have a page that displays a table around 45 columns wide. The client wanted a way to highlight the row he intended to work on, similar to clicking the row number in Excel. The array contains a list of all the column IDs in the table and clicking the first cell on the table executes the function, which iterates through the array and sets background color of each cell in the row.
Very Cool. My current job is more support and no real programming stuff, which I'd prefer to do. Some occasional scripting but that's it. But it pays pretty good and I'm a good whore who does what they're told.

#8 grep

grep

    Solar Federalist

  • Members
  • 2265 posts
  • Gender:Male
  • Location:Charlotte, NC. Formerly from NYC.

Posted 31 May 2019 - 01:56 PM

View Postcustom55, on 30 May 2019 - 10:56 PM, said:

I was a mainframe coder for many years ( since 1977 ) and PL/1 was the sh1t for programming arrays.   Also wrote assembler and COBOL code that handled intense array processing.   Wall Street trading systems.

Some of the code I wrote in the 80s and 90s is still functioning.

I'm retired.

Not retired. However have a number of COBOL/DB2 programs doing trade settlement, funding projections, and back office reconciliation, still in production.

Taking a hint from C/C++ dynamically sized arrays, I came up with a way to do variable length tables in IBM COBOL. The syntax was butt ugly, but the code worked. ;)

I suppose I could have done the same with ODO's for arrays. Never tried.

Edited by grep, 31 May 2019 - 01:57 PM.


#9 grep

grep

    Solar Federalist

  • Members
  • 2265 posts
  • Gender:Male
  • Location:Charlotte, NC. Formerly from NYC.

Posted 31 May 2019 - 02:00 PM

View PostJARG, on 30 May 2019 - 04:00 PM, said:

var cellarray = [
"SO_ID",
"SALES_DOCUMENT",
"ITEM",
.
.
.
]



function prepColorChange(obj, current_color)
{
objid = obj.id;
objindex = objid.slice(objid.lastIndexOf("_")+1, objid.length);
var to_color = "lightblue";
if(current_color == "lightblue")
{
to_color = "transparent"
}
for (var i=0; i < cellarray.length; i++)
{
var cell_name = "GRIDVIEW_" + cellarray[i] + "_" + objindex;
document.getElementById(cell_name).style.backgroundColor = to_color;
}
}

Now do it in 2 dimensions. :)    JK, I know you know how to do that.... just an outer loop and some variable magic.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users