home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
eeedit22.zip
/
enhanced.zip
/
SwapChar.plg
< prev
next >
Wrap
Text File
|
2001-04-15
|
820b
|
20 lines
/***********************************/
/* Swap characters on each side of */
/* the current cursor postion */
/***********************************/
/* Get selection range Target (MLE) */
PARSE VALUE VpGetIndex(window,Target) with First Last
if First=Last then do
/* Get text in range Target (MLE) */
SelectedText = VpGetItemValue(window,Target,First-1,First+1)
LastChar=right(SelectedText,1)
FirstChar=left(SelectedText,1)
SelectedText=LastChar||FirstChar
/* Select a range the Target (MLE) */
CALL VpSelect window,Target,First-1,First+1
/* Add item at current location Target (MLE) */
CALL VpAddItem window, Target, 'CURRENT', SelectedText
end
else response=VpMessageBox(window,'SwapChar Notice','Please place the cursor between the two chars you wish to swap and try again.')