home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 3
/
goldfish_volume_3.bin
/
files
/
util
/
edit
/
polyed
/
macros
/
capchar.ped
< prev
next >
Wrap
Text File
|
1995-05-20
|
2KB
|
85 lines
/*
** $VER: capchar.ped 1.0 (6.5.95) written by Stefan Schulz
**
** This file changes upper/lower case of a character
*/
OPTIONS RESULTS
OPTIONS FAILAT 11 /* ignore warnings */
SIGNAL ON SYNTAX /* ensure clean exit */
SIGNAL ON FAILURE
SIGNAL ON BREAK_C /* no label->syntax->exit */
if (LEFT(ADDRESS(), 6) ~= "POLYED") then do
if SHOW("Ports", "POLYED.1") then
address 'POLYED.1'
else do
say "PolyEd is not running!"
exit
end
end
'LOCKGUI'
/*----- begin of custom code area --------------------------------------*/
'GETCHAR' VAR 'char'
do replace=0
select
/* German "Umlaute" have to be converted by hand */
when (char = "Ä") then char = "ä"
when (char = "Ö") then char = "ö"
when (char = "Ü") then char = "ü"
when (char = "ä") then char = "Ä"
when (char = "ö") then char = "Ö"
when (char = "ü") then char = "Ü"
/* upper low-case-letters */
when (char >= "a") & (char <= "z")
then upper char
/* ARexx failed to do the arithmetic conversion of the
following capitals. God knows why... */
when (char = "J") then char = "j"
when (char = "K") then char = "k"
when (char = "L") then char = "l"
when (char = "M") then char = "m"
when (char = "N") then char = "n"
when (char = "O") then char = "o"
when (char = "Z") then char = "z"
/* lower captials */
when (char >= "A") & (char <= "Z")
then char = x2c( c2x(char) + (c2x('a') - c2x('A')) )
/* special character handling */
otherwise do
'CURSOR RIGHT'
leave replace
end
end /* select */
'TEXT' char
'DELETE'
leave replace
end /* do */
/*----- end of custom code area ----------------------------------------*/
'UNLOCKGUI' /* Clean exit */
EXIT
SYNTAX: /* ARexx error... */
say "Error line" SIGL ":" ERRORTEXT(RC) /* report it... */
'UNLOCKGUI' /* Unlock GUI! */
EXIT /* exit */
FAILURE:
'UNLOCKGUI' /* Unlock GUI! */
EXIT /* exit */