Friday, 4 July 2008

Getting hyperlinks right in Webfacing

If you've ever added a hyperlink to a character field in WebFacing, you may well have seen links with an underline extending beyond the actual text if the field's value doesn't take up the entire length of the field.

There are a couple of ways of addressing this - the first is obviously to change your stylesheet so that hyperlinks are denoted with something other than an underline - changing the colour or making the text bold.

The following change to the css will make your hyperlink dark blue for example...

a, a:link, a:visited {
text-decoration: none;
color: #3F73A6;
}


We don't always have the luxury of being able to style the underline away from our hyperlinks though. The customer's requirements and in-house standards might well dictate that they want the hyperlinks to be underlined.. and they don't want a mess!

Select Web Settings > HTML Overrides
Check the 'Override generated HTML' checkbox and select the 'Insert' radio button.

Select the "Before" tab and enter the following code, replacing the with the values that are pertinent to your application:

<% if (!isProtected) { %>
<a href="#" onclick="<javascriptCode>"><%=<recfmt>.getFieldValueWithTransform("<field>",QUOTED_TRANSFORM).replaceAll("( )*$", "")%>
<% } else { %>
<%=<recfmt>.getFieldValueWithTransform("<field>",rrn,QUOTED_TRANSFORM).replaceAll("( )*$","")%>
<% } %>


<javascriptCode>- Specify the javascript code that you want to be executed when the link is clicked.
<recfmt>- The record format with the field that you want to turn into a hyperlink
<field> - The field name that you want to turn into a hyperlink (bear in mind that Webfacing translates certain characters (e.g. '#') into replacement values)

In the "inside" tab, enter the value ' style="display:none" '

Thursday, 3 July 2008

Is RPG Dead?

I rejoined the RPG mailing list over at midrange.com this week to seek assistance with a problem I am having with decrypting TripleDES in RPG. I started scrolling through the group's recent messages and came across a discussion about an interesting (if recurring) question - is RPG dead? Now I'd like to have contributed into that discussion directly - but I've seen too many discussions on that list descend into handbagging and ad hominem attacks. I wanted to put my thoughts on the topic together though which persuaded me to resurrect my blog and put my thoughts down here.. hopefully I'll stick around and do something with this blog this time :)

Well, the short answer is obviously that no, it isn't dead. It continues to be supported and developed by the Toronto Lab and will probably continue to be so while there are still customers using the platform.

However, I think it's also fair to say that the very fact that the discussion occurs is symptomatic of the decline in the language. You don't get discussions in the Ruby community or the Java community about whether their language is dead. It just doesn't come up.

For those that aren't aware, RPG (or Report Program Generator) is a proprietary IBM language that only runs on the IBM System i5 (the current incarnation of the iSeries/AS400/System 3x).

RPG is therefore a niche language. It is also the first programming language that I ever learned. Its strength is its tight integration with the DB2 database and the i5/OS (OS400) operating system. However that is also one of its main weaknesses - its tight coupling of applications to the DB2 database and the operating system.

The discussion on midrange.com inevitably focussed on technical aspects of the language - its syntax, its functions - it compared procedural programming with object oriented programming... and entirely missed the point. The question about what platforms and languages that organisations will adopt is entirely a business question. Business decision makers don't generally care about language features, operation codes or floating point arithemetic. They care about the availability and cost of skilled workers, the total cost of owning and maintaining a platform... and like it or not they care what people like Gartner tell them - which is that RPG is in decline.

The future of RPG is also tied to the future of i5/OS. How many new installations of i5 systems did IBM undertake last year? How many times did they actually sell the system to a new user, rather than upgrading an existing user's box? I honestly don't know the answer to this question, but I don't think that the answer would be very many - if any. I don't know what would persuade someone to make a new investment in a System i machine.

IBM has blurred the lines between its System i and System p lines in recent years. They are all but identical now and will surely merge in the not too distant future. i5/OS will continue to be maintained as long as there are customers that make it financially viable and RPG will continue along with it as long as the members of the Toronto team remain with IBM. Bigger businesses will gradually move off of the platform whilst smaller ones remain and try to get the most out of their investment for as long as possible. As the average age of members of the i5 community continually rises and people retire, the availability and cost of the skills will push more and more businesses away from the platform - whilst the lack of future prospects in the language will prevent it from being taken up by a younger generation that already sees their chances of long-term employment in the IT industry under threat from offshore outsourcing.

RPG is a niche language now, it isn't growing, its use is declining - but it will be around for a long while yet. There are just too many lines of code in production in too many enterprises for anything else to be the case.