MC Press Online

Saturday, May 27th

Last updateThu, 25 May 2017 10am

You are here: Home ARTICLES Programming

Programming

C# for RPGers: Taking C# Loops for a Spin

Rafael Victoria-Pereira

The missing piece to the basic C# language puzzle will be presented here: looping structures. You already know FOR, but there’s more!

Written by Rafael Victoria-Pereira

few TechTips ago, I talked about the FOR loop and how it works in C#. It’s now time to explain the other looping structures that this amazing language has to offer. I’ll be using the exact same test task in all of the code snippets: I’ll print a simple count from 1 to 5 using a loop.

Read more ...

SQL 101: Tools of the Trade - Exploring SQuirreL’s SQL Editor

Rafael Victória-Pereira

Now that you’ve learned how to install this great tool, let’s see what it has to offer via a guided tour of its most interesting functionalities, starting with its SQL Editor.

Written by Rafael Victória-Pereira

Last time around, I explained how to install SQuirreL SQL, and most of the readers’ feedback was very positive. For those of you who tried and failed to install this tool, here’s a little tip: Before trying to install this tool, update your Java Runtime Engine (JRE) to the latest available. It’s true that SQuirreL’s documentation says that JRE 1.4 or higher is OK, but there are a lot of threads on the tool’s forums complaining about “unable to find the main class” errors. These errors seem to be related with the JRE version, so update to the latest available and try again. It’ll be worth it, as you’ll see in this TechTip!

Read more ...

Where Is RPG Going?

David Shirey

With the recent release of Technology Refresh 2 for 7.3, it seems only fair to take a moment and wonder just where RPG is going. Care to join me?

Written by Dave Shirey 

In January, Steve Will posted a blog on IBM Systems magazine about what’s coming up in the future for the IBM i. And certainly Steve would be the one to know. The post was insightful and packed with information. But it did trigger some thoughts in my mind, perhaps more about what wasn’t said than about what was.

Read more ...

TechTip: Node.js iToolkit Mods

Aaron Bartell

Walk through a real-world scenario of how Aaron Bartell approaches changes to open-source projects.

Written by Aaron Bartell

In a recent blog post, Jesse Gorzinski, Business Architect - Open Source on IBM i, focused on the "Power of Community." The community is the only way open source not only survives but thrives. There's a lot of activity in IBM i open source right now, and I hope that trend continues.

One aspect that kept me from originally participating with open source is I didn't know how to interoperate with the community and participate in changing code repositories. This article documents a real-world scenario.

Read more ...

TechTip: PHP 7.X Is Finally Here

David Shirey

PHP 7.0 is here. Hurray! For the IBM i, that is. It took a while, but now it’s a fact. Read all about it. 

Written by Dave Shirey   

Almost two years ago, I did a TechTip on PHP 7.0 and what it had to offer when it was first released by Zend. In fact, I did two of them. At that time, the word on the street was that it would be available for the i within a few months of that date (July 2015). But it took a bit longer than anyone expected. It took, in fact until just a few weeks ago. But now, finally, the latest release of PHP is available for the IBM i community to use and abuse. And, in fact, it took so long that what is now available to the i is not just PHP 7.0, but PHP 7.1.  

Read more ...

RPG Academy: Debug Done Right - Encrypting Your Debugging Views

Rafael Victoria-Pereira

Good news for RPG shops everywhere: IBM gave us a way to protect our code from prying eyes, while keeping all the functionality of the debug views! The code is there, but it’s hidden.

Written by Rafael Victoria-Pereira

As you might have guessed, anyone with access to STRDBG, the command that replaces STRISDB, will also have access to your source code! This gets especially sticky if you run a shop that designs and sells software; you need to secure your source code and can’t let your customers peek inside your programs. Fortunately, IBM included a new parameter in CRTRPGMOD and CRTBNDRPG, which allows you to encrypt your debug views. In other words, now you can ship debuggable code and know that your code is not visible to your customers.

Read more ...

Practical RPG: Converting to Free-Form RPG, Part 2

Joe Pluta

I'm not one to get rid of something that isn't broken, but I'm not sorry to see KLISTs go away.

Written by Joe Pluta

Given the limitations of columnar RPG, the KLIST was a clever way to allow a programmer to specify a variable number of fields to access a keyed file, but at a price of a lot of lines of code for even simple jobs. Thankfully, free-format RPG has given us a way to do away with those many lines of code.

Read more ...

TechTip: C# for RPGers: Making Stuff Happen, Part 2 - More Flow Control Structures

Rafael Victoria-Pereira

Last time around, I explained the IF statement. Now it’s time to get to know a couple more C# flow control structures.

Written by Rafael Victória-Pereira

If you read the previous TechTip of this series, you already know that the IF statement in C# is similar to its RPG counterpart. It’s true that there are differences, but in general they’re pretty much alike. Even though I didn’t mention it in the previous TechTip, you can create IF-ELSE-IF structures in C# just like you do in RPG. As you know, abusing this facility usually leads to a stairwell-like structure (if you’re using RPG /free and proper indentation) or a Find-The-Right-EndIf game (similar to Where’s Wally, but not so fun). To avoid these pitfalls, a sensible programmer uses a Select-When structure instead of nested IF-ELSE-IF blocks. There’s also a similar control flow structure in C#, under a different name: Switch-Case.

Read more ...