Clip for Editing Text: strikeout deletion / bold insertion

March 21, 2005 on 2:10 am | In Special Clips - for someone | No Comments

;whacked at by don at htmlfixit dot com
;from an example by hoylesp at acm dot org
;to edit stuff with three options (1a, 1b and 2)
;1.
;if highlighted text when start, then strike that
; and a.
; nothing if text box left empty
; or b.
; replace with bolded text from prompt box if entered
;2.
;if nothing selected insert added text
;see: http://htmlfixit.com/blog/index.php?p=317 for any updates

;figure out if anything is selected and jump to subroutine
^!If ^$GetCol$ = ^$GetColEnd$ insert ELSE selection_made

;we have a selection so strike it
:selection_made
^!InsertHTML ^&
;move after the selection
^!Jump Select_End

;insert the replace with text if any is given
:insert
^!Set %replacement%=^?{Replace with}
;if nothing entered in Replace jump to end
^!If ^$IsEmpty(^%replacement%)$ = 1 End
;insert in bold with spaces on each side
;if replacement text is given

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^

Bad Behavior has blocked 294 access attempts in the last 7 days.