home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rxhll.zip
/
STRING.REX
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-10-04
|
2KB
|
84 lines
/* #include <string.rex> */
MapSymbol: procedure
/**
*** This will translate the input string to the output string.
**/
parse arg string, in, out
outstring = ''
psn = pos(in, string)
do while(psn > 0)
if psn > 1 then
outstring = outstring || substr(string, 1, psn-1)
outstring = outstring || out
string = substr(string, psn+length(in))
psn = pos(in, string)
end
outstring = outstring || string
return outstring
UpperCase: procedure
/**
*** This will convert the string to uppercase
**/
parse upper arg string
return string
GetNoEcho: procedure
/**
*** This will grab keystrokes and enter them back as '*' characters
**/
Password = ''
Key = SysGetKey('NoEcho')
do while c2x(Key) <> '0D'
select
when c2x(Key) = '08' then
Password = left(Password, (length(password)-1))
otherwise
Password = Password || Key
end /* select */
Key = SysGetKey('NoEcho')
end
return Password
LowerCase: procedure
/**
*** This will return the string passed after converting it to lowercase
**/
parse arg String
String = translate(String, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
return String
FormatComma: procedure
/**
*** This will take a string (that is presumably numeric, but not verified
*** to be) and insert commas after groups of three digits
**/
arg Raw .
Formatted = ''
do while Raw \= 0
Formatted = right(Raw, 3)','Formatted
Raw = Raw % 1000
end
if Formatted = '' then
Formatted = 0
else
do
Formatted = Strip(Formatted,'Trailing',',')
Formatted = Strip(Formatted,'Leading',' ')
end
return Formatted