THE WELCH COMPANY
440 Davis Court #1602
San Francisco, CA 94111-2496
415 781 5700
rodwelch@pacbell.net


S U M M A R Y


DIARY: March 3, 2005 03:14 PM Thursday; Rod Welch

SDS search organic subject structure improves Context Management.

1...Summary/Objective
2...Context Management Search Sorted Indexes for Words Phrases
3...Moore's Law Reflects 20:1 Increase Speed Finding Relevant Subjects
4...Demand for Good Management Explodes When Reduced to 1 Second
5...Moore's Law Productivity Follows Computer Speed with Right Design
........F4 F4 Execute Specification Directly in Subject Index
6...User Application Ergonomic Weakness of New System
7...Search Words Phrases in Sorted Indexes with Virtual Memory
8...Markcur 41 Search Change Configure for Execution with Enter
9...000002 Macro 65 Open Search Change Assign Markcur 41 for Enter
10...F1 F4 Open Search Change Mackcur 41 for General Execution with Enter
11...Enter Execute Search Change Reduce Using Ctrl F6 Shift F4
12...Search Words Phrases Sorted Indexes F4 Opens Search Shell Qsc F4
13...F4 Assigned Search Shell When Called from SI to Check Double Click
14...Shift F4 Macro 422 Markcur 41 Identify Current File for Search Change
15...Enter Execute Search Change from within Specification Window
16...000002 Macro 65 Search Change Setup Called by F1 F4 and Only F4 in SI
17...000002 Macro 651 Enter Executes Search Change Specification in Qsc
18...Shift F4 Change Op Avoid Jumping Screen
19...Macro 42 Avoid Jumping Screen for Change Op Shift F4
20...000001 Macro 42 Change Improve Avoid Jumping Screen
21...Change Function Macro 42 Avoid Jumping Screen Shift F4
22...000001 Macro 42 Search Subject Index Execute
23...Subject Index Add Special Handling for Search and Change Macro 42
24...Search Subject Indexes Sort Automatically Every Pass
25...Sort Subject Index Every Pass for a Search for Search Macro 42
26...Macro 42 Search Sorted Subject Index Called with Enter and Shift F4
....03501 Search Subject Index Binary Design Increases Speed
....Binary Search Sorted Index Reduce Time from 20 to 1 Second
....Speed Increased Time Reduced from 20 to 1 Second Binary Search
....Sort Index for Binary Search to Find Subject Words and Phrases
....Case Sensitive Set 1st Char All Words Capital
....Capitalize 1st Char Search Specification for Case Sensitive
....Search Specification Capture in Qsc Shell to Compare Zonereps
....Zone Search from Subject Description Offset Transferred into 03501
....Configure Zone and Zonereps Binary Search Argument Word or Phrase
....Bray Professional Paper Explains Binary Searching
....Control Parameters Binary Search Loop Total Number of Records
...................On the Goodness of Binary Search
............Last Line Binary Search Fails Needs Special Handlling
............Top of Multi-match List Search with Special Binary Code
....Binary Search Loop Words and Phrases Get with Sorted Subject Index
....03501 Binary Search Loop for Specified Subject Description
....Search Fails When Binary End Limits Converge Using Get Command
....Search Succeeds When Repscnt Finds Matching String Use Get Command
....Get Command Sorted Index with Total Number of Records Drives Search
....Search Successful Construct 1 Database Segment
....Top or Bottom of List Search with Qsc and Position Cursor on Target
27...03501 New Account Format Position Cursor on Date for Editing
28...03501 Profile Function Assignments in Sorted Index
29...F4 Search Menu Open Directly in Subject Index Call Macro 65
30...Macro 65 Search Menu Open Directly in Subject Index Call F4
31...Mouse Generic Double Click Utility Macro 235
32...Search Automatically Load and Execute Search Shell with F4 F4
33...F4 F4 Twice Load Execute Search Shell and Execute in Subject Index
....Enter Execute Sort Search Op When 1st Char Description Lower Case
....Macro 232 Set Flag Enter in SI to Execute Sort Search on Lower Case
....F4 F4 2 Clicks Execute Search Subject Index
....2.Clicks F4 Search Capture String Execute Immediately
....Search 2 Clicks F4 Execute Immediately Using SI String
34...Expand Capacity Organic Structure Add 30 Levels F1 F2
35...F1 F2 Increase Levels Segmented Idexes Add Capacity Organic Structure
36...F1 F3 Add 30 Levels Increase Capacity for Segmented Indexes
37...Menu Switch Sort in Front of Print to Save Keystrokes in Subject Index
38...Sort Menu in Subject Index Moved Ahead of Print
39...17 Lines Modify Virtual Memory for Faster Word Search Macro 42
40...F9 Scroll Up to Move Down in Sorted Index Code Improved for Speed
41...Virtual Memory Increased Speed Scrolling Up and Down for Search Op
42...Scroll Up Opposite Code from Scrolling Down


..............
Click here to comment!

CONTACTS 

SUBJECTS
Flexible Structure Enables New Way Working Thinking Through Writing
Precision Access Subjects Find Words Phrases Categories Classificati
Subjects Finding Information Requires Effective Organic Structure
Multiple Paths Required for Subjects Record Segments Cross-reference
03501 Subject Index Solve Memory Problem for Sorted Indexes Segment
Segment Sorted Subject Index into Smaller Indexes Chained Together t
Word Phrase Search Manage Complexity of Knowledge Subject Index Impr

