THE WELCH COMPANY
440 Davis Court #1602
San Francisco, CA 94111-2496
415 781 5700


S U M M A R Y


DIARY: July 24, 1998 00:13 AM Friday; Rod Welch

Revise justify to avoid using cut and paste.

1...Summary/Objective
2...000002 A9 Justify Macro 49 Eliminate using Cut and Paste
3...DMS Editing "0" File - Change Justify from 04703 to 000002
4...000002 F7 Left, Set Margins, Put Curosr on Left Margin, Macro 54
5...000001 Change split and join, Eliminate Cut File
6...000001 Insert needs to be fixed


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

CONTACTS 

SUBJECTS
Justify, Alt F9
Memory Management
DMS, Data Entry Functions and Procedures
Double Space Mode, Macro 50, F1 Alt F9
A09

0807 -    ..
0808 - Summary/Objective
0809 -
080901 - Follow up ref SDS 7 0000, ref SDS 5 0000.
080902 -
080903 - Over a span of 3 or 4 days, improved basic editing functions and
080904 - reduced code.  These changes should make SDS more stable and run
080905 - faster.
080906 -
080907 -     [On 980728 added code to enhance File Access. ref SDS 9 0000  This
080908 -     caused program to exceed compile segment limit. Below, I unplugged
080909 -     a user safety test for justify, in order to eliminate compile
080910 -     error message. ref SDS 0 1908]
080911 -
080912 - Consolidated code for macro 49 to justify paragraphs and eliminated
080913 - using cut file, ref SDS 0 0809, similar to changes for Contacts on
080914 - 980601. ref SDS 8 1626
080915 -
080916 - Improved F7 that calls macro 54 to scroll left, set margins and place
080917 - cursor on left margin ready to begin data entry. ref SDS 0 1652  It
080918 - supports macro 49, justify, macro 34, split within margins, and macro
080919 - 36, join within margins. Initial design increased code and caused
080920 - compile failure, so had to remove -entry 50 Editor feature for double
080921 - space mode, called by F1 Alt F9, that supports legal briefing; but
080922 - was able to put it back because code consolidation recovered enough
080923 - space.
080924 -
080925 - Revised macro 34 to eliminate using cut and paste.  This recovered
080926 - enough compile segment space to permit restoring double space mode.
080927 - Finally came up with a very simple design for macro 49, justify, that
080928 - uses split and join within margins. This seems to have reduced
080929 - compiled code by about 70 lines.
080930 -
080931 - Decided to move justify for DMS, which was in 04703, to macro 54,
080932 - since most of the new code for macro 54 works for DMS "0" file.  This
080933 - added about 20 lines of compiled code.
080934 -
080935 - Revised macro 341, insert, making it simpler.  This saved about 12
080936 - lines of compiled code.
080937 -
080938 - In total we seem to have saved about 60 lines of compiled code and
080939 - eliminated use of the cut file, which greatly improves memory
080940 - management.
080941 -
080942 -
080943 -
080944 -  ..
0810 -
0811 -
0812 - Progress
0813 -
081301 -  ..
081302 - 000002  A9 Justify Macro 49 Eliminate using Cut and Paste
081303 -
081304 - Follow up ref SDS 6 0000.
081305 -
081306 - Line 150, ref OF 3 4413, -entry 49, initially eliminated process of
081307 - moving text into cut file to justify it with JJ command, and then move
081308 - it back to the target file.  Created special code to capture line
081309 - numbers and restore them after JJ is called, so that JJ would not
081310 - commingle line numbers with text.
081311 -
081312 - Line 130, ref OF 3 2149, continue using subroutine -gosub bPmgNs in
081313 - macro 54 to set margins for justify. ref OF 3 5161  Macro 54 is
081314 - modified below. ref SDS 0 1652
081315 - ..
081316 - After I got the first method to work, I considered Morris'
081317 - comment the other day that justify can be done without the JJ command.
081318 -
081319 - Up to now, my focus has been on how to implement JJ, since that seemed
081320 - like the most direct way to get the job done.  Consideration of the
081321 - design concept, however, led to a new algorithm to justify without JJ.
081322 - This turned out to eliminate need to save and restore line numbers,
081323 - and a lot of other stuff, which saved a lot of code.
081324 -
081325 - Line 200, ref OF 3 3360, -label lp2s4, the new design compares line
081326 - length with the right margin value. If the line is longer, the code
081327 - searches for the last word that is less than or equal to the right
081328 - margin and calls macro 34 to split within margins and enter the line
081329 - number field in SDS and Contact records. If the line is shorter than
081330 - the right margin, macro 36 is called to join within margins the line
081331 - blow, if there is a line below. Then the first loop is called again to
081332 - split any portion that is too long.
081333 -
081334 - Had to eliminate control to avoid justify operation on non-narrative
081335 - fields, per explanation under macro 54 below. ref SDS 0 4216
081336 -
081337 - Since we have a little extra compile space, decided to restore line
081338 - colors in code that splits within margins, per below. ref SDS 0 2647
081339 -
081340 - Line 290, ref OF 3 2147, -label appnd5, capture highlight flag in line
081341 - number field for SDS and Contact records.  The flag captured is on the
081342 - line below the line being processed.  The coding is tricky and so
081343 - requires analysis to understand it.  I found the correct process by
081344 - trial and error.
081345 -
081346 - Line 260, ref OF 3 3492, -label nxTLnE, the highlight flag is restored
081347 - to the line number field after the append operation, if it exists, and
081348 - the color is reset.
081349 -
081350 -     Found that it is necessary to process each line with the append
081351 -     loop in order to get the highlight flags fully and correctly
081352 -     restored.
081353 -
081354 -
081355 -  ..
081356 - DMS Editing "0" File - Change Justify from 04703 to 000002
081357 -
081358 - Line 300, ref OF 1 5043, -label bTJstfY in 04703, removed this code
081359 - because code in macro 49 in 000002 was modified to justify everything.
081360 -
081361 - Line 310, ref OF 3 2168, -label dmSjst in 000002, added code in macro
081362 - 49 to justify narrative explanations of files in the DMS "0" file.
081363 - This replaces code that was in 04703. ref OF 1 5043
081364 -
081365 -     This has fixed margins of 40 116
081366 -
081367 -     It has to work differently to determine the beginning and end of
081368 -     paragraphs, since there is not a blank line at the top of the para
081369 -     and there may not be a blank at the bottom.
081370 -
081371 -
0814 -

