× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here is a similar one I posted a few years back.

http://archive.midrange.com/midrange-l/199912/msg01406.html


Bryan


Tom Liotta said the following on 4/21/2008 9:28 PM:
Dave Odom wrote:
I thought I'd offer some REXX code for the i5(or the name de jour), one program at a time, and see what you all think. None of this code is super snazzy as I'm not a super or snazzy programmer; I just write stuff that helps me automate "tops on bottoms" tasks. Use freely but I'd like to have some line in your code that says where it came from. The following is a small EXEC that reads a file that contains various object names and submits them to a GRTOBJAUT command. The substring function is to skip the first two insignificant characters in the input file. The TRACE function is active in this program so I can watch it execute and debug. I'll submit more code with increasing complexity as time goes on. And, yep, you can probably create a better way of doing this but it was a quick and dirty.

Dave:

I recently created a REXX 'category' in the Midrange Wiki with the intent of uploading a number of examples there. I'm not happy saying that I _still_ haven't managed to take the time to upload anything.

I have a simple example that I use over and over -- a hex <-> decimal convertor. It's fronted by my XD command --

-------- Begin paste
/* CRTCMD CMD( mylib/XD) + */
/* PGM(*REXX) + */
/* SRCFILE( mylib/QCMDSRC) + */
/* SRCMBR(XD) + */
/* REXSRCFILE( mylib/QREXSRC) + */
/* REXSRCMBR(XD) + */
/* REXCMDENV(*COMMAND) + */
/* TEXT('HexDec converter') + */
/* MODE( + */
/* *ALL) + */
/* ALLOW( + */
/* *EXEC + */
/* *INTERACT) + */
/* PRDLIB( mylib ) */

CMD PROMPT('Hex-Dec converter')
-------- End paste

The REXX is not sophisticated --

-------- Begin paste
/* Hex<--> Decimal Convertor */

numeric digits 31

xd:

do forever
say 'Input a value to convert'
parse upper linein ival
if ival = 'END' | ival = 'EXIT' | ival = 'DONE' | ival = '' then leave
signal on syntax name xderr
say 'hex to dec='x2d(ival)
dx: signal on syntax name dxerr
say 'dec to hex='d2x(ival)
end

exit

xderr:
say 'Cannot convert to decimal'
signal dx

dxerr:
say 'Cannot convert to hex'
signal xd
-------- End paste

...but it does everything I want. Simple to run, simple I/O. I can call it up from just about anywhere and get back and forth conversions with ease. One problem with my example is that it's not particularly intuitive for beginners. But then, IMO, examples should prod new learners into learning rather than handing stuff over directly. <g>

If I'm lucky, _next_ weekend I'll start on my Wiki adventure...

Tom Liotta



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.