Archive for category Service Programs
Format Text Date
Aug 25
| //___________________________________________________________ // TextDate(): Returns the current date, formatted as text // // For example: ‘Aug 25, 2009′ //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ p TextDate b d pi 25a d peDate d Options(*NoPass) d DatFmt(*ISO) d CurDate s d DatFmt(*ISO) d retField s 25a d MonthsDS ds /Free If %Parms > 0; CurMonth = Months(CurMM); retField = CurMonth + ‘ ‘ Return retField; /End-Free |
RPG center text Procedure
Aug 24
|
h NoMain
//___________________________
// šCenter text.
// šReturns passed in text centered within size of field
// špassed in.
// Copyright 2009
// iPort Tech www.iPortTech.com
//___________________________
//ˆRevision Log
//žDate žProgrammer žComment
/Copy cpysrc,z_Center
//___________________________
p z_Center b Export
d pi 256a
d peString 256a Const
d Varying
d peLength 5u 0 Const
d Options(*NoPass)
d StartPos s 5i 0 Inz
d wwLen s 5i 0 Inz
d retField s 256a Varying
/Free
If %Parms > 1;
wwLen = peLength;
Else;
wwLen = %Len(peString);
EndIf;
retField = wwLen;
StartPos = ((wwLen – %Len(%Trim(peString))) / 2) + 1;
%SubSt(retField :StartPos) = %Trim(peString);
Return retField;
/End-Free
p e |
Service Programs
Jun 2
When do you use a service program and when do you use a module? There is a difference in performance with each and using the correct method can save processing time for your applications. We use modules when they are called for and service programs when the application justifies it.
As always, if you have questions we’d love to help you answer them.