2309 -
2309 -    ..
2310 - Summary/Objective
2311 -
231101 - Follow up ref SDS 23 7K6I, ref SDS 12 0000.
231102 -
231103 - Context management is enhanced with a new function to find words and
231104 - phrases in the Subject Index. ref SDS 0 FX7K  Precison access finding
231105 - subjects in the organic structure of context saves time creating
231106 - dynamic links.  This significantly improves navigating Knowledge Space
231107 - to find critical details in time to perform daily work accurately.
231108 - ref SDS 0 3P30  Keystrokes are reduced simplifying execution, and
231109 - commands run much faster to save time for intelligence support based
231110 - on situational awareness. ref SDS 0 YB6M  The search design was
231111 - refined several times.  The first effort improved scrolling through
231112 - virtual memory, ref SDS 0 5F8K, and led to streamlining the code for
231113 - double click tasks. ref SDS 0 LV3O  The final design applied binary
231114 - search methods that reduce the time to find subjects in the organic
231115 - structure of knowledge to about 1 second. ref SDS 0 QF56  This opens a
231116 - new dimension of Context Management which formerly was not available.
231117 - The Change function executed by Shift F4 was improved to maintain
231118 - context and orientation. ref SDS 0 S086  The number of accounts
231119 - processed in the Subject Index was more than doubled to accomodate
231120 - growth of organic structures using new tools. ref SDS 0 8P5M  The Sort
231121 - option was shifted on the menu bar for faster execution in the Subject
231122 - Index. ref SDS 0 VT4N
231123 -
231124 -     [On 050311 notified Gary about SDS improvement implementing his
231125 -     request to search for words and phrases in Subject Index.
231126 -     ref SDS 30 HN7M
231128 -      ..
231129 -     [On 050316 submitted SDS update to Gary with binary search
231130 -     feature. ref SDS 32 HN7M
231131 -
231132 -
231133 -
231134 -
231135 -
231137 -  ..
2312 -
2313 -
2314 - Evaluation
2315 -
231501 - Context Management Search Sorted Indexes for Words Phrases
231502 - Moore's Law Reflects 20:1 Increase Speed Finding Relevant Subjects
231503 -
231504 - Follow up ref SDS 29 S56F, ref SDS 23 YI6O.
231505 -
231506 - Precision access for Intelligence support, listed in NWO. ref OF 9
231507 - PX6J, makes Context Management faster and easier for finding
231508 - information based on situational awareness, called out in POIMS.
231509 - ref OF 8 KH8J  Initial use shows less time and effort is needed for
231510 - dynamic linking that "connects the dots" to augment intelligence so
231511 - that everything is in the right place at the right time using a common
231512 - storage model for Knowledge Space, also specified in POIMS.
231513 - ref OF 8 1232
231515 -  ..
231516 - Testing indicates the new system is fast and robust (see ergonomic
231517 - issue, ref SDS 0 5Z7O, which was partially solved. ref SDS 0 EG4N)
231518 - For example, looking through an index of 4000 records is reduced from
231519 - 20 to just 1 second. (see further analysis. ref SDS 0 3P5F)  A
231520 - professional paper on binary searches indicates a dilemma.  Subtle
231521 - problems in the code can give a false positive that the design is
231522 - accurate.  Gary Johnson suggested testing.  Morris also pointed out
231523 - problems of rounding errors in the binary search algorithm.  After the
231524 - code was modified to address this issue, tests seem to have passed,
231525 - per below. ref SDS 0 EE8F
231527 -  ..
231528 - 20:1 improvement in precision access is another step showing better
231529 - productivity under Moore's Law that advances transformation from
231530 - information technology (IT) to a culture of knowledge, reviewed on
231531 - 040305. ref SDS 22 JT5F
231532 -
231533 -        [On 070511 automated constructing subjects in Subject Index,
231534 -        maintaining the index, and making assignments, saving about 5
231535 -        hours work on creating an SDS record. ref SDS 37 DA8J
231536 -
231538 -  ..
231539 - Demand for Good Management Explodes When Reduced to 1 Second
231540 - Moore's Law Productivity Follows Computer Speed with Right Design
231541 -
231542 - Experience over the ensuing weeks supports the "Boy Scout napsack"
231543 - theory of innovation and marketing where reducing the time to perform
231544 - tasks increases demand, reported on 990816. ref SDS 3 2880  Analysis
231545 - on 040305 applied Moore's Law to productivity, where reducing effort
231546 - to a matter mere of volition based on situational awareness transforms
231547 - customers from denial, and transforms tasks and tools from "gold
231548 - plated" and "unnecessary overkill" into indispensible intelligence.
231549 - ref SDS 22 BS5O
231550 -
231551 -     [On 050218 added cognitive overhead to NWO to supplement
231552 -     explanation of clear, concise, complete communication using
231553 -     Communication Metrics that saves lives, time, and money under
231554 -     Moore's Law. ref SDS 28 PPSQ
231556 -      ..
231557 -     [On 050618 reduced keystrokes and cognitive overhead to capture
231558 -     and enter replication with F3. ref SDS 34 5I7M
231560 -      ..
231561 -     [On 060222 general replication reduces cognitive overhead to
231562 -     enable good management under Moore's Law. ref SDS 35 EF3N
231564 -  ..
231565 - Reducing tasks that take 4 hours down to just 2 hours improves
231566 - productivity, but customers deny this is needed, because they don't
231567 - want to spend 2 hours on a task, even though it may save 4 hours,
231568 - days, weeks, months or years doing rework.  People feel they expedite
231569 - to save time by not investing time for accuracy to prevent mistakes,
231570 - in the hope that other people will spend time fixing mistakes, when
231571 - future problems arise, and in the meantime they can go home today 2
231572 - hours early by not using good management.  This explains why there are
231573 - no requirements and no demand for accuracy reported on 041004,
231574 - ref SDS 24 W86F, and later on 041118. ref SDS 27 KU85  Previously, on
231575 - on 000307 research at SRI found that Knowledge Management is a lot of
231576 - hard work. ref SDS 4 767G  Later, on 020217 Gary Johnson worried that
231577 - people who will not work hard using tools they have to improve
231578 - accuracy, will not become customers for SDS that makes working
231579 - accurately fast and easy. ref SDS 13 425M  He discussed this again on
231580 - 041110. ref SDS 26 FO3H  Jack Park reported a solution implemented
231581 - today.  On 010908 Jack explained laziness prevents people from using
231582 - good management. ref SDS 9 0001
231584 -  ..
231585 - Reducing tasks to 1 hour, 30 minutes, 15, 7, 3, even to 1 minute in
231586 - many cases yields the same lack of market response to productivity
231587 - gains.  Rather than adopt good management, customers accept short cuts
231588 - by doing nothing, because that takes zero time and effort in the
231589 - moment, while time, money, and lives lost are deferred under reasoning
231590 - on 040305. ref SDS 22 T56G  This attitude accounts for the record on
231591 - 020820 reporting that experts who call for linking in email, create
231592 - tools to link email, and then don't use the tools to put links in
231593 - email, and instead suddenly announce that putting links in email is
231594 - unnecessary overkill, ref SDS 15 O1QQ, and based on prior case study
231595 - on 020812. ref SDS 14 659F
231597 -  ..
231598 - Reducing time of performance to just 1 second, however, swings some
231599 - customers from denial to demand when accuracy takes less time than
231600 - using short cuts.  This addresses concerns that there is no demand for
231601 - SDS support, because nobody cares about good management, because
231602 - nobody is using good management, reviewed on 041118, ref SDS 27 KU85,
231603 - discussed earlier by Gary on 041110, ref SDS 26 KM7W, and reflecting
231604 - Gary's concern on 020217. ref SDS 13 425M  Similar dispair was voiced
231605 - on 011006. ref SDS 11 MO6F
231607 -  ..
231608 - Increasing speed and accuracy aligns with criteria for productivity in
231609 - the record for 031124, ref SDS 21 QO8H, and implements in part Gary's
231610 - recommendations on 041108. ref SDS 25 XZ9J  On 010425 Morris described
231611 - self-evident benefits where everything in SDS is the right place at
231612 - the right time. ref SDS 8 EP7F  On 960406 he reported precision access
231613 - is difficult to accomplish. ref SDS 1 4249  On 010411 Jack Park noted
231614 - SDS enables people to remember "everything little thing." ref SDS 7
231615 - X34F Later on 010916 Eric Armstrong cited amazing mechanisms that
231616 - obviously work for finding critical details. ref SDS 10 0001
231618 -  ..
231619 - Context Management has been significantly improved the past several
231620 - years, listed on 031114. ref SDS 20 6S9L  Work today applying the get
231621 - command created by Morris on 031113 to support binary search, per
231622 - below, ref SDS 0 5F7M, extends major improvements that make SDS
231623 - unique, reported on 000824. ref SDS 5 VI5H
231625 -  ..
231626 - Increasing capacity 250% for the number of index levels that can be
231627 - managed meets experience applying SDS the past few years. ref SDS 0
231628 - 8P5M
231630 -  ..
231631 - F4 opens the Search window in the Subject Index to enter a
231632 - specification for finding an account. ref SDS 0 L53M  User enters a
231633 - word or phrase and presses Enter, per change today assigning Enter for
231634 - S&C. ref SDS 0 PF6H
231635 -
231637 -         ..
231638 -        F4 F4 Execute Specification Directly in Subject Index
231639 -
231640 -        Alternatively, user can enter a specification directly in the
231641 -        Subject Index in the description field, say.....
231642 -
231643 -          ...890313ce......... Organizational Memory [F4 F4]
231644 -
231645 -        ...and press F4 twice, as shown, like a double click; the code
231646 -        will capture the specification and enter it into the Search
231647 -        shell, and then execute the search. ref SDS 0 5K5O
231649 -         ..
231650 -        This is particularly handy for finding other instances of a
231651 -        current subject simply pressing F4 twice on a word or phrase.
231653 -         ..
231654 -        Executing a phrase in the Subject Index is accomplished by
231655 -        placing the cursor near or at the last word in the phrase, and
231656 -        pressing F4 twice. ref SDS 0 NX7I
231658 -  ..
231659 - Enter was added today for executing Search and Change in all SDS
231660 - systems, e.g., SI, editor, Contacts, Records.  After entering a spec
231661 - in the Search shell, simply press Enter. ref SDS 0 NA5H   The original
231662 - application using Shift F4 complements Enter in a powerful way.
231663 - ref SDS 0 Y55F
231665 -  ..
231666 - In the Subject Index, the code now calculates the zone for precision
231667 - search on primary keys, checks and enters an ending delimiter, if
231668 - needed, and checks whether the current index is sorted.  If not, a
231669 - sort is executed, so that all searches in the Subject Index are
231670 - performed in sort mode, essential for binary searching. (see
231671 - research,
231673 -  ..
231674 - Search and Change executed with Enter focuses span of attention on
231675 - situational awareness for objectives, rather than allocating time to
231676 - mechanics of execution.  Reducing divided attention saves time,
231677 - energy, and reduces mistakes.  Getting things done faster with fewer
231678 - mistakes increases productivity.
231680 -  ..
231681 - Previsously, the User had to...
231682 -
231683 -        1.  Press F1 F4 to open a search window.
231684 -
231685 -            This remains except in the Subject Index, F4 opens the
231686 -            search window, because F4 is not needed to copy lines in a
231687 -            subject index. ref SDS 0 L53M
231689 -             ..
231690 -        2.  Set the zone.
231692 -             ..
231693 -        3.  Enter a specification and delimiter.
231695 -             ..
231696 -        4.  Ctrl F6 switch back to the target file.
231698 -             ..
231699 -        5.  Sort the index by opening the menu and click on sort.
231701 -             ..
231702 -        6.  Shift F4 executes the search.
231704 -  ..
231705 - Approximately 15 keystrokes are eliminated with the new design.
231707 -  ..
231708 - Moreover, even with all these steps, searching sorted indexes was
231709 - previously not possible, and searching segmented indexes was not
231710 - useful, because searching did not span indexes.  As a result, until
231711 - now, searching by entering a specification for words and phrases was
231712 - not an effective part of Context Management.  Standard practice used
231713 - F9 and F10 to scroll through a sorted index to find a subject.  This
231714 - took about 20 seconds in a large index of say 4000 lines, and another
231715 - 5 to 10 seconds was needed for the eyes to select a relevant account,
231716 - or 30 seconds overall.  For smaller indexes, maximum time was perhaps
231717 - 10 seconds, making an average of 20 seconds.
231719 -  ..
231720 - Initial code changes today reduced the time finding an account to
231721 - about 10 seconds.  When manually scrolling an index, the user observes
231722 - progress, as lines scroll by on the screen.  The design of the first
231723 - new search function made scrolling transparent.  The user saw nothing
231724 - happening.  This makes 10 seconds seem like an eternity, watching the
231725 - same screen without any signs of activity.  Since this is the same
231726 - condition when the system fails and has to be powered down, and
231727 - started again, the new design tends to induce various degrees of
231728 - trauma.  Thus, merely reducing search time from 20 to 10 seconds while
231729 - significant, remained ergonomically problematic.
231731 -  ..
231732 - Four design changes solved this problem by reducing search time to 1
231733 - second, both increasing productivity and avoiding anxiety...
231735 -         ..
231736 -    1.  1st design made scrolling more efficient by modifying macro
231737 -        file 03501, reducing the time from 20 to 10 seconds.  This work
231738 -        streamline existing code for scrolling, which will provide
231739 -        continuing benefits, and, also, added scrolled 17 lines each
231740 -        pass rather than 10. ref SDS 0 5F8K
231742 -         ..
231743 -    2.  2nd design applied 1st design scrolling improvements to further
231744 -        reduce the time searching the SI from 10 to about 5 seconds.
231745 -        This design calculated whether to search up or down, reducing
231746 -        the distance to a target line that is half way through the
231747 -        index by 50%.  This method used the standard macro 42 to
231748 -        perform sequential searches on 17 records each pass, executed
231749 -        by macro 65, Shift F4, and later Enter was added for launching
231750 -        a search from within the qsc Search and Change shell.
231751 -        ref SDS 0 NA5H
231753 -         ..
231754 -    3.  3rd design scrapped the first two designs by eliminating
231755 -        repetitive construction of file segments and searching all of
231756 -        the lines sequentially.  Instead, since the record is sorted,
231757 -        and the total record length is derived from the sort, a binary
231758 -        search method the get command examines only a few lines by
231759 -        recursively calculating half of the remaining records until the
231760 -        target line in the search specification is located, or all of
231761 -        the lines have been examined. ref SDS 0 TC6Q  A sequential
231762 -        search developed for the 2nd design then scrolls through the
231763 -        database sequentially to find the actual target line.  While
231764 -        there is some duplication scrolling up and down the database,
231765 -        this design reduced maximum search from 5 seconds to about 3
231766 -        seconds.  The design seemed awkward, and so was further
231767 -        refined.
231769 -         ..
231770 -    4.  4th and final design applied zonereps and repscnt with binary
231771 -        search methods developed in the 3rd design to find the top of a
231772 -        sublist that matches the search specification. ref SDS 0 TC6Q
231773 -        At this point a single page is construced containing the target
231774 -        of the search. ref SDS 0 SQ5H  Searches take about 1 second
231775 -        using 5 - 20 disk reads, rather 3000 - 4000+  The code is about
231776 -        20% of the lines created for the 1st design. ref SDS 0 QF3Y
231778 -         ..
231779 -        These improvements reflect processing speed for binary search
231780 -        methods, reviewed below. ref SDS 0 V46I  Finding things in one
231781 -        second supports POIMS requirements for augmenting intelligence
231782 -        to execute daily work based on situational awareness as a
231783 -        matter of volition, ref OF 8 KH8J, and shows that the power of
231784 -        binary processing, cited in POIMS, ref OF 17 8774, reflects the
231785 -        magical number 7, reviewed on 990303. ref SDS 2 6177
231787 -  ..
231788 - Faster searching reduces the burden on span of attention by avoiding
231789 - the problem of finding a needle in a haystack.  Searching can be
231790 - initiated from anywhere in an index.
231792 -  ..
231793 - Search only occurrs within an account level to maintain context.
231794 -
231795 -
231796 -
231797 -
231798 -
231799 -
231800 -
2319 -

SUBJECTS
Enter Conflict F4 Ergonomic Keyboard Problem in SI User Application

2903 -
290401 -  ..
290402 - User Application Ergonomic Weakness of New System
290403 -
290404 - Changes today significantly streamline execution of commands, which
290405 - aids productivity, per above. ref SDS 0 YB6M  Bill Gates noted that
290406 - integrating commands to reduce the burden navigating menus is a goal
290407 - at Microsoft for improving productivity, reported on 021108.
290408 - ref SDS 16 EFBE
290410 -  ..
290411 - Searching can be accomplished in the Subject Index as follows...
290412 -
290413 -        1.  Press F4 twice on any word or phrase.
290414 -
290415 -        2.  Press F4 to open a search shell, enter the string, and
290416 -            press Enter or press F4
290418 -             ..
290419 -        3.  Type a subject using all lower case in the description
290420 -            field of the Subject Index and press F4 F4. ref SDS 0 5K5O
290421 -
290423 -  ..
290424 - This can cause a problem when the user mistakenly...
290425 -
290426 -        1.  Presses Enter in the Subject Index to execute a search,
290427 -            instead of pressing F4 F4.
290428 -
290429 -        2.  Type a word or phrase and press Enter, instead of F4 F4.
290431 -  ..
290432 - In a momentary mental lapse, the user attempts to execute a search
290433 - from within the Subject Index using Enter, which is designed to load a
290434 - subject account into a Control Field.  Under the 1st scenario there is
290435 - no great harm, because the system merely attempts to enter the current
290436 - subject account into the Control Field where the SI was entered.  User
290437 - will recognize this is not what was intended, and will open the SI and
290438 - use the correct procedure with F4 in the SI.
290440 -  ..
290441 - The 2nd scenario, however, causes significant harm.  When the user
290442 - types in a word or phrase for performing a search and presses Enter,
290443 - the system initially saves this change, and then attempts to enter the
290444 - account into the Control Field.  Even if the user recognizes an error
290445 - has occurred and enters the SI, it may be difficult to return to the
290446 - exact place where the search was attempted, and if that locacation can
290447 - be recovered, it may still be difficult to remember how to repair the
290448 - changed description.
290450 -  ..
290451 - This situation needs experience and analysis to balance speed and
290452 - danger.
290453 -
290454 -        [...see below made some accomodation for pressing Enter
290455 -        accidentally. ref SDS 0 T19O
290457 -         ..
290458 -        [On 050522 correction reported today was actually performed,
290459 -        that enables Enter to execute most search specification, since
290460 -        they recognizable from starting with a lower case letter.
290461 -        ref SDS 33 1F9I
290463 -  ..
290464 - Actually, reduced the frequency of this problem by allowing Enter to
290465 - execute a search specification when the first character of a subject
290466 - account description is a lower case, since this indicates user
290467 - activity to create a search specification, rather than to load an
290468 - account to an SDS record Control Field, or to navigate to the next
290469 - level in the index, both of which save the index, which otherwise
290470 - would corrupt the subject description. ref SDS 0 T19O  This does not
290471 - completely eliminate the problem, but should greatly reduce the
290472 - frequency.  There remains a concern about causing bad habits to form
290473 - using Enter, discussed below. ref SDS 0 PS7L
290474 -
290475 -
290476 -
290477 -
290478 -
290479 -
2905 -

SUBJECTS
Planning Subject Find Code for a Particular Narrative Description, 0
Subject Find Code for a Particular Narrative Description, 011125, 03
F04 Search and Change
Enter Execute Search Change from within Specification Window Macro 6

3306 -
3307 - Planning
330801 -  ..
330802 - Search Words Phrases in Sorted Indexes with Virtual Memory
330803 -
330804 - Follow up ref SDS 23 7K6I.
330805 -
330806 - Sorted indexes contain only about 20 lines, when the entire index may
330807 - contain 4K - 5K lines.  Need to create a switch for the search
330808 - routine to read from the file t11 on the disk to look for a line with
330809 - a primary key entered by the user in a search specification.
330811 -  ..
330812 - Flag for sorted accounts is 123 = 666. ref OF 1 PU5K
330814 -  ..
330815 - Searching will occur only in sorted indexes.  Actual accounts can be
330816 - immediately accessed for editing and adding multiple views using F1
330817 - F3, or F1 F2 to open another level.
330819 -  ..
330820 - Search in the Subject Index is currently accessible only from the
330821 - menu, which is slow and awkward for routine use, noted by Bill Gates
330822 - on 021108. ref SDS 16 EFBE  This was acceptable when assignment to the
330823 - menu was made on 040307, because at that time searching in the Subject
330824 - Index was not a useful tool. ref SDS 23 7K6I  Awkward use of rarely
330825 - used tools does not impact productivity.
330827 -  ..
330828 - Changes today make searching a powerful tool for precision access, so
330829 - we need an efficient way to execute a task frequently, which
330830 - previously was used rarely.  Will therefore change access to the
330831 - Search shell from the menu to use F4.  Normally, F4 initiates a copy
330832 - line task, and F1 F4 opens search and change.  In the Subject Index,
330833 - copying lines is performed more efficiently with F3 that captures an
330834 - entire account for replication, and therefore F4 is available for
330835 - reassignment.  In this case, change is justified by increased speed
330836 - for spontaneous reaction to situational awareness.  We cannot use F1
330837 - F4 for opening the Subject Index, because it jumps to the end of an
330838 - index to create new accounts, reported on 040307. ref SDS 23 7O88  In
330839 - any case F4 is faster, and is available in the Subject Index.
330841 -  ..
330842 - Another idea is to execute searches from a specification entered in
330843 - the index file, rather than open Search and Change.  The user merely
330844 - types a string in the description field, and then instead of pressing
330845 - F4 to open the Search and Change shell, tap F4 twice, like a double
330846 - click, and this captures the string, enters it in the Search and Chang
330847 - shell, and executes the command. ref SDS 0 NX7I
330849 -  ..
330850 - Searching across large segmented index files can be accomplished
330851 - sequentially with the feature developed on 031114 for scrolling
330852 - through a file using virtual memory on the disk, ref SDS 20 RR3O, to
330853 - support a search for words and phrases that describe subject accounts
330854 - in the organic structure of context.  We can use the existing search
330855 - and change operation for the user to specify a search.  Execution can
330856 - be streamlined by assigning Enter in the search specification menu to
330857 - execute the command.  Speed can be improved by search backward and
330858 - forward based on calculating the shortest distance to the target area.
330860 -  ..
330861 - After implementation of a sequential search design, per above,
330862 - ref SDS 0 3P4L, further consideration from memory of reading about a
330863 - binary search method set out in a book on computers that was examined
330864 - in a San Francisco book store about 20 years ago.  This may have been
330865 - Stacy's or possibly a store in the Embarcadero Center.  Therefore,
330866 - changed the design from sequential to binary search.  A few weeks
330867 - later, research found recent analysis of binary search methods that
330868 - aligns with the design finally implemented for SDS, per below,
330869 - ref SDS 0 JY3H  Testing and evaluation indicate binary search design
330870 - is very effective, per above. ref SDS 0 QF56
330872 -  ..
330873 - We need an efficient way to execute searches in the Subject Index.
330874 - Currently, users press the standard edit chain scroll function Ctrl F6
330875 - to switch from the Search and Change shell, qsc, where a specification
330876 - is entered, to the target file, and then press Shift F4 to call macro
330877 - 42 that executes the search.  This procesure is not physically nor
330878 - mentally demanding, when used sparringly.  It can be streamlined to be
330879 - less burdensome for planned frequent application, per above,
330880 - ref SDS 0 LH9M, by using macro 65 that opens the Search and Change
330881 - shell to assign Enter in the Search and Change shell for executing the
330882 - specification immediately.  The code can switch to the target file
330883 - from which the Search and Change shell was opened, and then execute
330884 - the specification, ref SDS 0 NA5H, by using an edit chain marker
330885 - called with macro 67 that opens the Search and Change shell.
330886 - ref SDS 0 FX7K
330888 -  ..
330889 - Immediate execution to find words and phrases by pressing Enter in the
330890 - Search and Change shell, ref SDS 0 Y59J, introduces a new requirement
330891 - to retain Shift F4 for executing search and change commands in a
330892 - target file that is different from the file where a specification is
330893 - captured with cut and paste and entered into the Search and Change
330894 - shell, qsc, with F1 F4.  In this case, Enter executes the search or
330895 - change in the originating file where F1 F4 was called to open the
330896 - Search and Change menu.  We need to add commands that force Shift F4
330897 - to execute the current file, rather than the originating file.
330898 - ref SDS 0 KZ3N
330899 -
330900 -
330901 -
330902 -
330903 -
330904 -
330905 -
330906 -
3310 -

SUBJECTS
Subject Find Code for a Particular Narrative Description, 011125, 03
Enter Execute Search Change from within Specification Window Macro 6

3504 -
3505 - Progress
350601 -  ..
350602 - Markcur 41 Search Change Configure for Execution with Enter
350603 - 000002 Macro 65 Open Search Change Assign Markcur 41 for Enter
350604 - F1 F4 Open Search Change Mackcur 41 for General Execution with Enter
350605 -
350606 - F1 F4 sets up the Search macro.  Below, change this to F4 for more
350607 - immediate execution to find words and phrases in the the Subject
350608 - Index, per planning above, ref SDS 0 LH9M, because F1 F4 is used to
350609 - jump to the end of segmented index files. ref SDS 0 L53M
350611 -  ..
350612 - Line 2950, ref OF 4 DS7M, -entry 65 in 000002 about 40 lines below
350613 -
350614 -    -entry 65
350615 -    ...
350616 -    ...
350617 -    markcur 41
350618 -    -if @47 = 31 setgbl 297 31
350619 -    e qsc
350620 -    cmd2off
350621 -    -if @47 = 8 -goto bPGo
350622 -    macro 301
350623 -    immed 2a
350624 -    ic 122
350625 -    rel_cur 0 1
350626 -    ic 49
350627 -    rel_cur 0 1
350628 -    ic 56
350629 -    ic 48
350630 -
350631 -        markcur 41 in the originating file enables Enter to execute
350632 -        search and change from within the macro shell qsc, per below,
350633 -        ref SDS 0 NA5H, e qsc opens the search and change shell, macro
350634 -        301 empties the file, it it already exists for some reason; if
350635 -        47 = 8 qsc is already open, and so configuration is preserved.
350636 -        set default zone 1 80 for the standard search op called with F1
350637 -        F4, and today simply F4 in the Subject Index.
350638 -
350639 -
350640 -
350641 -
350642 -
3507 -

SUBJECTS
Enter Execute Search Change from within Specification Window Macro 6

3803 -
380401 -  ..
380402 - Enter Execute Search Change Reduce Using Ctrl F6 Shift F4
380403 - Search Words Phrases Sorted Indexes F4 Opens Search Shell Qsc F4
380404 - F4 Assigned Search Shell When Called from SI to Check Double Click
380405 -
380406 - Line 2990, ref OF 4 1D4H, -entry 65 in 000002 about 40 lines below
380407 -
380408 -    pfent macro 651.............................. ref SDS 0 C58N
380409 -      macro 235.................................. ref SDS 0 LV3O
380410 -    getgbl 1 297
380411 -    setgbl 297 0
380412 -    -if @1 = 31 pf4 @c:\sd\03\03501 #20............ref SDS 0 5K5O
380413 -    -exit
380414 -
380415 -        pfent macro 651 assigns Enter to execute search and change
380416 -        immediately within the search shell using ecur 41 to return to
380417 -        the originating file, per above, ref SDS 0 FX7K, tried creating
380418 -        a double click feature calling macro 235 with F4 when Search
380419 -        and Change is opened from within the Subject Index, per below.
380420 -        ref SDS 0 5K5O  This did not work out, so changed the design
380421 -        for F4 to accomplish the objective without a "double click"
380422 -        effect, per below. ref SDS 0 G53I
380423 -
380424 -
380425 -
380427 -  ..
380428 - Shift F4  Macro 422 Markcur 41 Identify Current File for Search Change
380429 -
380430 - Line 500, ref OF 6 PW4N, -entry 153 in 000008 about 270 lines below
380431 -
380432 -    ps4 macro 422
380433 -
380434 -        Changed from macro 42, so that Shift F4 can assign markcur 41
380435 -        that executes locate command on current file.  Work today
380436 -        markcur 41 with F1 F4 that opens the Search and Change shell,
380437 -        ref SDS 0 FX7K, so that Enter can execute a search immediately,
380438 -        also, assigned today. ref SDS 0 NA5H  Sometimes Search and
380439 -        Change is opened with F1 F4 from a file where a search string
380440 -        is captured, but the the search is to occur in another file.
380441 -        In that case, we need to launch search with Shift F4, rather
380442 -        than Enter from within the qsc search shell.  Therefore Shift
380443 -        F4 needs to assign markcur 41 to the file where the command is
380444 -        called.
380445 -
380447 -  ..
380448 - Line 2900, ref OF 3 2U5I, -entry 42 in 000001
380449 -
380450 -    -entry 422
380451 -
380452 -        markcur 41
380453 -
380454 -            This assignment is added today so Shift F4 assigned by
380455 -            macro 153 in 000008, will execute a search and change
380456 -            command on the current file, rather than the file from
380457 -            which the Search and Change shell was opened, per above.
380458 -            ref SDS 0 KZ3N
380460 -             ..
380461 -            Users have to remember that when a specification is
380462 -            captured and entered into the Search and Change shell from
380463 -            within the current file, then when Enter is called, the
380464 -            operation will switch back to the current file, and not to
380465 -            some other file where the search may be intended, and so
380466 -            the user must use Ctrl F6 to switch into the target file
380467 -            and execute Shift F4, rather than Enter to execute the
380468 -            search or change command, per above. ref SDS 0 KZ3N
380469 -
380470 -
380471 -
380472 -
380474 -  ..
380475 - Enter Execute Search Change from within Specification Window
380476 - 000002  Macro 65 Search Change Setup Called by F1 F4 and Only F4 in SI
380477 - 000002  Macro 651 Enter Executes Search Change Specification in Qsc
380478 -
380479 - Line 2990, ref OF 4 C64H, -entry 67 in 000002
380480 -
380481 -    -entry 67
380482 -    macro 153
380483 -    ps10 errormsg Help=Ctrl F10    Quit=ESC    Nex
380484 -    annotate              Search & Change
380485 -    errormsg  Set zone and search specification
380486 -    pfent macro 421
380487 -    -exit
380489 -     ..
380490 -    -entry 651
380491 -    ecur 41
380492 -    macro 42...................................... ref SDS 0 6O5O
380493 -    -exit
380494 -
380495 -        Added new assignment for Enter in the Search and change routine
380496 -        for launching a search immediately after entering a
380497 -        specification in the shell file qsc.  Enter calls new macro 421
380498 -        that switches control to the target file with ecur 41, and then
380499 -        calls macro 42 to execute the search using code in 03501, per
380500 -        above. ref SDS 0 W45K  This saves keystrokes Ctrl F6 and Shift
380501 -        F4 so that command and control of the work is more spontaneous
380502 -        based on situational awareness.
380504 -         ..
380505 -        The original function is retained so that multiple searches can
380506 -        be performed with Shift F4 within the target file, and so that
380507 -        users can capture a search specification in one file, and then
380508 -        switch to the target file and call Shift F4 to perform the
380509 -        search, per above. ref SDS 0 OQ5N
380511 -         ..
380512 -        Shift F4 has additional capability in the Subject Index.  When
380513 -        a specification is entered to find a subject at one level,
380514 -        often the result of search points to another level.  F1 F2 can
380515 -        open the next level, and then Shift F4 immediately finds the
380516 -        specification in the new level.
380517 -
380518 -
380519 -
380520 -
380521 -
380522 -
380523 -
3806 -

SUBJECTS
Change Search Evaluate and Configure to Avoid Moving Screen for Chan

3903 -
390401 -  ..
390402 - Shift F4 Change Op Avoid Jumping Screen
390403 - Macro 42 Avoid Jumping Screen for Change Op Shift F4
390404 - 000001  Macro 42 Change Improve Avoid Jumping Screen
390405 - Change Function Macro 42 Avoid Jumping Screen Shift F4
390406 -
390407 - Follow up ref SDS 6 YL6M.
390409 -  ..
390410 - Line 2910, ref OF 3 RXYP, -entry 42 in 000001
390411 -
390412 -    -entry 42
390413 -    errorcnt 0 0
390414 -    e qsc
390415 -    loc_cur 4 1
390416 -    chrcnt 1 0
390417 -    rel_cur 1 0
390418 -    ic 108
390419 -    rel_cur 0 -1
390420 -    setcnt 2 0
390421 -    -if @1 = 67 setcnt 2 8888
390422 -    -if @1 = 99 setcnt 2 8888
390423 -    -if @2 = 8888 ic 42
390424 -    setgbl 2 @2
390425 -    ecur 41
390426 -    getgbl 2 2
390427 -    -if @2 = 8888 -goto nsidpz................... ref SDS 0 FY6O
390429 -         ..
390430 -        Added this code today that investigates Search and Change shell
390431 -        to see if a change has been configured, and if so, a flag is
390432 -        set to avoid jumping the screen that is used for moving search
390433 -        target lines into the middle of the screen for context,
390434 -        reported on 010314, ref SDS 6 YL6M, which is not needed for
390435 -        change tasks.
390436 -
390437 -
390438 -
390439 -
390440 -
3905 -

SUBJECTS
Search Automatically Sort Subject Indexes Current Account Level Macr

4103 -
410401 -  ..
410402 - 000001  Macro 42 Search Subject Index Execute
410403 - Subject Index Add Special Handling for Search and Change Macro 42
410404 -
410405 - Macro 42 is for general search and change that uses a file, qsc, for a
410406 - menu shell to enter a specification that can be executed or edited for
410407 - repetitive tasks.  Until now, typical use described above, ref SDS 0
410408 - 3O52, has not applied in the Subject Index because the mechanics take
410409 - more time than sorting the list and scrolling up or down to find
410410 - things.  Segmented indexes introduced a few years ago could not be
410411 - searched.  Segmenting, also, however, increased the size of indexes,
410412 - with consequent increase in the time for conventional sequential
410413 - searching.  Therefore, today, the exercise is to reduce the time and
410414 - effort for performing searches across large segmented indexes.
410416 -  ..
410417 - Initially, macro 42 was significantly modified to implement a design
410418 - that reduced the time to search large indexes from 20 seconds to about
410419 - 10 seconds.  As explained above, this design was later scrapped, and a
410420 - different design using binary searching was developed.  This reduced
410421 - the time to search a representative large index from 10 to about 5
410422 - seconds.  Fortunately, the effort nearly exhaused limited compiler
410423 - space.  But for this condition, the revised design might have been
410424 - adopted, since it was working, even though the code seemed awkward,
410425 - per evaluation above. ref SDS 0 QF47  A fourth binary search design
410426 - was then attempted, after removing all of the search code for the
410427 - Subject Index from this macro 42, and moving it into the Subject Index
410428 - profile, 03501, with the new design, and this seems to have further
410429 - reduced the time for searching to about 1 second, also per above.
410430 - ref SDS 0 QF56
410432 -  ..
410433 - Line 2950, ref OF 3 KT6H, -entry 42 in 000001 about 60 lines below
410434 -
410435 -    -if @47 = 31 -goto siOp31.................... ref SDS 0 W45K
410436 -    addcnt 106 1
410437 -    -if @106 < 2 macro 6
410438 -    macro 8
410439 -    -if @1 = 917 up 10
410440 -    -goto nsidpz................................. ref SDS 0 FY6O
410441 -
410442 -        Added new support today -if @47 = 31 -goto siOp31 for Subject
410443 -        Index that will sort the index to assemble all segment files
410444 -        for a comprehensive search on the account, and will scroll
410445 -        through the entire virtual file using the new tools created for
410446 -        scrolling a large sorted index.  If not a subject index, macro
410447 -        6 and macro 8 mark starting and target locations to quickly
410448 -        navigate in an SDS record or an editor file.  -if @1 = 917 up
410449 -        10 scrolls the screen up for a search op so a target line is
410450 -        found again after being moved down 10 lines for context.
410451 -
410452 -
410454 -  ..
410455 - Search Subject Indexes Sort Automatically Every Pass
410456 - Sort Subject Index Every Pass for a Search for Search Macro 42
410457 - Macro 42  Search Sorted Subject Index Called with Enter and Shift F4
410458 -
410459 -
410460 - Line 2950, ref OF 3 LE4O, -label siOp31 in 000001 about 40 lines below
410461 -
410462 -    -label siOp31
410463 -    @c:\sd\03\03501 #19......................... ref SDS 0 S672
410464 -    -exit
410465 -
410466 -        Per above, default launch for search will be Enter from within
410467 -        Search and Change routine, ref SDS 0 NA5H, -- 1st design of
410468 -        changes today developed a lot of code in this macro 42;
410469 -        compiler space was reached, so moved all the code for searching
410470 -        the SI into 03501, and then revised the code to a different
410471 -        design that actualy runs faster in a macro file than did the
410472 -        initial compiled code, per evaluation above. ref SDS 0 QF3Y
410474 -         ..
410475 -        The first design change to macro 42 determined whether to
410476 -        search up or down in the overall data base based on calculating
410477 -        the shortest distance from the starting position in the data
410478 -        base to the target.  The calculation merely looked at the value
410479 -        of the character at the beginning of the word or phrase, and
410480 -        the current cursor location.  Rough assumptions were made that
410481 -        all letters contained the same number of lines, and that
410482 -        non-letter characters were wighted toward the letter A.
410483 -        Searching up or down were accomplished by calls to code in
410484 -        03501 that scrolls the sorted database in virtual memory up or
410485 -        down to read in 17 lines each pass and then use a standard
410486 -        search command to look for the target line.  This method
410487 -        required reading at most half of the lines in the data base to
410488 -        find the target, and on average 25%.  In a file of 4000 lines
410489 -        that requires processing 1000 lines to read from the disk and
410490 -        then to evaluate.  This design reduced search time from 10
410491 -        seconds by manual scrolling to about 5 or 6 seconds.
410492 -
410493 -
410494 -
410495 -
4105 -

SUBJECTS
Binary Search Sorted Index Reduce Time from 20 to 1 Second Capture Z
Search Automatically Sort Subject Indexes Current Account Level

4304 -
430501 -     ..
430502 -    03501 Search Subject Index Binary Design Increases Speed
430503 -    Binary Search Sorted Index Reduce Time from 20 to 1 Second
430504 -    Speed Increased Time Reduced from 20 to 1 Second Binary Search
430505 -    Sort Index for Binary Search to Find Subject Words and Phrases
430506 -
430507 -    See background above, ref SDS 0 QR6O, and evaluation on history of
430508 -    this design. ref SDS 0 QF31
430510 -     ..
430511 -    User has pressed F4 in the Subject Index to open the search menu;
430512 -    has manually entered a specification and pressed Enter which
430513 -    switches control to the Subject Index file, sndx, per above,
430514 -    ref SDS 0 NA5H, or, the user has pressed F4 twice (double click)
430515 -    with the cursor on a word or phrase in the Subject Index, sndx, and
430516 -    the code has captured this string and entered it into the search
430517 -    shell, qsc, per below. ref SDS 0 5K5O  In both cases execution
430518 -    calls this new macro in 03501 to find the target specification.
430520 -  ..
430521 - Line 5270, ref OF 1 WS9H, -label ssum42 03501 about 40 lines below
430522 -
430523 -    -label ssum42
430524 -    setcnt 10 8374
430525 -    -if @123 != 666 -gosub sortIt
430526 -    setcnt 10 0
430527 -    pushc
430528 -    loc_cur 0 15
430529 -    fr /.. /
430530 -    setcur 60 0
430531 -    setcnt 70 @60
430532 -    addcnt 60 1
430533 -    popc
430534 -    setgbl 60 @60
430535 -
430536 -        -if @123 != 666 -gosub sortIt if the index is not already
430537 -        sorted, run subroutine to sort current index level that
430538 -        captures total number of lines in counter 109, ref OF 1 9J5I,
430539 -        pushc loc_cur 0 15 and fr /.. / moves the cursor to the
430540 -        beginning column of the account description; setcur 60 0
430541 -        captures 1st search zone parameter for zonereps to support the
430542 -        binary search, and for the search command if needed.  setcnt 70
430543 -        @60 saves the offset for the description field to capture and
430544 -        later enter the search string into sndx.  addcnt 60 1
430545 -        increments the cursor position to the actual column of the
430546 -        description field, since setcur sets the value at one less than
430547 -        the actual cursor position.  setgbl 60 @60 transfers the column
430548 -        position for use in other files, qsc, and 03501.
430549 -
430550 -
430551 -
430552 -
4306 -

SUBJECTS
Case Sensitive Change 1st Char Each Word to Capital Conform Format S
Binary Search Setup Zone Word Phrase Target Specification Configure

4704 -
470501 -     ..
470502 -    Case Sensitive Set 1st Char All Words Capital
470503 -    Capitalize 1st Char Search Specification for Case Sensitive
470504 -    Search Specification Capture in Qsc Shell to Compare Zonereps
470505 -    Zone Search from Subject Description Offset Transferred into 03501
470506 -
470507 -
470508 - Line 5300, ref OF 1 H95K, -label ssum42 in 03501 about 80 lines below
470509 -
470510 -    e c:\sd\03\03501
470511 -    line...............................&& *%e3
470512 -    getgbl 1 60
470513 -    loc_cur 4 3
470514 -    inscnt 1 0
470515 -    e qsc
470516 -    loc_cur 0 4
470517 -    -label lpcplt
470518 -    chrcnt 1 0
470519 -    -if @1 > 96 -if @1 < 123 -goto cctlc
470520 -    -goto cap0K
470521 -    -label cctlc
470522 -    subcnt 1 32
470523 -    ic @1 0
470524 -    -label cap0K
470525 -    aw
470526 -    setcur 1 0
470527 -    -if @1 < 4 -goto capDn
470528 -    -goto lpcplt
470529 -    -label capDn
470530 -
470531 -        Demonstrating binary search for Gary on 050328 showed people
470532 -        sometimes enter a specification that does not match the case
470533 -        format of the Subject Index database.  This code changes the
470534 -        1st char of every word to capital.  Would be better if Medit
470535 -        search had a switch for not case sensitive.  We could also
470536 -        develop code that would check every char and set the case, but
470537 -        this may be adequate 1st step.
470538 -
470540 -  ..
470541 - Line 5330, ref OF 1 H95K, -label ssum42 in 03501 about 80 lines below
470542 -
470543 -    loc_cur 4 4
470544 -    setcnt 86 180
470545 -    macro 1188
470546 -    rel_cur 0 -2
470547 -    chrcnt 2 0
470548 -    rel_cur 0 1
470549 -    setcur 3 0
470550 -    subcnt 3 4
470551 -    -if @2 = 47 subcnt 3 1
470552 -    setgbl 61 @3
470553 -    -if @2 != 47 ic 47
470554 -
470555 -        Code transfers value for left margin of subject description
470556 -        captured in sndx, per above, ref SDS 0 QS4N, and enters this
470557 -        number for the zone command in 03501 to control binary search.
470558 -        e qsc and macro 1188 captures search argument up to about 80
470559 -        characters for transfer into sndx to capture with zonereps, per
470560 -        below, for comparison with repscnt during binary search. macro
470561 -        1188 in qsc puts the cursor at the end of the search argument.
470562 -        Test last char for a search command delimiter, and if not enter
470563 -        a delimiter.  setcur 3 0 captures cursor position and subcnt 3
470564 -        4 adjusts the location to calculate length of the word or
470565 -        phrase search argument. setgbl 61 @3 prepares to transfer 2nd
470566 -        param of zone command for entering into 03501 to support
470567 -        zonereps and repscnt.
470568 -
470569 -
470571 -     ..
470572 -    Configure Zone and Zonereps Binary Search Argument Word or Phrase
470573 -
470574 -
470575 - Line 5340, ref OF 1 9N5J, -label ssum42 in 03501 about 130 lines below
470576 -
470577 -    e c:\sd\03\03501
470578 -    getgbl 0 61
470579 -    ic 32
470580 -    addcnt 1 @0
470581 -    inscnt 1 0
470582 -    ic 32
470583 -    ic 32
470584 -    e sndx
470585 -    line 3
470586 -    of @70
470587 -    loc_cur 4 1
470588 -    setcnt 86 180
470589 -    macro 1189
470590 -    of 0
470591 -    loc_cur 0 @60
470592 -    *%e3
470593 -    z
470594 -    zonereps
470595 -    loc_cur 0 @6
470596 -
470597 -        Enter 03501 and post 2nd part of zone command captured from
470598 -        within qsc search shell, per above. ref SDS 0 KN4L  ic 32 ic 32
470599 -        clears any characters from prior pass.  e sndx switches control
470600 -        to Subject Index to configure for performing a binary search.
470601 -        line 3 moves active position for searching to the top of the
470602 -        screen so that the header is perserved.  of @70 places the left
470603 -        column of the description field captured above, ref SDS 0 QS4N,
470604 -        on screen column 1 so there is maximum room to enter the search
470605 -        word or phrase, loc_cur 4 1 moves cursor to screen column 1
470606 -        which is now the location for the left margin of subject
470607 -        descriptions. macro 1189 reads in the search argument word or
470608 -        phrase captured from the search shell, qsc, per above.
470609 -        ref SDS 0 KN4L, of 0 restores standard file offset, and loc_cur
470610 -        0 @60 puts cursor back on left margin of subject account
470611 -        descriptions ready to execute binary search. z .... sets zone
470612 -        for binary search. zonereps captures the search argument string
470613 -        to compare with repscnt;
470614 -
470615 -
470616 -
470617 -
470618 -
470619 -
4707 -

SUBJECTS
Binary Search Sorted Database Simplicity Fast Reduce Time from 20 to
Binary Search Professional Paper Mind Boggeling Simple Fast Code Req
Binary Search Sorted Index Reduce Time from 20 to 1 Second Capture Z
Binary Search Algorithm Control Parameters Binary Search Loop Total
Search Automatically Sort Subject Indexes Current Account Level

6807 -
680801 -     ..
680802 -    Bray Professional Paper Explains Binary Searching
680803 -    Control Parameters Binary Search Loop Total Number of Records
680804 -
680805 -    A few weeks later OA 050316, research using the Internet found a
680806 -    paper on binary search by Tim Bray, who is a Technology Director at
680807 -    Sun Microsystems...
680808 -
680809 -        http://www.tbray.org/ongoing/misc/Tim
680811 -     ..
680812 -    A report on 040316 says that Tim is developing blogging software
680813 -    and content syndication based on the Really Simple Syndication
680814 -    (RSS), format in Sun's software line.
680815 -
680816 -        http://www.builderau.com.au/architect/webservices/0,39024590,20283199,00.htm
680818 -     ..
680819 -    Tim's guidance on binary search is published independently by
680820 -    Ongoing....
680821 -
680822 -                   On the Goodness of Binary Search
680823 -
680824 -        http://www.tbray.org/ongoing/When/200x/2003/03/22/Binary
680825 -
680826 -    ...and makes the following points...
680827 -
680828 -        1.  Simplicity of binary search is aesthetically pleasing.
680829 -            ref OF 11 RY66 and ref OF 11 RY85
680831 -             ..
680832 -            Binary search is mind-bogglingly simple; look at the middle
680833 -            of a sorted array to discover the target is in the top or
680834 -            bottom half... ref OF 11 HB5K  Take a "high" pointer and a
680835 -            "low" pointer and keep cutting the distance in half until
680836 -            they run into each other.  Either the target will be found
680837 -            or it's not there. ref OF 11 0196
680838 -
680839 -                This scheme was applied to search the Subject Index,
680840 -                per below. ref SDS 0 ME3M
680842 -             ..
680843 -            Binary search can find ranges in addition to matches.
680844 -            ref OF 11 R386
680846 -             ..
680847 -            The author's code, ref OF 11 R136, looks considerably
680848 -            different from the code for SDS. ref SDS 0 R16J
680850 -             ..
680851 -        2.  Logarithmic analysis seems to favor binary searching for
680852 -            speed. ref OF 11 RY68  Actual measurements verify that
680853 -            binary searhing is extremely fast. ref OF 11 R270
680854 -
680855 -               This aligns with testing on the SDS implementation, per
680856 -               above. ref SDS 0 DF9J
680858 -             ..
680859 -        3.  Memory overhead minimal. ref OF 11 RY95
680860 -
680861 -               Code required for SDS implementation was about 20% of
680862 -               the initial effort. ref SDS 0 QF56
680863 -
680864 -
680866 -             ..
680867 -            Last Line Binary Search Fails Needs Special Handlling
680868 -
680869 -        4.  Binary search code is also subtle; experienced programmers
680870 -            have problems that require care to create an effective and
680871 -            accurate algorithm. ref OF 11 RZ92  The easiest way to go
680872 -            off the rails with binary search is checking whether you've
680873 -            found your target while cutting-down-by-half. ref OF 11
680874 -            RZ54
680875 -
680876 -               Gary Johnson indicated in a telephone call on 050316
680877 -               that problems could arise finding the first, last, and
680878 -               mid-points of a list.  He explained that binary code can
680879 -               be verified by testing a small list of 20 items or so.
680880 -               ref SDS 32 G26H  If the algorithm finds all occurences,
680881 -               then the code is likely accurate.  Did this test, and
680882 -               everything seemed to pass, per evaluation above.
680883 -               ref SDS 0 ME3M  However, in a call with Morris the next
680884 -               day on 050317 he noted that mathematics of the algorithm
680885 -               cannot read the last line in the file due to rounding
680886 -               procedures for the divcnt command.  We reviewed Gary's
680887 -               ideas for verification, which seemed to pass.  Morris
680888 -               feels the first line and midpoints should be okay,
680889 -               becasue the code has more lines to test.  He suggested
680890 -               testing binary search for the last line in the file
680891 -               again.  This test observed failure.  Initially, the
680892 -               problem seemed related only to even numbers, but testing
680893 -               the original code failed searching for the last record
680894 -               in both even and odd numbers for the total database.
680895 -               Therefore, added code to perform an additional check on
680896 -               the last line in the list after the algorithm runs to
680897 -               failure. ref SDS 0 5F7M
680898 -
680899 -
680901 -             ..
680902 -            Top of Multi-match List Search with Special Binary Code
680903 -
680904 -        5.  Binary search does not necesarily find the top element of
680905 -            identical strings that meet the specification, however, the
680906 -            code can be configured to accomplish this result.
680907 -            ref OF 11 RRTY
680908 -
680909 -               There are often many instances of words and phrases in a
680910 -               subject index.  Initially, the code for SDS was set so
680911 -               that when a match was found, the loop ended.  Additional
680912 -               code was developed for another loop to sequentially
680913 -               scroll down to the top of the list. ref SDS 0 SQ5H  This
680914 -               was satisfactory until a long sublist was encountered.
680915 -               The time to scroll sequentially was maybe 5 - 10
680916 -               seconds.
680918 -                ..
680919 -               During the call with Morris, I asked about Bray's idea
680920 -               not to stop the binary loop when a match is initially
680921 -               found. ref OF 11 RZ54  Morris advised that running a
680922 -               binary search loop to find the top of the list is
680923 -               complex code using hash techniques.  He planned to think
680924 -               about how to modify SDS code for accomplishing this
680925 -               requirement.  After calling Morris, modified the code by
680926 -               adding a switch that directs the binary loop to search
680927 -               only the upper half of the list once the target string
680928 -               is encountered.  This seems to solve the problem by
680929 -               using the same code to find the top element of a search
680930 -               specification that has multiple entries in a sorted
680931 -               list.  Testing now shows that even with long sublists,
680932 -               the time to perform all searches is about 1 second, per
680933 -               above. ref SDS 0 ME3M
680935 -  ..
680936 - Line 5360, ref OF 1 MS7J, -label ssum42 in 03501 about 150 lines below
680937 -
680938 -    setcnt 138 @109
680939 -    setcnt 141 0
680940 -    setcnt 142 @109
680941 -    setcnt 143 0
680942 -
680943 -        Configure initial binary search control. setcnt 138 @109 starts
680944 -        process with the total number of records to search, captured
680945 -        from the sort op, per above, ref SDS 0 QS4N; setcnt 141 0
680946 -        starts top of record control at 0. setcnt 142 @109 preserves
680947 -        initial end of record control at total number of lines to
680948 -        search, which allows binary processing to float the end points
680949 -        by recursively dividing the database in half.  Subsequent
680950 -        research on 050316 supports this design, per above. ref SDS 0
680951 -        R17I  Added setcnt 143 0 for a switch to flow the search to the
680952 -        1st half of the list in order to find the top of multiple
680953 -        instances that match the search specification, also, per above.
680954 -        ref SDS 0 R14L  Initially, there were several more counters
680955 -        involved, which seemed redundant, but the design worked.  In
680956 -        the call to Morris on 050317, he, also, felt the code could be
680957 -        streamlined.  Further consideration led to the final, simple
680958 -        design, which aligns with Bray's observations on binary search.
680959 -        ref SDS 0 R17I
680960 -
680961 -
680963 -     ..
680964 -    Binary Search Loop Words and Phrases Get with Sorted Subject Index
680965 -
680966 -    Summary explanation applying the recently modified Get command in
680967 -    sorted indexes is in "evaluation," and notes that binary search
680968 -    reduces disk reads from 4000+ down to about 20 or so, ref SDS 0
680969 -    QF47, by replacing the initial design that scrolled sequentially
680970 -    through the database, per below. ref SDS 0 5F8K  Research on the
680971 -    Internet seems to support the binary search design, per above.
680972 -    ref SDS 0 JY3H
680974 -     ..
680975 -    At this stage, the user entered a search spec in either the current
680976 -    index and pressed F4, ref SDS 0 5K5O, or the user pressed F4 to
680977 -    open the qsc search shell, entered a search spec, and pressed
680978 -    Enter. ref SDS 0 NA5H  The code has already sorted the index,
680979 -    ref SDS 0 QS4N, determined the search zone and has transferred the
680980 -    search argument from the search shell, qsc, into the sorted index
680981 -    for a template, ref SDS 0 UO9J, captured by zonereps to compare
680982 -    with binary search objects, ref SDS 0 UO9J, and control parameters
680983 -    for the database have been set for performing comparisons.
680984 -    ref SDS 0 JY3H
680985 -
680987 -     ..
680988 -    03501 Binary Search Loop for Specified Subject Description
680989 -    Search Fails When Binary End Limits Converge Using Get Command
680990 -    Search Succeeds When Repscnt Finds Matching String Use Get Command
680991 -    Get Command Sorted Index with Total Number of Records Drives Search
680992 -
680993 -
680994 - Line 5400, ref OF 1 3M8L, -label cvdb in 03501
680995 -
680996 -    -label cvdb
680997 -    divcnt 138 2
680998 -    -if @141 != @138 -goto ersss2.................... ref SDS 0 DF9J
680999 -    -if @143 = 1 -goto fsac.......................... ref SDS 0 SQ5H
681000 -    immed d
681001 -    g tqii @109 1
681002 -    repscnt 4 0
681003 -    -if @4 = 0 -goto fsac
681004 -    -gosub s1stss
681005 -    errormsg Subject not found; check spelling!
681006 -
681007 -        Binary search divcnt 138 2 divides total number of records in
681008 -        half, captured from sort command, per report on 041114.
681009 -        ref SDS 20 WI7I  Counter 141 is set to the value in counter 138
681010 -        after each division; so when @141 = @138 no further division is
681011 -        possible, so either the line does not exist, or all of them
681012 -        have been processed by the loop.  immed d removes the prior
681013 -        line examined that did not meet the spec. g tqii @109 1 is the
681014 -        engine of the process using get command which Morris upgraded
681015 -        on 031113, ref SDS 19 03A5, by reading from the sorted index
681016 -        the line calculated to be in the next half of the remaining
681017 -        records, per above. ref SDS 0 R17I  On or about 050316 found
681018 -        research explaining ideas on binary search for allowing the
681019 -        code to find the top of the list, per above, ref SDS 0 TY9O,
681020 -        -if @143 = 1 -goto fsac accomplishes this when the target
681021 -        string has been found, per below. ref SDS 0 RZ6O   If a match
681022 -        is not found, then one more test is performed, based on
681023 -        recommendations by Gary and by Morris noting the algorithm does
681024 -        not read the last element of the list, per above. ref SDS 0
681025 -        EE8F  If a match is not found, then -gosub s1stss restores the
681026 -        top of the sorted index, and error message is presented that
681027 -        the search failed.
681028 -
681030 -  ..
681031 - Line 5410, ref OF 1 HQ5I, -label ersss2 in 03501
681032 -
681033 -    -label ersss2
681034 -    immed d
681035 -    g tqii @138 1
681036 -    repscnt 4 0
681037 -    -if @4 = 0 -goto ftlir......................... ref SDS 0 6Q4F
681038 -    -if @4 = 1 -goto ftlh.......................... ref SDS 0 WQ4J
681039 -    -goto upJ...................................... ref SDS 0 RZ6O
681041 -     ..
681042 -    -label ftlir
681043 -    setcnt 143 1
681045 -     ..
681046 -    -label ftlh
681047 -    setcnt 142 @138
681048 -    addcnt 138 @141
681049 -    -goto cvdb..................................... ref SDS 0 5F7M
681050 -
681051 -        immed d deletes prior line read in to keep the array organized.
681052 -        g tqii @138 1 binary search reads the line from the sorted
681053 -        database on the disk halfway between the endpoints calculated
681054 -        for the remaining portion of the record. zonereps has already
681055 -        generated a value for the search argument, per above,
681056 -        ref SDS 0 UO9J, repscnt 4 0 compares the value of the line just
681057 -        read with the value in zonereps.  if the values match, the
681058 -        target line has been found.  Originally, the code branched to
681059 -        another loop that scrolled sequentially to the top of multiple
681060 -        matches using the search specification in qsc.  Research on
681061 -        050316 led to a change.  Now when a match occurs, -if @4 = 0
681062 -        -goto ftlir branches to setcnt 143 1 flagging a match and
681063 -        thereafter the code is directed to only search the 1st half of
681064 -        the list, which finds the top element, per above. ref SDS 0
681065 -        TY9O  When binary processing is exhaused, counter 143 is
681066 -        evaluated, and if it is set to 1, the list is processed, and if
681067 -        not an error message reports no match was found, per above.
681068 -        ref SDS 0 5F7M
681070 -         ..
681071 -        -if @4 = 1 -goto ftlh the string read in by get is evaluated as
681072 -        greater than the specification, so branch to set counters that
681073 -        search in the lower half of the remaining records.  If the
681074 -        string is neither equal nor greater than the specification,
681075 -        then it is less, so -goto upJ branches to set counters that
681076 -        search in the upper half of the remaining records. -label ftlh
681077 -        configures search for the lower half; setcnt 142 @138 changes
681078 -        the upper limit of the record to the new value calculated for
681079 -        half of the original record. addcnt 138 @141 adds the new end
681080 -        points to produce a new value for counter 138, which is fed
681081 -        back to the loop for binary processing. ref SDS 0 5F7M
681082 -
681084 -  ..
681085 - Line 5420, ref OF 1 8V6J, -label upJ in 03501
681086 -
681087 -    -label upJ..................................... ref SDS 0 DF9J
681088 -    setcnt 141 @138
681089 -    addcnt 138 @142
681090 -    -goto cvdb.................................... ref SDS 0 5F7M
681091 -
681092 -        The code above has determined that the target line is in the
681093 -        upper half of the database so setcnt 141 @138 sets the lower
681094 -        limit of the data base to the half way point. addcnt 138 @142
681095 -        adds the new upper and lower limits to produce a new value for
681096 -        counter 138 which is fed back to the loop for binary
681097 -        processing.
681098 -
681099 -
681100 -
6812 -

SUBJECTS
Binary Search Succeeded Find Top of List for Specified Words and Phr

7003 -
700401 -     ..
700402 -    Search Successful Construct 1 Database Segment
700403 -
700404 -
700405 - Line 5440, ref OF 1 7T4N, -label fsac in 03501
700406 -
700407 -    -label fsac..................................... ref SDS 0 DF9J
700408 -    -if @138 < 17 -goto ftas........................ ref SDS 0 SQ9K
700409 -    setcnt 140 @109
700410 -    subcnt 140 17
700411 -    -if @138 > @140 -goto ftas...................... ref SDS 0 SQ9K
700412 -    addcnt 138 1
700413 -    immed 17d
700414 -    g tqii @138 17
700415 -    addcnt 138 16
700416 -    line 1
700417 -    loc_cur 24 36
700418 -    inscnt 138 0
700419 -    loc_cur 6 @60
700420 -    -goto sip31..................................... ref SDS 0 SQ6F
700421 -
700422 -        The code has found a line that matches the specification, and
700423 -        has placed the 1st element of multiple matches at the top of
700424 -        the screen, per above. ref SDS 0 DF9J  Originally, created code
700425 -        for a loop to scroll line by line to the top of all lines that
700426 -        match the search specification.  Research on 050316 indicated
700427 -        the binary alghorithm can accomplish this task, and was able to
700428 -        implement that requirement, so removed the loop here that
700429 -        scrolled line by line. (see above, ref SDS 0 R14L)
700431 -         ..
700432 -        -if @138 < 18 -goto ftas restores the top of the list when the
700433 -        line matching the search specification is within the first 17
700434 -        lines of the list.  Experience over the next month indicated
700435 -        that accomplishing this requirement is accomplished better wtih
700436 -        the command -if @138 < 17 -goto ftas rather than < 18.
700438 -         ..
700439 -        Setcnt 140 @109 and subcnt 140 17 determines when the line that
700440 -        matches the search specification is at the bottom of the list,
700441 -        and -if @138 > @140 -goto ftas restores the end of the list in
700442 -        that case.  If the matching line is not in either the top nor
700443 -        the bottom 17 lines then construct a screen by reading in 17
700444 -        lines, and set the line number at the bottom of the screen to
700445 -        the current value of counter 138 so the user can scroll through
700446 -        the file. -goto sip31 positions cursor on the target line.
700447 -
700448 -
700449 -
700450 -
7005 -

SUBJECTS
Top or Bottom of List Search with Qsc and Position Cursor on Target

7203 -
720401 -     ..
720402 -    Top or Bottom of List Search with Qsc and Position Cursor on Target
720403 -
720404 -
720405 - Line 5470, ref OF 1 QR8K, -label ftas in 03501
720406 -
720407 -    -label ftas
720408 -    setcnt 7 2222
720409 -    -if @138 > @140 -gosub botc9
720410 -    setcnt 7 0
720411 -    -if @138 < 18 -gosub s1stss
720412 -    @qsc #2
720413 -
720414 -        Code has determined the target line is either at the top or the
720415 -        bottom of the record.  setcnt 7 2222 is a flag for subroutines
720416 -        to return before completing.  if line is at the bottom, -gosub
720417 -        botc9 constructs the last 17 lines in the record, and if target
720418 -        is at the top, then -gosub s1stss constructes the first 17
720419 -        lines.  @qsc #2 executes the search to find the specific line
720420 -        in the list that meets the spec.  The zone remains as set with
720421 -        initial configuration. ref SDS 0 UO9J
720422 -
720424 -  ..
720425 - Line 5490, ref OF 1 Z49N, -label sip31 in 03501
720426 -
720427 -    -label sip31................................... ref SDS 0 SQ5H
720428 -    linecnt 1 0
720429 -    addcnt 1 2
720430 -    top
720431 -    loc_cur @1 @6
720432 -    setcnt 1 917
720433 -    errormsg Search Results
720434 -
720435 -        This code figures out the number of the line in the file and
720436 -        moves the cursor to that line with the cursor at the beginning
720437 -        of the description.  errormsg Search Results ends the binary
720438 -        search task for words and phrases in the Subject Index.
720439 -
720440 -
720441 -
720442 -
720443 -
720444 -
7205 -

SUBJECTS
F1 F2 F1 New Account Instruction Message Explaining Press F1 to Make
Date Account Structure Added Feature to Configure a New Subject Acco

7404 -
740501 -  ..
740502 - 03501  New Account Format Position Cursor on Date for Editing
740503 -
740504 - Follow up ref SDS 18 MH5I.
740505 -
740506 - On 030902 developed code and user screen with functions for starting a
740507 - new subject account level, when F1 F2 finds a blank account.
740508 - ref SDS 18 MH5I
740510 -  ..
740511 - Line 3670, ref OF 1 346I, -label genrl in 03501
740512 -
740513 -    Added code today that starts a new account format with the cursor
740514 -    on the date field rather than the description, because the date
740515 -    typically requires editing to differentiate a new account.  Often
740516 -    the description can be entered automatically with Shift F3 or F1 F1
740517 -    F3 using transfer and replication from another account or from a
740518 -    headline in an SDS record, therefore, there is no reason to start
740519 -    with the cursor in the description field, and so starting in the
740520 -    date field saves time and effort.
740522 -     ..
740523 -    Reported this work in the record on 030902. ref SDS 18 ZE6N
740524 -
740525 -
740526 -
740527 -
740528 -
7406 -

SUBJECTS
Profile Sorted Index Special Assignments Scroll Up and Down

7503 -
750401 -  ..
750402 - 03501  Profile Function Assignments in Sorted Index
750403 -
750404 - Line 3770, ref OF 1 OA6K, -label bHpf081 in 03501 about 140 lines
750405 - below
750406 -
750407 -    setcnt 1 777
750408 -    -if @123 = 666 -gosub siprofl
750409 -    setcnt 1 0
750410 -
750411 -        This was added for restoring special assignments after closing
750412 -        a menu.  Need became apparent from initial task of opening the
750413 -        Search menu because F1 F4 is not available in the Subject
750414 -        Index, and so the only way to enter a search specification was
750415 -        through the menu system, so this required a way to restore
750416 -        function keys to the sorted index environment.  This is needed
750417 -        less now that F4 has been assigned to open the Search menu
750418 -        directly from within the subject index, per below. ref SDS 0
750419 -        L53M  There is otherwise little requirement to use the menu in
750420 -        a sorted index.
750421 -
750422 -
750423 -
7505 -

SUBJECTS
F4 Search Menu Open Directly in Subject Index Call Macro 65

7803 -
780401 -  ..
780402 - F4 Search Menu Open Directly in Subject Index Call Macro 65
780403 - Macro 65 Search Menu Open Directly in Subject Index Call F4
780404 -
780405 - Line 5460, ref OF 1 G47I, -label siprofl in 03501
780406 -
780407 -    -label siprofl
780408 -    pf4 macro 65.................................. ref SDS 0 FX7K
780409 -
780410 -        Since this is a sorted index, copying and moving lines is not
780411 -        needed.  Therefore F4 can be assigned to open the search op,
780412 -        rather than use the menu in the Subject option, to make this
780413 -        faster.
780415 -         ..
780416 -        This is awkward because normally F1 F4 calls macro 65 to open
780417 -        the search op, we in the Subject Index, this works well for
780418 -        navigating by jumping to the end of an index level across
780419 -        segmented indexes.  This assignment makes use of balancing left
780420 -        and right hand tasks.
780421 -
780422 -
780424 -  ..
780425 - Line 5490, ref OF 1 FE4O, -label siprofl in 03501
780426 -
780427 -    -if @1 = 777 -return
780428 -
780429 -        This has been needed all along but was missing from the code
780430 -        developed on 040920.  It calls the profile for a sorted index
780431 -        after opening a menu.
780432 -
780433 -
780435 -  ..
780436 - Line 5580, ref OF 1 4364, -label pf9up in 03501
780437 -
780438 -    -label pf9up
780439 -
780440 -        This is the code that scrolls up called by the serach macro 65
780441 -        in 000001. ref SDS 0 S086
780442 -
780443 -
780444 -
780445 -
7805 -

SUBJECTS
Search Automatically Load and Execute Search Shell with F4 F4
Double Click Mouse for Executing Commands Macro 235 in 000002

8104 -
810501 -  ..
810502 - Mouse Generic Double Click Utility Macro 235
810503 - Search Automatically Load and Execute Search Shell with F4 F4
810504 - F4 F4 Twice Load Execute Search Shell and Execute in Subject Index
810505 -
810506 - Follow up ref SDS 29 1E5L, ref SDS 17 575G.
810507 -
810508 - We need a feature for automatically loading a specification to see if
810509 - there are multiple instances.  This helps avoid duplication, and
810510 - focuses organization to save time.
810512 -  ..
810513 - Maybe this can be accomplished by using F4 twice within one second,
810514 - similar to the 2 clicks design for F5 that sorts the current account
810515 - in a subject index, developed on 030717. ref SDS 17 575G  More recently
810516 - this was applied on 050219 to enhance F6, with a double click mode.
810517 - ref SDS 29 1E5L
810519 -  ..
810520 - Originally, 2 click code was developed for the mouse in 000002.
810522 -  ..
810523 - Line 560, ref OF 3 RQ8J, -label sbj2cl in 000001
810524 -
810525 -    -entry 235
810526 -    setcnt 297 0
810527 -    datecnt 290 0
810528 -    setcnt 296 @295
810529 -    -if @295 < @282 addcnt 295 60
810530 -       -if @283 = @293 -if @284 = @294 -if @285 = @295 setcnt 297 2
810531 -    -if @285 = @295 setcnt 297 2
810532 -     setcnt 280 @293
810533 -     setcnt 281 @294
810534 -    setcnt 282 @296
810535 -    -exit
810536 -
810537 -        Created new generic macro for double clicking that can be used
810538 -        in other utilities.
810539 -
810540 -
810542 -     ..
810543 -    Enter Execute Sort Search Op When 1st Char Description Lower Case
810544 -    Macro 232 Set Flag Enter in SI to Execute Sort Search on Lower Case
810545 -
810546 -
810547 - Line 1830, ref OF 3 8E4J, -label stcr141 in 00001
810548 -
810549 -    -label stcr141
810550 -    setcura 140 0
810551 -    addcnt 140 2
810552 -    rel_cur 0 3
810553 -    chrcnt 156 0
810554 -
810555 -        Added code to macro 232 for Enter in the Subject Index.  The
810556 -        new code helps reduce the problem of accidentally using Enter
810557 -        after entering a search specification instead of using F4 F4,
810558 -        because Enter saves the index, and if it has been modified,
810559 -        then corruption occurs, per above. ref SDS 0 5Z8Y  These
810560 -        changes reduce the frequency of the problem.
810562 -         ..
810563 -        Added rel_cur 0 3 to move the cursor to the beginning char for
810564 -        the account subject description.  chrcnt 156 0 captures when
810565 -        the user has entered a specification for a search
810566 -        specification, because these are always lower case, and so if
810567 -        it is upper case, normal processing for Enter occurs, and if it
810568 -        is lower case, then a sort and search operation is called.
810569 -
810570 -            [On 050522 this correction reported today was actually
810571 -            performed, so that Enter executes most search
810572 -            specification, since they recognizable from starting with a
810573 -            lower case letter. ref SDS 33 1F9I
810575 -  ..
810576 - Line 2280, ref OF 1 NS8O, -label bHSI_S in 03501
810577 -
810578 -    -label bHSI_S
810579 -    -if @156 > 96 -if @156 < 123 -goto soFf2c
810580 -    -goto seop4
810581 -    -label soFf2c
810582 -    macro 65
810583 -    -goto gsasqsc................................ ref SDS 0 5K5O
810584 -    -label seop4
810585 -
810586 -        Macro 232 is called when Enter is pressed, and sets a flag
810587 -        showing the cursor is more than 10 char beyond beginning of the
810588 -        account description, ref SDS 0 T19O, which normally the code
810589 -        moves the index to the next level in the organic structure,
810590 -        commonly called with F1 F2.
810592 -         ..
810593 -        Added test for lower case to start account description, so that
810594 -        -if @156 > 96 -if @156 < 123 -goto soFf2c then the code will
810595 -        assume the user manually entered a specification to look for a
810596 -        particular account description, and so will process macro 65
810597 -        to open the Search shell, and then execute -goto gsasqsc
810598 -        the new code for capturing the specification, then sorting
810599 -        and doing a binary search for the target line. ref SDS 0 5K5O
810600 -
810601 -            [On 050522 this correction reported today was actually
810602 -            performed, so that Enter executes most search
810603 -            specification, since they recognizable from starting with a
810604 -            lower case letter. ref SDS 33 1F9I
810606 -         ..
810607 -        This makes Enter an alternate way to execute search ops in the
810608 -        Subject Index when the description begins with a lower case
810609 -        letter.  While this is the major part of all searches, some
810610 -        begin with upper case letters, such as acronyms, like "SDS".
810611 -        Other searches begins with numerals or other non-alpha
810612 -        characters.  Using Enter for most searches can create habits
810613 -        that cause people to forget how to use F4 F4 for all searches.
810614 -        An obvious remedy to prevent bad habits from forming is to give
810615 -        an Error message reminding to use F4 F4 rather than Enter for
810616 -        searching.  For now, decided against this, because Enter is
810617 -        faster and easier to use.  The menu shows F4 opens the menu,
810618 -        and so this may be adequate for users to rediscover F4 F4.
810619 -        ref SDS 0 5K5O
810620 -
810622 -  ..
810623 - Line 4430, ref OF 1 T44G, -label ecsitcf in 03501 about
810624 -
810625 -    -if @156 > 96 -if @156 < 123 -goto sof42c
810626 -    -goto seop3
810627 -    -label sof42c
810628 -    macro 65
810629 -    -goto gsasqsc.................................... ref SDS 0 5K5O
810630 -    -label seop3
810631 -
810632 -        This is where Enter key loads an account code into a Control
810633 -        Field for a Subject Index.
810635 -         ..
810636 -        Added code to work similar to when navigating to the next
810637 -        level, so that if there is a lower case letter that begins the
810638 -        account description, then the code will assume the user entered
810639 -        a specification, per above. ref SDS 0 T19O
810641 -         ..
810642 -        See also the comment on forming bad habits using Enter.
810643 -        ref SDS 0 PS7L
810644 -
810645 -            [On 050522 this correction reported today was actually
810646 -            performed, so that Enter executes most search
810647 -            specification, since they recognizable from starting with a
810648 -            lower case letter. ref SDS 33 1F9I
810649 -
810650 -
810652 -     ..
810653 -    F4 F4 2 Clicks Execute Search Subject Index
810654 -    2 Clicks F4 Search Capture String Execute Immediately
810655 -    Search 2 Clicks F4 Execute Immediately Using SI String
810656 -
810657 -
810658 - Line 5920, ref OF 1 GR6L, -label gsasqsc in 03501
810659 -
810660 -    -label gsasqsc
810661 -       setgbl 297 0
810662 -       macro 235
810663 -       -if @297 = 2 -goto cssae
810664 -       -exit
810665 -       -label cssae
810666 -       setcnt 297 0
810667 -    ecur 41
810668 -    aw
810669 -    ic 32
810670 -    loc_cur 0 10
810671 -    fr /. /
810672 -    setcnt 86 1
810673 -    macro 1182
810674 -    macro 66
810675 -    loc_cur 4 4
810676 -    setcnt 86 1
810677 -    macro 1181
810678 -    macro 651.............execute search......... ref SDS 0 C58N
810679 -    -exit
810680 -
810681 -        New code added setcnt 297 0 resets new double click value each
810682 -        pass generated by macro 235, per above, ref SDS 0 Q76G, and
810683 -        evaluated by macro 65 when F4 is called in the SI, also, per
810684 -        above. ref SDS 0 AF7L  aw finds next word and enters a space,
810685 -        so that macro 1182 will capture the string.
810687 -         ..
810688 -        Actually, it turned out that a double click feature in this
810689 -        case is not required nor effective.  Better ergonomics result
810690 -        from merely assigning F4 in the Search and Change setup code
810691 -        under macro 65 to call this code in 03501, and eliminate
810692 -        calculating 2 clicks.
810694 -  ..
810695 - Line 5580, ref OF 1 939I, -label nSe4 in 03501
810696 -
810697 -    -label nSe4
810698 -    macro 301
810699 -    -gosub
810700 -    save tqia
810701 -
810702 -        This code is only called when F4 is executed from the search
810703 -        shell.
810704 -
810706 -  ..
810707 - Line 2830, ref OF 1 PX4J, -label bH_dFlt in 03501
810708 -
810709 -    -label bH_dFlt
810710 -    *%5
810711 -    G h:\sd\06\00000\
810712 -    -if @10 = 8374 -return
810713 -
810714 -        After get command replaces current index, return using flag
810715 -        set for calling sort with F4 per above.
810716 -
810717 -
810718 -
810719 -
810720 -
810721 -
810722 -
8108 -

SUBJECTS
Expand Capacity Organic Structure Add 30 Levels F1 F2

8403 -
840401 -  ..
840402 - Expand Capacity Organic Structure Add 30 Levels F1 F2
840403 - F1 F2 Increase Levels Segmented Idexes Add Capacity Organic Structure
840404 - F1 F3  Add 30 Levels Increase Capacity for Segmented Indexes
840405 -
840406 - Follow up ref SDS 29 7D8O, ref SDS 18 YB5N.
840407 -
840408 - Line 2190, ref OF 1 9P5O, -label slrtusl in 03501
840409 -
840410 -    -label lp$s
840411 -    fr /$$$/
840412 -    -if @0 > 0 -goto egcar$
840413 -    immed d
840414 -    line............................ *f%2
840415 -    down 3
840416 -    immed r
840417 -    line
840418 -    -goto lp$s
840419 -
840420 -        Modified this code by adding 30 more levels, needed to handle
840421 -        file segments for large indexes.  Changed from using loc_cur
840422 -        that is limited to about 20 lines to using line commands, so
840423 -        the number is easy to increase by replicating the * lines in
840424 -        the target.
840425 -
840426 -            [On 050312 updated code managing stack for conforming
840427 -            Control Field Descriptions. ref SDS 31 3Y4N
840429 -             ..
840430 -            [On 061124 changed design to avoid stacking chained
840431 -            segemented index files, which reduced the number of line
840432 -            required to navigate from about 120 down to about 50 lines;
840433 -            actually may only take about 20 lines. ref SDS 36 0001
840434 -
840435 -
840436 -
840437 -
840438 -
840439 -
840440 -
8405 -

SUBJECTS
Menu Switch Sort in Front of Print to Save Keystrokes in Subject Ind

8703 -
870401 -  ..
870402 - Menu Switch Sort in Front of Print to Save Keystrokes in Subject Index
870403 -
870404 - Line 320, ref OF 5 5X3J, -entry 80 in 000003 about 140 lines below
870405 -
870406 -    -entry 80
870407 -    ...
870408 -    ...
870409 -    -if @47 = 31 ins_text" Files  Edit  Subjects  Sort  Print  Extract  HTML/Internet
870410 -
870411 -        Switched positions moving Sort in front of Pring; made same
870412 -        change in menu call, per below. ref SDS 0 VT4N
870413 -
870414 -
870416 -  ..
870417 - Line 870, ref OF 5 3681, -label regmnu in 000003 about 100 lines down
870418 -
870419 -    -if @47 = 31 @h:\sd\04\050409
870420 -
870421 -        Just informational showing where to find the menu bar for the
870422 -        Subject Index that is modified in the next section so that
870423 -        Sort follows Subject and is ahead of Print.
870424 -
870425 -
870427 -  ..
870428 - Sort Menu in Subject Index Moved Ahead of Print
870429 -
870430 - Line 50, ref OF 2 9N6H, in 0504090 Subject Index Menu
870431 -
870432 -    setcnt 5 151
870433 -    macro 804
870434 -    @c:\sd\03\03501 #7
870435 -    -goto purge
870436 -
870437 -        Moved this code in the menu so it is a little faster to
870438 -        execute with function keys by switching places with print menu
870439 -        option that is never used.  This saves a keystroke.
870440 -
870441 -
870442 -
870443 -
870444 -
870445 -
8705 -

SUBJECTS
Scroll Down 17 Lines Virtual Memory for Sorted Subjects Alphabetical

9003 -
900401 -  ..
900402 - 17 Lines Modify Virtual Memory for Faster Word Search Macro 42
900403 - F9 Scroll Up to Move Down in Sorted Index Code Improved for Speed
900404 - Virtual Memory Increased Speed Scrolling Up and Down for Search Op
900405 -
900406 - Follow up ref SDS 20 RR3O.
900407 -
900408 - To increase speed of sequential search, initially used code developed
900409 - for F9 and Page Down on 031114 to scroll through a sorted index file,
900410 - tqii, ref SDS 20 RR3O, as a call in macro 42 for searching through a
900411 - large sorted index to find a specified subject description.
900413 -  ..
900414 - Provided ability to scroll 17 lines each pass rather than 10, which is
900415 - effective for manual scrolling.  This reduced the time for scrolling
900416 - from 20 seconds down to 10 seconds.  The entire method was abandoned
900417 - in favor of binary search design. ref SDS 0 QF3Y
900419 -  ..
900420 - Line 5540, ref OF 1 4364, -label 1line in 03501
900421 -
900422 -    -label 1line
900423 -    setcnt 34 1
900424 -    -gosub incmn
900425 -    -if @5 >= @109 -goto topSL
900426 -    line 1
900427 -    loc_cur 6 1
900428 -    immed 4@d
900429 -    -if @4 = 17 line 3
900430 -    -if @4 = 10 line 10
900431 -    -if @4 = 1 line 19
900432 -    addcnt 5 1
900433 -    get tqii @5 @4
900434 -    bot
900435 -    linecnt 16 0
900436 -    -if @16 < 22 -goto botc9
900437 -    setcnt 0 0
900438 -    -gosub toslj
900439 -    -if @33 = 1 -if @2 < 13 loc_cur 6 0
900440 -    -if @33 = 1 -if @2 > 12 rel_cur -10 0
900441 -    -exit
900442 -
900443 -        This is where the code in macro 42 scrolls up through virtual
900444 -        memory to find a search specification entered by the User, per
900445 -        above. ref SDS 0 JO4G
900447 -         ..
900448 -        Spent several days streamlining this code to increase speed
900449 -        scrolling through a large index, per evaluation above.
900450 -        ref SDS 0 XL6F  Added support for scrolling 17 lines each pass,
900451 -        which improves speed by about 30%.
900452 -
900453 -
900454 -
900455 -
9005 -

SUBJECTS
Scroll Up 17 Lines Virtual Memory for Sorted Subjects Alphabetical L

9303 -
930401 -  ..
930402 - Scroll Up Opposite Code from Scrolling Down
930403 -
930404 - Line 5760, ref OF 1 656K, -label doneL in 03501
930405 -
930406 -    -label doneL
930407 -    tl 0
930408 -    -gosub incmn
930409 -    -if @5 <= 17 -goto botc9
930410 -    -if @3 <= 18 -goto topSL
930411 -    line 3
930412 -    -if @4 = 1 loc_cur 20 1
930413 -    -if @4 = 10 loc_cur 11 1
930414 -    immed 4@d
930415 -    subcnt 5 27
930416 -    get tqii @5 @4
930417 -    -gosub toslj
930418 -    -if @33 = 99 -if @2 > 12 loc_cur 22 0
930419 -    -if @33 = 99 -if @2 < 13 rel_cur 10 0
930420 -    -exit
930421 -
930422 -        This is where the code in macro 42 scrolls down through virtual
930423 -        memory to find a search specification entered by the User, per
930424 -        above. ref SDS 0 JO4G
930425 -
930426 -
930427 -
930428 -
930429 -
930430 -
930431 -
930432 -
930433 -
930434 -
930435 -
930436 -
930437 -
930438 -
9305 -