Jump to content

I sure do love arrays


JARG
 Share

Recommended Posts

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 + "_" + objindex;

document.getElementById(cell_name).style.backgroundColor = to_color;

}

}

  • Like 1
Link to comment
Share on other sites

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
  • Like 4
Link to comment
Share on other sites

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
  • Like 1
Link to comment
Share on other sites

C# correct? Death by curly brackets. ;)

 

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

  • Like 1
Link to comment
Share on other sites

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.
  • Like 2
Link to comment
Share on other sites

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.
  • Like 1
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 + "_" + 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.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...