/*
* Generator : PPWIZARD version 99.289
* : FREE tool for OS/2, Windows, DOS and UNIX by Dennis Bareis (db0@anz.com)
* : http://www.labyrinth.net.au/~dbareis/ppwizard.htm
* Time : Sunday, 17 Oct 1999 2:06:48pm
* Input File : E:\DB\PROJECTS\OS2\ppwizard\REXAMPLE.X
* Output File : out\REXAMPLE.CMD
*/
if arg(1)="!CheckSyntax!" then exit(21924)
/*
* $Header: E:/DB/PVCS.IT/OS2/PPWIZARD/REXAMPLE.X_V 1.0 15 Mar 1999 17:33:38 Dennis_Bareis $
*/
/*
* $Header: E:/DB/PVCS.IT/OS2/PPWIZARD/REXAMPLE.XHV 1.2 09 Sep 1999 13:29:16 Dennis_Bareis $
*/
signal REXAMPLE_1;
AddCommasToDecimalNumber:
procedure expose Variable1 Variable2
acNoComma = strip( arg(1) )
if pos(',', acNoComma) <> 0 then
return(acNoComma)
acDotPos = pos('.', acNoComma)
if acDotPos = 0 then
acAfterDecimal = ''
else
do
if acDotPos = 1 then
return("0" || acNoComma)
acAfterDecimal = substr(acNoComma, acDotPos+1)
acNoComma = left(acNoComma, acDotPos-1)
end
acNoComma = reverse(acNoComma)
acResultWithCommas = ""
do while length(acNoComma) > 3
acResultWithCommas = acResultWithCommas || left(acNoComma, 3) || ','
acNoComma = substr(acNoComma, 4)
end
acResultWithCommas = acResultWithCommas || acNoComma
acResultWithCommas = reverse(acResultWithCommas)
if acAfterDecimal <> '' then
acResultWithCommas = acResultWithCommas || '.' || acAfterDecimal
return(acResultWithCommas)
ReplaceString:
rsString = arg(1)
rsChangeFrom = arg(2)
rsChangeTo = arg(3)
rsChangeCntVar = arg(4)
rsChangeFromLength = length(rsChangeFrom)
rsChangeToLength = length(rsChangeTo)
rsFoundPosn = pos(rsChangeFrom, rsString)
rsChangesMade = 0
do while rsFoundPosn <> 0
rsString = left(rsString, rsFoundPosn-1) || rsChangeTo || substr(rsString, rsFoundPosn+rsChangeFromLength)
rsFoundPosn = pos(rsChangeFrom, rsString, rsFoundPosn+rsChangeToLength)
rsChangesMade = rsChangesMade + 1
end
if rsChangeCntVar <> "" then
interpret rsChangeCntVar || " = rsChangesMade + " || rsChangeCntVar
return(rsString)
REXAMPLE_1:
Count = 0
String = ReplaceString('AAAA', 'A', 'B', "Count")
if Count = 0 then
say 'No Changes made'
else
say 'Count = ' || AddCommasToDecimalNumber(Count)
return(Count)