Test for existence of Bookmark

Help with writing and playing macros

Test for existence of Bookmark

Postby Corky » Tue Nov 09, 2004 8:54 am

Is it possible to check for an existing bookmark? Then if none exists, add whatever?

Currently I am bookmarking an element (used only once, if at all), if the element doesn't exist, there is a possiblity I may need to add it, but do not want to rewrite the macro. If I can test for the bookmark, it makes it much easier.

TIA!

~Corky
User avatar
Corky
Newbie
 
Posts: 2
Joined: Mon Jul 26, 2004 11:00 pm

Re: Test for existence of Bookmark

Postby Mofi » Sun Nov 21, 2004 10:31 am

It is not possible to test, if a bookmark exist.

But if you only want to test for existence of only 1 single bookmark, you can do that with a trick. You go to the end of file, execute the GotoBookMark command and if you are still at the end of the file, the bookmark does not exist. Instead of ExitMacro write what you need, if the bookmark does not exist. Here are the macro commands for this trick.

Bottom
GotoBookMark
IfEof
ExitMacro
EndIf
Top
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4042
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Test for existence of Bookmark

Postby Corky » Wed Nov 24, 2004 10:30 am

Excellent! Thanks very much :D
User avatar
Corky
Newbie
 
Posts: 2
Joined: Mon Jul 26, 2004 11:00 pm


Return to Macros