faqts : Computers : Programming : Languages : Tse : Bookmark

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

TSE: Bookmark: Operation: Overview: Can you give overview of bookmark operations?

Jun 4th, 2005 07:43
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 04 Juny 2005 - 10:02 pm -----------------------

TSE: Bookmark: Operation: Overview: Can you give overview of bookmark 
operations?

---
---

Which information do you need to know about the bookmarks:

---

You need to know:

 1. which character is used for the bookmark

    e.g. the character 'a'

 2. on which line the cursor is on

    e.g. the cursor is on linenumber or row 200035
         (thus the 'y' position in that 'rectangular' file)

 3. on which column the cursor is on

    e.g. the cursor is on column 46 of that line
         (thus the 'x' position in that 'rectangular' file)

 4. in which filename the bookmark is located

    e.g. the filename in which it is located is 'c:\temp\ddd.s'

---

So you can put your information in the following table:

---

--- cut here: begin --------------------------------------------------

-------------------------------------------------------------
DATABASE: DATABASENAME: TEXT: EDITOR: TSE
-------------------------------------------------------------
TABLE: TABLENAME: BOOKMARK
-------------------------------------------------------------
TABLE: TYPE: ONE TO ONE
-------------------------------------------------------------
| NR  | CHARACTER  | X-POSITION | Y-POSITION | FILENAME     |
-------------------------------------------------------------
  1     a            3            155          c:\temp\ddd.s
  2     b            34           215          c:\bibtse.s
  3     c            212          644          c:\bibcpp.cpp
  ...   ...          ...          ...          ...
-------------------------------------------------------------

--- cut here: end ----------------------------------------------------

---
---

Thus operations:

---

How to possibly implement such a table?

Implement your table e.g. in a file, the lines are the row numbers,
the columns are the column numbers, the filename is the table name.
Or use global variables.

---

Operations you could use:

---

Operation: Get: bookmark

   1. Input bookmark name (e.g. 'a')

---

Operation: Search: bookmark

   1. Get bookmark name (e.g. 'a')

      1. Goto table

         1. Search for that bookmark in the 'character' column

            1. When found, return

            2. When not found error

---

Operation: Goto: bookmark

   1. Get bookmark name (e.g. 'a')

      1. Goto table

         1. Search for that bookmark in the 'character' column

            1. Get X-position for that bookmark

            2. Get Y-position for that bookmark

            3. Get filename of that bookmark

               1. Load filename

                  1. Goto X-Position

                  2. Goto Y-Position

---

Operation: Remove: bookmark

   1. Get bookmark name (e.g. 'a')

      1. Goto table

         1. Search for that bookmark in the 'character' column

            1. When found, remove that row in the table

            2. When not found error

---

Operation: Insert: New: bookmark

   1. Get bookmark name (e.g. 'a')

      1. Goto table

         1. Search for that bookmark in the 'character' column

            1. When found, message

            2. When not found

               1. Insert the character in table

               2. Insert X-position cursor

               3. Insert Y-position cursor

               4. Insert filename

---

Operation: Update: bookmark

   1. Get old bookmark name (e.g. 'a')

   1. Get new bookmark name (e.g. 'b')

      1. Goto table

         1. Search for that old bookmark in the 'character' column

            1. When found, replace old with new

               1. Replace the character in table

               2. Replace X-position cursor

               3. Replace Y-position cursor

               4. Replace filename

            2. When not found, error

---

Operation: View: bookmark

      1. Goto table

         1. For all rows in the table

            1. Show the character (e.g. 'a')

            2. Show X-position

            3. Show Y-position

            4. Show filename

---
---

Internet: see also:

---


----------------------------------------------------------------------