4D v16

WP DELETE BOOKMARK

Home

 
4D v16
WP DELETE BOOKMARK

WP DELETE BOOKMARK 


 

WP DELETE BOOKMARK ( wpDoc ; bkName ) 
Parameter Type   Description
wpDoc  Object in 4D Write Pro document
bkName  String in Name of bookmark to delete

The WP DELETE BOOKMARK command removes the bookmark named bkName from wpDoc.

If the bkName bookmark does not exist in wpDoc, the command does nothing.

Example  

You want to rename an existing bookmark. To do this, you need to create a new bookmark with the same range, and then delete the old one:

 C_TEXT($bookmarkOldName)
 C_TEXT($bookmarkNewName)
 C_LONGINT($p)
 C_OBJECT($wpRange)
 
 $bookmarkOldName:="MyBookmark"
 $bookmarkNewName:="MyNewBookmark"
 
 ARRAY TEXT($_bookmarks;0)
 WP GET BOOKMARKS(WParea;$_bookmarks)
 
 $p:=Find in array($_bookmarks;$bookmarkOldName)
 If($p>0)
    $wpRange:=WP Get bookmark range(WParea;$bookmarkOldName)
    WP DELETE BOOKMARK(WParea;$bookmarkOldName)
    WP CREATE BOOKMARK($wpRange;$bookmarkNewName)
 End if



See also 

WP CREATE BOOKMARK
WP Get bookmark range
WP GET BOOKMARKS

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language

This command can be run in preemptive processes

 
HISTORY 

New
Created: 4D v16

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v16)