tlaMarkFree
Free Global/Local/All Marks in Buffer/Line/Range

CodeWright® - API Macro - Royalty Free - 2005.01.01 17:15
Send Comments

Purpose

Free Global/Local/All Marks in Buffer/Line/Range.

Operation

This function deletes marks (bookmarks) from the current buffer, current line, or range of selected lines.

Buffer

Delete all the marks of a certain type in the current buffer. You can choose to delete just the local marks, just the global marks, or both the local and global marks. To operate, set the cursor anywhere in the buffer of interest and issue the appropriate tlaMarkFree( "buffer" ) request.

Line

Delete all the marks of a certain type on the current line. You can choose to delete just the local marks, just the global marks, or both the local and global marks. To operate, set the cursor anywhere on the line of interest and issue the appropriate tlaMarkFree( "line" ) request.

Range

Delete all the marks of a certain type in the current selection. You can choose to delete just the local marks, just the global marks, or both the local and global marks. To operate, select a range of lines (single line, range of lines using line select, or range of lines using column select) and issue the appropriate tlaMarkFree( "range" ) request.

The ideal use for this function is to assign each of its three subsections to the Bookmark pop-up menu.

Example

tlaMarkFree( "buffer", "all" )
tlaMarkFree( "buffer", "global" )
tlaMarkFree( "buffer", "local" )
tlaMarkFree( "line", "all" )
tlaMarkFree( "line", "global" )
tlaMarkFree( "line", "local" )
tlaMarkFree( "range", "all" )
tlaMarkFree( "range", "global" )
tlaMarkFree( "range", "local" )

We recommend that you add three entries at the fourth location of the bookmarks pop-up menu. This results in:

Menu Item Text Execute Function
Set Global Mark DropBookmark MARK_GLOBAL -1
Set Local Mark DropBookmark MARK_LOCAL -1
Define Mark Location... (DlgMarkSetMark(0,__BookmarkID__))
Delete All Marks in BUFFER tlaMarkFree( "buffer", "all" )
Delete All Marks in LINE tlaMarkFree( "line", "all" )
Delete All Marks in RANGE tlaMarkFree( "range", "all" )

Input Parameters

Parm Name Code Meaning
1 Function "buffer" Delete marks in Current Buffer
"line" Delete marks in Current Line
"range" Delete marks in Selection Range
2 Type "all" Delete all LOCAL and GLOBAL marks
"global" Delete all GLOBAL marks
"local" Delete all LOCAL marks

Return Codes

Code Message
global + local tlaMarkFree: global global and local local marks deleted.
-1 tlaMarkFree: function not "buffer", "line", or "range".
-1 tlaMarkFree: request not "all", "global", or "local".
-1 tlaMarkFree: no selection marked.

Reference

This function calls tlaError.

Compatibility

Current version verified under:

  • CodeWright 7.0b
  • CodeWright 7.0c
  • CodeWright 7.5.1
  • CodeWright 7.5.2
  • CodeWright for .NET 7.0

CodeWright for .NET Restriction

If the cursor is on the line containg a mark that mark, taht mark will not be deleted under CodeWright for .NET. The workaround is to simply not leave the cursor on a line containg a mark befor issuing this function call.

Installation

There are three primary methods for installing this macro on your system. Method A uses the tlaMDE tool available for purchase from this website. Method B manipulates the macro repository directly. Method C uses the API Macro... tool provided in every copy of CodeWright (but not CodeWright for .NET).

Method A - tlaMDE - CodeWright or CodeWright for .NET

  • Select the Code button on this page.
  • When the second window opens, select all the text in the text box.
  • Issue Ctl-C (copy).
  • Create a new file in CodeWright or CodeWright for .NET.
  • Issue Ctl-V (paste).
  • Issue tlaMDE C (save and compile).

Method B - Copy to Repository - CodeWright or CodeWright for .NET

  • Select the Code button on this page.
  • When the second window opens, select all the text in the text box for a macro.
  • Issue Ctl-C (copy).
  • Load the macro repository "cwright.mac" from your CodeWright or CodeWright for .NET root:
  • issue Ctl-End to go to the end of file.
  • Issue Ctl-V (paste).
  • Close the file and respond yes to the write request.

Method C - API Macro ... - CodeWright Only

  • Select the Code button on this page.
  • When the second window opens, select text from the text box for a macro:
    • Do not select the [API Macro ... header line.
    • Select all other lines in the macro.
  • Issue Ctl-C (copy).
  • Open the CodeWright Tools | API Macros... dialog.
  • Press the New button.
  • Select the Edit box.
  • Issue Ctl-V (paste).
  • Double-click on the function name in the header of the macro.
  • Issue Ctl-C (copy).
  • Select the Name box.
  • Issue Ctl-V (paste).
  • Delete the trailing blank from the name.
  • Select the Save button.
  • Select the Close button.
  • Repeat this process for each macro in the text box.

Purchase

tlaTools is a Dynamic Link Library that contains most of the API macros on this website in a single easy to install package. The tlaTools DLL can be purchased by selecting the Buy button on this page.

tlaMarkFree is included as a function in tlaTools.

Copyright © 1993-2005 Thom Little Associates, Ltd. revised 2005.01.01 17:15
One Central Square, Keene, NH 03431-3787 phone 603-357-7567