Life, the Internet, and Everything!

Cool RPG Snippets

These are great little snippets of code in RPG. I’ll post more as I find them.

No more hard-coded maximum for looping through an array. If the array size is changed in the future, you don’t have to worry about it.

for i = 1 to %elem(array);
// whatever…

Use SQL for data conversions. 

exec SQL set :text = lower(:text) or exec SQL set :text = lcase(:text)
exec SQL set :text = upper(:text) or exec SQL set :text = ucase(:text)

Leave a Reply