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: October 22, 2003 05:13 AM Wednesday; Rod Welch

SDS improved memory by eliminating cut and paste to manage menu screens.

1...Summary/Objective
2...Menu System Saves Memory by Eliminating Cut & Paste
3...000003 Macro 80 Manages Menu System
4...Enter in Menu Macro
5...Enter in Menus to Execute Functions
6...Tab in Menu Macro 810
7...ESC from Menu Macro 894
8...Menu Error When Multiple Files in Memory


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

CONTACTS 

SUBJECTS
Cut & Paste Reduced from Report Operations to Improve Memory Manageme
Cut & Paste active, 910528
Cut & Paste Eliminate from Menu System to Improve Memory Management
Menu Screens Managed by New System Replaces Cut & Paste Macro 80
Menu System Changed Code from Using Cut and Paste to Avoid 2K Overhea

0807 -
0807 -    ..
0808 - Summary/Objective
0809 -
080901 - Follow up ref SDS 2 4W8F.
080902 -
080903 - Over the next couple of days, made a major improvement to the menu
080904 - system by eliminating cut and paste for managing screens.  This
080905 - continues prior work over the past five (5) years eliminating cut and
080906 - paste from SDS code, because it works differently from other SDS files
080907 - in a way that has adverse impacts on memory and program reliability.
080908 - Tried several design schemes and finally settled on a method that
080909 - reduced the size of the code considerably.  An added benefit of this
080910 - change is to reduce memory and recover some compiler space, so there
080911 - is room to do other things.
080912 -
080913 -
080914 -
080915 -
080917 -  ..
0810 -
0811 -
0812 - Planning
0813 -
081301 - Menu System Saves Memory by Eliminating Cut & Paste
081302 -
081303 - Background.
081304 -
081305 -    On 021014 eliminated using cut and paste in the subject report
081306 -    system. ref SDS 2 4W8F
081308 -  ..
081309 - Decided to change the design of the menu system that up until now has
081310 - used cut and paste to control screen changes.  On 030920 developed a
081311 - different system using the copy and move commands to replace cut and
081312 - paste for managing menu screens. ref SDS 1 XR5K  This saves memory,
081313 - and further stabalizes the program.
081315 -  ..
081316 - The new system using copy and move commands, reduced code requirements
081317 - by about 40%.  After creating the new system with copy and move
081318 - commands, was able to refine the code by using a scheme with repeat
081319 - and delete commands instead of copy and move, and this reduced the
081320 - code by nearly 80%.  This saves memory, improves program speed,
081321 - increases reliability and reduces maintenance.  Additionally, seem to
081322 - have recovered about 2K of compiler space.
081323 -
081324 -
081325 -
081326 -
081327 -
081329 -  ..
0814 -
0815 -
0816 - Progress
081701 -  ..
081702 - 000003  Macro 80 Manages Menu System
081703 -
081704 - Line 230, ref OF 2 I63N, -entry 80 in 000003 about 80 lines below
081705 -
081706 -    setcnt 1 0
081707 -    macro 806
081708 -
081709 -        Counter 1 is primary control to establish which menu level is
081710 -        active.  macro 806 currently manages the menu screens by using
081711 -        cut and paste.  This method is replaced today, as shown below.
081712 -        ref SDS 0 5H8H
081713 -
081714 -
081716 -  ..
081717 - Line 410, ref OF 2 5L3H, -entry 806 in 000003
081718 -
081719 -    macro 20
081720 -    -if @1 = 2 macro 18
081721 -    -if @1 = 3 macro 16
081722 -    loc_cur 3 1
081723 -     -gosub ulxx
081724 -    addcnt 1 1
081725 -    -if @1 = 2 -exit
081726 -
081727 -         Save each screen and increment for assigning save ops.
081728 -
081730 -  ..
081731 - Line 450, ref OF 2 8O5L, -entry 806 in 000003 about 60 lines below
081733 -  ..
081734 - This is the main new code added that replaces the prior method of cut
081735 - and paste.
081736 -
081737 -    -if @60 = 1 immed r
081738 -    -if @60 = 1 up
081739 -    immed cc
081740 -    linecnt 99 0
081741 -    up 30
081742 -    -if @0 = 0 -goto tfhel
081743 -
081744 -        Counter 60 is captured each pass to get the line number at
081745 -        the top of the screen.  If 60 = 1 then need to duplicate the
081746 -        line and work from the next line in order to restore the
081747 -        screen with the target command at the top of the file.
081749 -     ..
081750 -    setcnt 0 0
081751 -    linecnt 100 0
081752 -    immed 40a
081753 -    subcnt 100 @99
081754 -    setcnt 99 30
081755 -    subcnt 99 @100
081756 -    up @99
081757 -
081758 -    -label tfhel
081759 -    down 5
081760 -    immed cc
081762 -     ..
081763 -    up 5
081764 -    immed t
081765 -    linecnt 110 0
081766 -     -return
081767 -
081769 -  ..
081770 - Enter in Menu Macro
081771 -
081772 - Line 720, ref OF 2 BR3F, -label regmnu in 000003
081773 -
081774 -    macro 806
081775 -
081776 -        Save screen.  We need a flag so that on this pass the thing
081777 -        does not save the screen, since everything is already saved.
081778 -        Have to somehow use counter 1.
081779 -
081780 -
081781 -
081783 -  ..
081784 - Enter in Menus to Execute Functions
081785 -
081786 - Line 1030, ref OF 2 7950, -entry 810 in 000003
081787 -
081788 -    Enter and click to execute functions in menus.
081789 -
081790 -    In the Editor menu, the code scrolls forward to the next level
081791 -
081792 -
081793 -
081795 -  ..
081796 - Tab in Menu Macro 810
081797 -
081798 - Line 500, ref OF 2 8W5G, -entry 808 in 000003
081799 -
081800 -    -entry 808
081801 -    macro 803
081802 -    macro 801
081803 -    -if @47 != 1 -if @5 = 80 -exit
081804 -
081805 -
081806 -
081807 -
081808 -
081810 -  ..
081811 - ESC from Menu Macro 894
081812 -
081813 - Line 1460, ref OF 2 QB7H, -label over in 000003
081814 -
081815 -    -label over
081816 -    line @100
081817 -    up
081818 -    -if @2 = 2 up 25
081819 -    -if @2 = 3 up 50
081820 -    immed mm
081822 -     ..
081823 -    up 25
081824 -    immed mm
081826 -     ..
081827 -    rel_cur 1 0
081829 -      ..
081830 -
081831 -                     If this is the ESC key then 1 = 1 so delete all
081832 -                     extra menu lines
081833 -
081834 -    -if @2 = 1 down 25
081835 -    -if @2 = 2 down 50
081836 -
081837 -                     Delete to end of file to remove all menus.
081839 -     ..
081840 -    immed 999d
081842 -     ..
081843 -    macro 23
081844 -    loc_cur 3 1
081845 -    up
081847 -     ..
081848 -    immed 26d
081850 -     ..
081851 -    down
081852 -    immed t
081853 -                   Delete menu line
081854 -    immed d
081855 -
081856 -
081857 -                     If lines were added by macro 806 to create the first menu,
081858 -                     then delete these extra lines as well.
081859 -
081860 -    -if @111 > 0 line @111
081861 -
081862 -    -if @111 > 0 immed 40d
081863 -
081864 -
081866 -                   ..
081867 -                  Restore prior condition
081869 -     ..
081870 -    subcnt 1 1
081871 -    -if @1 = 1 macro 21
081872 -    -if @1 = 2 macro 19
081873 -    -if @1 = 3 macro 18
081874 -
081875 -                            Do the main heading again.
081876 -
081877 -    -if @1 = 1 -goto onej
081879 -                             ..
081880 -                            Level 2 has special situation.
081881 -
081882 -    -if @1 = 2 pft macro 808
081883 -
081884 -    -if @1 > 0 -exit
081885 -
081886 -
081888 -  ..
081889 - Menu Error When Multiple Files in Memory
081890 -
081891 - Macro file 050403 is no longer needed. ref OF 1 RO5K
081892 -
081893 -    New scheme can eliminate this issue and also eliminate macro 805
081894 -    in 000003.
081895 -
081896 -
081897 -
081898 -
081899 -
081900 -
081901 -
081902 -
081903 -
0820 -