SUBJECTS
Margins, Shift left/right, tabs, F7 F8
Memory Management
DMS - Data Entry Functions and Procedures

1106 -
110601 -  ..
110602 - 000002  F7 Left, Set Margins, Put Curosr on Left Margin, Macro 54
110603 -
110604 - Made this a better general purpose routine using F7 to scroll the
110605 - screen left and placing the cursor on the left margin after figuring
110606 - out the column of the left margin based on any outline structure that
110607 - might be encountered in SDS and in an Editor file.
110608 -
110609 - Line 560, ref OF 3 1979, -label dmsRght, moved code from 04703 for DMS
110610 - so it uses macro 54.  Was able to do this because of consolidating
110611 - other code.
110612 -
110613 - Line 90, ref OF 1 2762, -label bT015, added this call to macro 54, so
110614 - that when the file is scrolled to column 1 to the file diagnostics
110615 - field, the line number field is updated.  This makes sense, because
110616 - it avoids having to remember to update a line number field.
110617 -
110618 - Line 220, ref OF 1 1161, -label bTpf031 in 04703, unplugged special
110619 - assignments for F7 and F8 in DMS because the standard code for macro
110620 - 54 which is assigned to F7 now does this function.
110621 -
110622 - Line 650, ref OF 3 1517, -label dmsLft, added code in macro 54 to
110623 - manage the cursor in DMS file narrative field, so if the cursor is
110624 - right of the left text margin, then F7 moves the cursor to the left
110625 - margin, and if the cursor is on the left margin in the narrative
110626 - field, F7 shifts the file to the file diagnostics field.
110627 -
110628 - Line 800, ref OF 3 2817, -label nSDsi, made major revision to code for
110629 - the F7 function that calls macro 54 to set the left margin, including
110630 - evaluate the SDS outlining feature.
110631 -
110632 -  ..
110633 -
110634 - Line 860, ref OF 3 2716, -label evlM, developed alternate methods for
110635 - evaluating location in SDS records to avoid justifying control fields
110636 - and Reference, Contacts and record description.  People, especially
110637 - new users, who are nervous about using the keys, can use Alt F9 by
110638 - accident, and so would like to have code that jumps out of justify to
110639 - avoid messing up non-narrative fields.
110640 -
110641 -     The first method does strcnt 2 2 on the line number field and if
110642 -     the number is less than 4, it is not a narrative field. This
110643 -     method crashes when the line number has gone to alhpa-nums to
110644 -     exceed 100 subjects.
110645 -
110646 -     Tried using the char read macro 1182.  This works, but the overall
110647 -     code caused a compile error message that code is at or near 64K
110648 -     segment limit.
110649 -     ..
110650 -     Therefore, I unplugged the whole thing.
110651 -
110652 -     It is a limited risk, and really none at all for experienced users
110653 -     because there is no reason to use Alt F9 to justify anything but
110654 -     narrative text.
110655 -
110656 -  ..
110657 -
110658 - Line 970, ref OF 3 2974, -label outLne, changed method of establishing
110659 - an outline structure.  Will use char read macro 1182.  If last char is
110660 - a dot or a closing parenthesis and if the char above and below is a
110661 - space, then it is an outline.
110662 -
110663 -     [On 981121 modified code to consider HTML anchors as blank lines
110664 -     for purpose of evaluating outline structure. ref SDS 10 7335]
110665 -
110666 -
1107 -

SUBJECTS
Split and Join
Memory Management

1305 -
130501 -  ..
130502 - 000001  Change split and join, Eliminate Cut File
130503 -
130504 - Line 1650, ref OF 2 6311, -entry 34, Changed split within margins to
130505 - use a regular split and then shift the data from column 1 to the left
130506 - margin with immed >, instead of using cut and paste.
130507 -
130508 - Used code developed for justify to capture the line number field on
130509 - the current line, and insert on the new line created by the split
130510 - after executing the line shift to the left margin column.
130511 -    ..
130512 -    Since justify was changed to use this macro 34, it no longer
130513 -    needed code to manage the line number, so I moved that code from
130514 -    macro 54 to this macro 34. ref SDS 0 3200
130515 -
130516 - These changes saved a lot of code because we replaced a complicated
130517 - cut and paste operation with a very simple algorithm.
130518 -
130519 -  ..
130520 -
130521 - Line 1740, ref OF 2 4755, -label nSDSe, added color command to avoid
130522 - passing highlight colors to other lines by justify operation.  Need
130523 - separate colors for current and archive records.
130524 -
130525 -
130526 -
130527 -
1306 -

SUBJECTS
Insert, 921023

1404 -
140401 -  ..
140402 - 000001  Insert needs to be fixed
140403 -
140404 - Line 1790, ref OF 2 2592, -entry 341 seems to be messed up as a result
140405 - of fixing justify, ref SDS 0 0809, and split within margins. ref SDS 0
140406 - 1121
140407 -
140408 - Fixed it and was able to remove about 12 lines of code by changing the
140409 - concept of the design.
140410 -
140411 -
140412 -
140413 -
1405 -