|
After asking James Rich what the little bit of text under his signature
was I was told it's ROT13 encryption. Being in the middle of a project
that has me drove crazy I decided to sidetrack and write a program to do
the same. Figured I'd share the source with all.
Display file ROT13SC:
A*%%TS SD 20040709 142436 RPOWER REL-V5R2M0 5722-WDS
A*%%EC
A DSPSIZ(24 80 *DS3)
A R ROT13PM
A*%%TS SD 20040709 142436 RPOWER REL-V5R2M0 5722-WDS
A CF03
A 1 32'ROT 13 Translator'
A DSPATR(HI)
A 3 17'Enter Message To Translate To
Rot -
A 13 Encryption'
A DSPATR(HI)
A 4 22'Or Enter Encrypted Message To
Decr-
A ypt'
A DSPATR(HI)
A INPUT 240A B 5 1
A 10 37'Results'
A DSPATR(HI)
A OUTPUT 240A O 11 1DSPATR(UL)
A 23 3'F3=Exit'
A COLOR(BLU)
RPGLE Program ROT13:
?
*---------------------------------------------------------------------
?* Program Name: ROT13
?* Written By : Ron Power
?* Date Written: July 9, 2004
?* Purpose : Translate phrase using ROT13 encryption
?
*---------------------------------------------------------------------
?* Program Information
?* -------------------
?* Indicators Used
?* -------------------
?* XX - XXXXXXXXXXXXXXXXXXXX
?* KC - F3 - Exit Program
?* 26 - Used in lookup opcode
?
*---------------------------------------------------------------------
h Dftname(Rot13) Datedit(*Ymd) Option(*SrcStmt : *NoDebugIO)
?*-Define
Files------------------------------------------------------------------
* Display file
fRot13sc cf e workstn
?*-Define tables and
arrays------------------------------------------------------
d tabin s 1 dim(26) ctdata perrcd(1) ascend
d tabout s 1 dim(26) alt(tabin)
?* Input field parsing array
d Input_Array s 1 dim(240)
?* Output field parsing array
d Output_Array s 1 dim(240)
?*-Define stand alone
fields-----------------------------------------------------
d x s 3 0
d Char s 1
?*-Mainline
processing-----------------------------------------------------------
c DoU *Inkc
c Exfmt Rot13pm
?* F3 pressed terminate program
c If *Inkc
c Eval *Inlr = *On
c Return
c EndIf
c Movea Input Input_Array
?* Translate entered message using ROT13
c Do 240 x
c Eval Char = Input_Array(x)
c Char Lookup Tabin Tabout
26
c If *In26
c Eval Output_Array(x) = Tabout
c Else
c Eval Output_Array(x) = Input_Array(x)
c EndIf
c EndDo
c Movea Output_Array Output
c EndDo
**
AN
BO
CP
DQ
ER
FS
GT
HU
IV
JW
KX
LY
MZ
NA
OB
PC
QD
RE
SF
TG
UH
VI
WJ
XK
YL
ZM
------------------------------------------------------------------------------------------------------------------------------------
Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
Tel: 709-576-8132
Email: rpower@xxxxxxxxxx
Website: http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. -
Sir Winston Churchill
This OutBound email has been scanned for Viruses
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.