Home » Personal collection » Acorn ADFS disks » Greaseweazled » adfs_PC_Emulator_1.adf » !Merge/!RunImage

!Merge/!RunImage

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Greaseweazled » adfs_PC_Emulator_1.adf
Filename: !Merge/!RunImage
Read OK:
File size: 2120 bytes
Load address: FFFFFB43
Exec address: 17719DF0
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM > !RunImage
   20REM Authors : Neil Gardner, Updates by James Bye, Tony Sumner, Martin Neville-Smith
   30version$="1.05 (25-Apr-91)"
   40PROCinitialise
   50ON ERROR PROCerror
   60REPEAT
   70 SYS"Wimp_Poll",0,q1% TO r%
   80 CASE r% OF
   90 WHEN 0    : IFstage%=3 PROCcopy_files
  100 WHEN 2    : SYS"Wimp_OpenWindow",,q1%
  110 WHEN 3    : SYS"Wimp_CloseWindow",,q1%
  120             IF!q1%=SysUpdate% PROCshutdown:END
  130 WHEN 6    : PROCmouseclick
  140 WHEN 7    : PROCdecodedrag
  150 WHEN 9    : PROCmenuselect
  160 WHEN 17,18: PROCreceive(r%)
  170 ENDCASE
  180UNTIL FALSE
  190END
  200:
  210DEFPROCinitialise
  220error_flag%=3
  230DIM ws% 2048:wsend%=ws%+2048
  240DIM menufree% 256:menuend%=menufree%+256
  250DIM q1% 256, q2% 512
  260SYS"Wimp_Initialise",200,&4B534154,"Merge"
  270SYS"Wimp_OpenTemplate",,"<SysUpdate$Dir>.Templates"
  280SYS"Wimp_LoadTemplate",,q2%,ws%,wsend%,-1,"info",0 TO ,,ws%
  290$(q2%!(88+96+20))=version$
  300SYS"Wimp_CreateWindow",,q2% TO info%
  310SYS"Wimp_LoadTemplate",,q2%,ws%,wsend%,-1,"system",0 TO ,,ws%,,,,r6%
  320file1%=q2%!(88+64+20)
  330file2%=q2%!(88+96+20)
  340prompt%=q2%!(88+128+20)
  350SYS"Wimp_CreateWindow",,q2% TO SysUpdate%
  360SYS"Wimp_CloseTemplate"
  370mainmenu%=FNcrmenu
  380 DATA"#Merge,Info>info%,Quit"
  390PROCinit_sys_window
  400saveref%=0
  410error_flag%=3
  420PROCgetmodeinfo
  430!q1%=SysUpdate%:SYS"Wimp_GetWindowState",,q1%:SYS"Wimp_OpenWindow",,q1%
  440ENDPROC
  450:
  460DEFPROCinit_sys_window
  470$file1%=""
  480$file2%=""
  490$prompt%="Drag the original application into this window."
  500stage%=1
  510PROCrefresh_sys_window
  520ENDPROC
  530:
  540DEFPROCgetmodeinfo
  550q1%!0 = 4
  560q1%!4 = 5
  570q1%!8 = 11
  580q1%!12= 12
  590q1%!16= -1
  600SYS"OS_ReadVduVariables",q1%,q1%+20
  610dx%=1<<(q1%!20)
  620dy%=1<<(q1%!24)
  630scrx1%=(q1%!28+1)*dx%
  640scry1%=(q1%!32+1)*dy%
  650ENDPROC
  660:
  670DEFPROCmouseclick
  680LOCAL p%
  690CASEq1%!8 OF
  700WHEN2:   IFq1%!12=SysUpdate% PROCdomenu(mainmenu%,!q1%-64,q1%!4)
  710ENDCASE
  720ENDPROC
  730:
  740DEFPROCdecodedrag
  750LOCAL f1%,f2%,h%,i%,mx%,my%,ext%
  760f1%=OPENIN("<SysUpdate$Dir>.Output"):ext%=EXT#f1%:CLOSE#f1%
  770f1%=filename%
  780REPEAT
  790 f2%=f1%
  800 f1%+=INSTR($f1%,".")
  810UNTIL f1%=f2%
  820SYS"Wimp_GetPointerInfo",,q1%
  830mx%=!q1%
  840my%=q1%!4
  850h%=q1%!12
  860i%=q1%!16
  870!q1%=(48+LEN$f1%)ANDNOT3
  880q1%!12=0
  890q1%!16=1
  900q1%!20=h%
  910q1%!24=i%
  920q1%!28=mx%
  930q1%!32=my%
  940q1%!36=ext%
  950q1%!40=&FFF
  960$(q1%+44)=$f1%
  970?(q1%+44+LEN$(q1%+44))=0
  980SYS"Wimp_SendMessage",17,q1%,h%,i%
  990saveref%=q1%!8
 1000ENDPROC
 1010:
 1020DEFPROCdomenu(h%,x%,y%)
 1030menudata%=h%:menux%=x%:menuy%=y%
 1040SYS"Wimp_CreateMenu",,h%,x%,y%
 1050ENDPROC
 1060:
 1070DEFPROCmenuselect
 1080LOCAL a$,i%
 1090SYS"Wimp_DecodeMenu",,menudata%,q1%,STRING$(200," ") TO ,,,a$
 1100IFa$="" ENDPROC
 1110IFa$="Quit" PROCshutdown:END
 1120ENDPROC
 1130:
 1140DEFFNrtoz(p%)
 1150LOCAL q$
 1160WHILE ?p%<>0 q$+=CHR$?p%:p%+=1:ENDWHILE
 1170=q$
 1180:
 1190DEFPROCreceive(r%)
 1200LOCAL name$,i%,x%,result%
 1210CASE q1%!16 OF
 1220WHEN0: PROCshutdown:END
 1230WHEN1: REM file dropped from application - return filename
 1240       PROCok("Application data cannot be merged")
 1250       ENDPROC
 1260WHEN3: REM file dropped from Filer - identify object
 1270  CASE stage% OF
 1280  WHEN1: PROCcheck_type
 1290         $file1%=FNrtoz(q1%+44)
 1300         $prompt%="Drag the new application into this window"
 1310         PROCrefresh_sys_window
 1320         stage%=2
 1330  WHEN2: PROCcheck_type
 1340         $file2%=FNrtoz(q1%+44)                  
 1350         result% = FNcheck_leaf($file1%,$file2%)
 1360         IF result% = 1 THEN
 1370            PROCinit_sys_window
 1380            PROCok("You can only merge applications of the same name")
 1390            $file2%=""
 1400         ENDIF
 1410         IF$file1%=$file2% THEN
 1420          PROCinit_sys_window
 1430          PROCok("The applications are identical")
 1440         ENDIF
 1450         $prompt%="Please wait ... processing files"
 1460         PROCrefresh_sys_window
 1470         stage%=3
 1480  ENDCASE
 1490WHEN&502: PROCinteractive_help
 1500WHEN&400C1: PROCgetmodeinfo
 1510ENDCASE
 1520ENDPROC
 1530:
 1540DEFPROCinteractive_help
 1550LOCAL t$
 1560CASE q1%!32 OF
 1570WHENSysUpdate%: t$="This is the Merge window.|M"
 1580 CASE stage% OF
 1590 WHEN1: t$+="Drop the original application on it."
 1600 WHEN2: t$+="Drop the new application on it."
 1610 WHEN4: t$+="Application update was successful.|MClick SELECT on close icon to quit."
 1620 ENDCASE
 1630ENDCASE
 1640IFt$<>"" THEN
 1650 q1%!12=q1%!8
 1660 q1%!16=&503
 1670 $(q1%+20)=t$+CHR$0
 1680 !q1%=(25+LENt$)ANDNOT3
 1690 SYS"Wimp_SendMessage",17,q1%,q1%!4
 1700ENDIF
 1710ENDPROC
 1720:
 1730DEFPROCcheck_type
 1740IFq1%!40<>&2000 THEN PROCok("This is not an application directory")
 1750ENDPROC
 1760:
 1770DEFPROCrefresh_sys_window
 1780!q2%=SysUpdate%:q2%!4=2:q2%!8=0:q2%!12=0:SYS"Wimp_SetIconState",,q2%
 1790!q2%=SysUpdate%:q2%!4=3:q2%!8=0:q2%!12=0:SYS"Wimp_SetIconState",,q2%
 1800!q2%=SysUpdate%:q2%!4=4:q2%!8=0:q2%!12=0:SYS"Wimp_SetIconState",,q2%
 1810ENDPROC
 1820:
 1830DEFPROCshutdown
 1840SYS"Wimp_CloseDown"
 1850ENDPROC
 1860:
 1870DEFPROCerror
 1880IFerror_flag%=3 THEN
 1890 PROCerrorbox("Unexpected error :- "+REPORT$+" ("+STR$(ERL)+")")
 1900ELSE
 1910 PROCerrorbox(REPORT$)
 1920ENDIF
 1930error_flag%=3
 1940ENDPROC
 1950:
 1960DEFPROCok(e$)
 1970error_flag%=1
 1980ERROR 1,e$
 1990ENDPROC
 2000:
 2010DEFPROCfatal(e$)
 2020error_flag%=2
 2030ERROR 1,e$
 2040ENDPROC
 2050:
 2060DEFPROCerrorbox(r$)
 2070LOCAL r%
 2080!q1%=ERR:$(q1%+4)=r$+CHR$0
 2090SYS"Wimp_ReportError",q1%,error_flag%,"Merge utility" TO ,r%
 2100IFr%=2 SYS"Wimp_CloseDown":END
 2110ENDPROC
 2120:
 2130DEFFNcrmenu
 2140LOCAL m%,menu$,m$
 2150IF (menufree%+28>menuend%) PROCfatal("Menu area full")
 2160READ menu$
 2170WHILE RIGHT$(menu$,2)="++"
 2180 READ m$
 2190 menu$=LEFT$(menu$,LENmenu$-2)+m$
 2200ENDWHILE
 2210menuptr%=menufree%
 2220i%=0
 2230IF LEFT$(menu$,1)="#" i%=1:menutitle$=FNpar(",") ELSE menutitle$=""
 2240$menuptr%=menutitle$
 2250menuptr%?12=7
 2260menuptr%?13=2
 2270menuptr%?14=7
 2280menuptr%?15=1
 2290menuptr%!16=196
 2300menuptr%!20=44
 2310menuptr%!24=0
 2320menuptr%+=28
 2330maxx%=LENmenutitle$-3
 2340REPEAT
 2350 item$=FNpar(",")
 2360 PROCmenuitem(item$)
 2370UNTIL item$=""
 2380m%=menufree%
 2390m%!16=(maxx%*8+6)*2
 2400menufree%=menuptr%
 2410=m%
 2420:
 2430DEFPROCmenuitem(text$)
 2440LOCAL i%,flg%,subptr%,L%
 2450IF text$="" menuptr%!-24=(menuptr%!-24)OR&80:ENDPROC
 2460IF (menuptr%+24>menuend%) PROCfatal("Menu area full")
 2470flg%=&00
 2480i%=INSTR(text$,">")
 2490IF i%>0 THEN
 2500 subptr%=EVALMID$(text$,i%+1)
 2510 text$=LEFT$(text$,i%-1)
 2520ELSE
 2530 subptr%=-1
 2540ENDIF
 2550IF RIGHT$(text$,1)="#" text$=LEFT$(text$,LENtext$-1):flg%+=&02
 2560menuptr%!0=flg%
 2570menuptr%!4=subptr%
 2580menuptr%!8=&07000021
 2590IF LEFT$(text$,1)="$" THEN
 2600 !menuptr%+=&04
 2610 menuptr%!8+=&100
 2620 i%=INSTR(text$,"(")
 2630 IF i%>0 THEN
 2640  L%=VALMID$(text$,i%+1)
 2650  text$=LEFT$(text$,i%-1)
 2660 ELSE
 2670  L%=12
 2680 ENDIF
 2690 menuptr%!12=EVALMID$(text$,2)
 2700 menuptr%!16=-1
 2710 menuptr%!20=L%
 2720 IFL%>16 L%=16
 2730 text$=STRING$(L%," ")
 2740ELSE
 2750 IFLENtext$<=12THEN
 2760  $(menuptr%+12)=text$
 2770 ELSE
 2780  I%=FNworkspace(LENtext$+1):$I%=text$
 2790  menuptr%!12=I%:menuptr%!16=-1:menuptr%!20=LENtext$+1
 2800  menuptr%!8=menuptr%!8 OR &100
 2810 ENDIF
 2820ENDIF
 2830IF LENtext$>maxx% maxx%=LENtext$
 2840menuptr%+=24
 2850ENDPROC
 2860:
 2870DEFFNpar(sep$)
 2880LOCAL i1%
 2890i1%=i%+1
 2900i%=INSTR(menu$+sep$,sep$,i1%)
 2910=MID$(menu$,i1%,i%-i1%)
 2920:
 2930DEFPROCshade(menuhandle%,item%)
 2940menuhandle%!(28+8+24*item%)=menuhandle%!(28+8+24*item%)EOR&400000
 2950ENDPROC
 2960:
 2970DEFFNshade_status(menuhandle%,item%)
 2980= -((menuhandle%!(28+8+24*item%) AND &400000)=&400000)
 2990:
 3000DEFPROCset_shade(menuhandle%,item%,value%)
 3010IFFNshade_status(menuhandle%,item%)<>value% PROCshade(menuhandle%,item%)
 3020ENDPROC
 3030:
 3040DEFPROCtick(menuhandle%,item%)
 3050menuhandle%!(28+24*item%)=menuhandle%!(28+24*item%)EOR1
 3060ENDPROC
 3070:
 3080DEFFNtick_status(menuhandle%,item%)
 3090= menuhandle%!(28+24*item%)AND1
 3100:
 3110DEFPROCset_tick(menuhandle%,item%,value%)
 3120IFFNtick_status(menuhandle%,item%)<>value% PROCtick(menuhandle%,item%)
 3130ENDPROC
 3140:
 3150DEFFNworkspace(L%)
 3160IF curws%+L%>ws%+maxws% THEN PROCfatal("No more workspace")
 3170curws%+=L%
 3180=curws%-L%
 3190:
 3200DEFPROCcopy_files
 3210SYS"Hourglass_On"
 3220SYS"XOS_FSControl",26,$file2%,$file1%,%101000000000011 TO r0%;reg%
 3230IF (reg%AND 1)=1 THEN
 3240 error_flag%=1:PROCerrorbox(FNrtoz(r0%+4)):error_flag%=3
 3250 $file1%=""
 3260 $file2%=""
 3270 $prompt%="Application update failed.  Correct the problem then drag the original application into this window."
 3280 stage%=1
 3290 PROCrefresh_sys_window
 3300 ENDPROC
 3310ENDIF
 3320REM OSCLI"copy "+$file2%+" "+$file1%+" rnf~c~va~dl~p~q~s~t"1
 3330stage%=4
 3340$prompt%="Application updated."
 3350PROCrefresh_sys_window
 3360SYS"Hourglass_Off"
 3370ENDPROC
 3380:
 3390DEFFNupper(str$)
 3400LOCALrtn$, l%, c$
 3410rtn$=""
 3420FOR l%=1 TO LENstr$
 3430  c$=MID$(str$,l%,1)
 3440  IF c$>="a" AND c$<="z" THEN
 3450     rtn$+=CHR$(ASCc$EOR&20)
 3460  ELSE
 3470     rtn$+=c$
 3480  ENDIF
 3490NEXT
 3500=rtn$
 3510:
 3520DEFFNcheck_leaf(filename1$,filename2$)
 3530REM Checks that the 2 filenames refer to the same app
 3540REM This is a bit of a hack
 3550LOCAL I%,size%,index%,result%,name1$,name2$,c$
 3560result%=0
 3570size%=LEN(filename1$)
 3580I%=size% 
 3590index%=0
 3600c$=MID$(filename1$,I%,1)
 3610WHILE c$ <> "." 
 3620  I%=I%-1
 3630  index=index+1
 3640  c$=MID$(filename1$,I%,1)
 3650ENDWHILE                  
 3660name1$ = MID$(filename1$,I%+1,size%-I%)
 3670size%=LEN(filename2$)
 3680I%=size% 
 3690index%=0
 3700c$=MID$(filename2$,I%,1)
 3710WHILE c$ <> "." 
 3720  I%=I%-1
 3730  index=index+1
 3740  c$=MID$(filename2$,I%,1)
 3750ENDWHILE                  
 3760name2$ = MID$(filename2$,I%+1,size%-I%)
 3770IF name1$ <> name2$ THEN result%=1 ELSE result%=0
 3780=result%
 3790
 3800
 3810
 3820  
 3830

� > !RunImage
U� Authors : Neil Gardner, Updates by James Bye, Tony Sumner, Martin Neville-Smith
version$="1.05 (25-Apr-91)"
(�initialise
2� � �error
<�
F ș"Wimp_Poll",0,q1% � r%
P Ȏ r% �
Z# � 0    : �stage%=3 �copy_files
d& � 2    : ș"Wimp_OpenWindow",,q1%
n' � 3    : ș"Wimp_CloseWindow",,q1%
x-             �!q1%=SysUpdate% �shutdown:�
� � 6    : �mouseclick
� � 7    : �decodedrag
� � 9    : �menuselect
� � 17,18: �receive(r%)
� �
�� �
��
�:
���initialise
�error_flag%=3
�� ws% 2048:wsend%=ws%+2048
�*� menufree% 256:menuend%=menufree%+256
�� q1% 256, q2% 512
-ș"Wimp_Initialise",200,&4B534154,"Merge"
6ș"Wimp_OpenTemplate",,"<SysUpdate$Dir>.Templates"
=ș"Wimp_LoadTemplate",,q2%,ws%,wsend%,-1,"info",0 � ,,ws%
"$(q2%!(88+96+20))=version$
,&ș"Wimp_CreateWindow",,q2% � info%
6Fș"Wimp_LoadTemplate",,q2%,ws%,wsend%,-1,"system",0 � ,,ws%,,,,r6%
@file1%=q2%!(88+64+20)
Jfile2%=q2%!(88+96+20)
Tprompt%=q2%!(88+128+20)
^+ș"Wimp_CreateWindow",,q2% � SysUpdate%
hș"Wimp_CloseTemplate"
rmainmenu%=�crmenu
| �"#Merge,Info>info%,Quit"
��init_sys_window
�saveref%=0
�error_flag%=3
��getmodeinfo
�I!q1%=SysUpdate%:ș"Wimp_GetWindowState",,q1%:ș"Wimp_OpenWindow",,q1%
��
�:
���init_sys_window
�$file1%=""
�$file2%=""
�>$prompt%="Drag the original application into this window."
�stage%=1
��refresh_sys_window
�
:
��getmodeinfo
&
q1%!0 = 4
0
q1%!4 = 5
:q1%!8 = 11
Dq1%!12= 12
Nq1%!16= -1
X&ș"OS_ReadVduVariables",q1%,q1%+20
bdx%=1<<(q1%!20)
ldy%=1<<(q1%!24)
vscrx1%=(q1%!28+1)*dx%
�scry1%=(q1%!32+1)*dy%
��
�:
���mouseclick
�� p%
�
Ȏq1%!8 �
�=�2:   �q1%!12=SysUpdate% �domenu(mainmenu%,!q1%-64,q1%!4)
��
��
�:
���decodedrag
� � f1%,f2%,h%,i%,mx%,my%,ext%
�4f1%=�("<SysUpdate$Dir>.Output"):ext%=�#f1%:�#f1%
f1%=filename%
�
 f2%=f1%
  f1%+=�$f1%,".")
*
� f1%=f2%
4 ș"Wimp_GetPointerInfo",,q1%
>mx%=!q1%
H
my%=q1%!4
R
h%=q1%!12
\
i%=q1%!16
f!q1%=(48+�$f1%)��3
pq1%!12=0
zq1%!16=1
�
q1%!20=h%
�
q1%!24=i%
�q1%!28=mx%
�q1%!32=my%
�q1%!36=ext%
�q1%!40=&FFF
�$(q1%+44)=$f1%
�?(q1%+44+�$(q1%+44))=0
�%ș"Wimp_SendMessage",17,q1%,h%,i%
�saveref%=q1%!8
��
�:
���domenu(h%,x%,y%)
$menudata%=h%:menux%=x%:menuy%=y%
!ș"Wimp_CreateMenu",,h%,x%,y%
�
$:
.��menuselect
8� a$,i%
B8ș"Wimp_DecodeMenu",,menudata%,q1%,�200," ") � ,,,a$
L�a$="" �
V�a$="Quit" �shutdown:�
`�
j:
tݤrtoz(p%)
~� q$
�ȕ ?p%<>0 q$+=�?p%:p%+=1:�
�=q$
�:
���receive(r%)
�� name$,i%,x%,result%
�Ȏ q1%!16 �
��0: �shutdown:�
�9�1: � file dropped from application - return filename
�3       �ok("Application data cannot be merged")
�       �
�3�3: � file dropped from Filer - identify object
�  Ȏ stage% �
  �1: �check_type

"         $file1%=�rtoz(q1%+44)
A         $prompt%="Drag the new application into this window"
          �refresh_sys_window
(         stage%=2
2  �2: �check_type
<4         $file2%=�rtoz(q1%+44)                  
F3         result% = �check_leaf($file1%,$file2%)
P         � result% = 1 �
Z             �init_sys_window
dG            �ok("You can only merge applications of the same name")
n            $file2%=""
x         �
�         �$file1%=$file2% �
�          �init_sys_window
�3          �ok("The applications are identical")
�         �
�8         $prompt%="Please wait ... processing files"
�          �refresh_sys_window
�         stage%=3
�  �
��&502: �interactive_help
��&400C1: �getmodeinfo
��
��
�:
��interactive_help
� t$
Ȏ q1%!32 �
"1�SysUpdate%: t$="This is the Merge window.|M"
, Ȏ stage% �
63 �1: t$+="Drop the original application on it."
@. �2: t$+="Drop the new application on it."
JV �4: t$+="Application update was successful.|MClick SELECT on close icon to quit."
T �
^�
h
�t$<>"" �
r q1%!12=q1%!8
| q1%!16=&503
� $(q1%+20)=t$+�0
� !q1%=(25+�t$)��3
�& ș"Wimp_SendMessage",17,q1%,q1%!4
��
��
�:
���check_type
�@�q1%!40<>&2000 � �ok("This is not an application directory")
��
�:
���refresh_sys_window
�G!q2%=SysUpdate%:q2%!4=2:q2%!8=0:q2%!12=0:ș"Wimp_SetIconState",,q2%
�G!q2%=SysUpdate%:q2%!4=3:q2%!8=0:q2%!12=0:ș"Wimp_SetIconState",,q2%
G!q2%=SysUpdate%:q2%!4=4:q2%!8=0:q2%!12=0:ș"Wimp_SetIconState",,q2%
�
:
&��shutdown
0ș"Wimp_CloseDown"
:�
D:
N��error
X�error_flag%=3 �
b7 �errorbox("Unexpected error :- "+�$+" ("+�(�)+")")
l�
v �errorbox(�$)
��
�error_flag%=3
��
�:
���ok(e$)
�error_flag%=1
�
� 1,e$
��
�:
���fatal(e$)
�error_flag%=2
�
� 1,e$
��
:
��errorbox(r$)
� r%
 !q1%=�:$(q1%+4)=r$+�0
*>ș"Wimp_ReportError",q1%,error_flag%,"Merge utility" � ,r%
4�r%=2 ș"Wimp_CloseDown":�
>�
H:
Rݤcrmenu
\� m%,menu$,m$
f6� (menufree%+28>menuend%) �fatal("Menu area full")
p� menu$
zȕ �menu$,2)="++"
�	 � m$
� menu$=�menu$,�menu$-2)+m$
��
�menuptr%=menufree%
�i%=0
�=� �menu$,1)="#" i%=1:menutitle$=�par(",") � menutitle$=""
�$menuptr%=menutitle$
�menuptr%?12=7
�menuptr%?13=2
�menuptr%?14=7
�menuptr%?15=1
�menuptr%!16=196
�menuptr%!20=44
	menuptr%!24=0
	menuptr%+=28
	maxx%=�menutitle$-3
	$�
	. item$=�par(",")
	8 �menuitem(item$)
	B� item$=""
	Lm%=menufree%
	Vm%!16=(maxx%*8+6)*2
	`menufree%=menuptr%
	j=m%
	t:
	~��menuitem(text$)
	�� i%,flg%,subptr%,L%
	�0� text$="" menuptr%!-24=(menuptr%!-24)�&80:�
	�5� (menuptr%+24>menuend%) �fatal("Menu area full")
	�flg%=&00
	�i%=�text$,">")
	�� i%>0 �
	� subptr%=��text$,i%+1)
	� text$=�text$,i%-1)
	��
	� subptr%=-1
	��
	�4� �text$,1)="#" text$=�text$,�text$-1):flg%+=&02
menuptr%!0=flg%

menuptr%!4=subptr%
menuptr%!8=&07000021
� �text$,1)="$" �
( !menuptr%+=&04
2 menuptr%!8+=&100
< i%=�text$,"(")
F
 � i%>0 �
P  L%=��text$,i%+1)
Z  text$=�text$,i%-1)
d �
n  L%=12
x �
� menuptr%!12=��text$,2)
� menuptr%!16=-1
� menuptr%!20=L%
� �L%>16 L%=16
� text$=�L%," ")
��
� �text$<=12�
�  $(menuptr%+12)=text$
� �
�'  I%=�workspace(�text$+1):$I%=text$
�8  menuptr%!12=I%:menuptr%!16=-1:menuptr%!20=�text$+1
�"  menuptr%!8=menuptr%!8 � &100
� �
�
� �text$>maxx% maxx%=�text$
menuptr%+=24
"�
,:
6ݤpar(sep$)
@	� i1%
Ji1%=i%+1
Ti%=�menu$+sep$,sep$,i1%)
^=�menu$,i1%,i%-i1%)
h:
r��shade(menuhandle%,item%)
|Cmenuhandle%!(28+8+24*item%)=menuhandle%!(28+8+24*item%)�&400000
��
�:
�%ݤshade_status(menuhandle%,item%)
�8= -((menuhandle%!(28+8+24*item%) � &400000)=&400000)
�:
�)��set_shade(menuhandle%,item%,value%)
�G�shade_status(menuhandle%,item%)<>value% �shade(menuhandle%,item%)
��
�:
���tick(menuhandle%,item%)
�9menuhandle%!(28+24*item%)=menuhandle%!(28+24*item%)�1
��
�:
$ݤtick_status(menuhandle%,item%)
!= menuhandle%!(28+24*item%)�1
:
&(��set_tick(menuhandle%,item%,value%)
0E�tick_status(menuhandle%,item%)<>value% �tick(menuhandle%,item%)
:�
D:
Nݤworkspace(L%)
X8� curws%+L%>ws%+maxws% � �fatal("No more workspace")
bcurws%+=L%
l=curws%-L%
v:
���copy_files
�ș"Hourglass_On"
�Dș"XOS_FSControl",26,$file2%,$file1%,%101000000000011 � r0%;reg%
�� (reg%� 1)=1 �
�8 error_flag%=1:�errorbox(�rtoz(r0%+4)):error_flag%=3
� $file1%=""
� $file2%=""
�t $prompt%="Application update failed.  Correct the problem then drag the original application into this window."
�
 stage%=1
� �refresh_sys_window
� �
��
�>� OSCLI"copy "+$file2%+" "+$file1%+" rnf~c~va~dl~p~q~s~t"1

stage%=4

#$prompt%="Application updated."

�refresh_sys_window

 ș"Hourglass_Off"

*�

4:

>ݤupper(str$)

H�rtn$, l%, c$

Rrtn$=""

\� l%=1 � �str$

f  c$=�str$,l%,1)

p  � c$>="a" � c$<="z" �

z     rtn$+=�(�c$�&20)

�  �

�     rtn$+=c$

�  �

��

�	=rtn$

�:

�'ݤcheck_leaf(filename1$,filename2$)

�7� Checks that the 2 filenames refer to the same app

�� This is a bit of a hack

�.� I%,size%,index%,result%,name1$,name2$,c$

�
result%=0

�size%=�(filename1$)

�
I%=size% 
index%=0
c$=�filename1$,I%,1)
ȕ c$ <> "." 
$
  I%=I%-1
.  index=index+1
8  c$=�filename1$,I%,1)
B�                  
L'name1$ = �filename1$,I%+1,size%-I%)
Vsize%=�(filename2$)
`
I%=size% 
jindex%=0
tc$=�filename2$,I%,1)
~ȕ c$ <> "." 
�
  I%=I%-1
�  index=index+1
�  c$=�filename2$,I%,1)
��                  
�'name2$ = �filename2$,I%+1,size%-I%)
�.� name1$ <> name2$ � result%=1 � result%=0
�=result%
�
�
�
�  
�
�
00000000  0d 00 0a 11 f4 20 3e 20  21 52 75 6e 49 6d 61 67  |..... > !RunImag|
00000010  65 0d 00 14 55 f4 20 41  75 74 68 6f 72 73 20 3a  |e...U. Authors :|
00000020  20 4e 65 69 6c 20 47 61  72 64 6e 65 72 2c 20 55  | Neil Gardner, U|
00000030  70 64 61 74 65 73 20 62  79 20 4a 61 6d 65 73 20  |pdates by James |
00000040  42 79 65 2c 20 54 6f 6e  79 20 53 75 6d 6e 65 72  |Bye, Tony Sumner|
00000050  2c 20 4d 61 72 74 69 6e  20 4e 65 76 69 6c 6c 65  |, Martin Neville|
00000060  2d 53 6d 69 74 68 0d 00  1e 1f 76 65 72 73 69 6f  |-Smith....versio|
00000070  6e 24 3d 22 31 2e 30 35  20 28 32 35 2d 41 70 72  |n$="1.05 (25-Apr|
00000080  2d 39 31 29 22 0d 00 28  0f f2 69 6e 69 74 69 61  |-91)"..(..initia|
00000090  6c 69 73 65 0d 00 32 0e  ee 20 85 20 f2 65 72 72  |lise..2.. . .err|
000000a0  6f 72 0d 00 3c 05 f5 0d  00 46 1d 20 c8 99 22 57  |or..<....F. .."W|
000000b0  69 6d 70 5f 50 6f 6c 6c  22 2c 30 2c 71 31 25 20  |imp_Poll",0,q1% |
000000c0  b8 20 72 25 0d 00 50 0c  20 c8 8e 20 72 25 20 ca  |. r%..P. .. r% .|
000000d0  0d 00 5a 23 20 c9 20 30  20 20 20 20 3a 20 e7 73  |..Z# . 0    : .s|
000000e0  74 61 67 65 25 3d 33 20  f2 63 6f 70 79 5f 66 69  |tage%=3 .copy_fi|
000000f0  6c 65 73 0d 00 64 26 20  c9 20 32 20 20 20 20 3a  |les..d& . 2    :|
00000100  20 c8 99 22 57 69 6d 70  5f 4f 70 65 6e 57 69 6e  | .."Wimp_OpenWin|
00000110  64 6f 77 22 2c 2c 71 31  25 0d 00 6e 27 20 c9 20  |dow",,q1%..n' . |
00000120  33 20 20 20 20 3a 20 c8  99 22 57 69 6d 70 5f 43  |3    : .."Wimp_C|
00000130  6c 6f 73 65 57 69 6e 64  6f 77 22 2c 2c 71 31 25  |loseWindow",,q1%|
00000140  0d 00 78 2d 20 20 20 20  20 20 20 20 20 20 20 20  |..x-            |
00000150  20 e7 21 71 31 25 3d 53  79 73 55 70 64 61 74 65  | .!q1%=SysUpdate|
00000160  25 20 f2 73 68 75 74 64  6f 77 6e 3a e0 0d 00 82  |% .shutdown:....|
00000170  19 20 c9 20 36 20 20 20  20 3a 20 f2 6d 6f 75 73  |. . 6    : .mous|
00000180  65 63 6c 69 63 6b 0d 00  8c 19 20 c9 20 37 20 20  |eclick.... . 7  |
00000190  20 20 3a 20 f2 64 65 63  6f 64 65 64 72 61 67 0d  |  : .decodedrag.|
000001a0  00 96 19 20 c9 20 39 20  20 20 20 3a 20 f2 6d 65  |... . 9    : .me|
000001b0  6e 75 73 65 6c 65 63 74  0d 00 a0 1a 20 c9 20 31  |nuselect.... . 1|
000001c0  37 2c 31 38 3a 20 f2 72  65 63 65 69 76 65 28 72  |7,18: .receive(r|
000001d0  25 29 0d 00 aa 06 20 cb  0d 00 b4 07 fd 20 a3 0d  |%).... ...... ..|
000001e0  00 be 05 e0 0d 00 c8 05  3a 0d 00 d2 10 dd f2 69  |........:......i|
000001f0  6e 69 74 69 61 6c 69 73  65 0d 00 dc 11 65 72 72  |nitialise....err|
00000200  6f 72 5f 66 6c 61 67 25  3d 33 0d 00 e6 1e de 20  |or_flag%=3..... |
00000210  77 73 25 20 32 30 34 38  3a 77 73 65 6e 64 25 3d  |ws% 2048:wsend%=|
00000220  77 73 25 2b 32 30 34 38  0d 00 f0 2a de 20 6d 65  |ws%+2048...*. me|
00000230  6e 75 66 72 65 65 25 20  32 35 36 3a 6d 65 6e 75  |nufree% 256:menu|
00000240  65 6e 64 25 3d 6d 65 6e  75 66 72 65 65 25 2b 32  |end%=menufree%+2|
00000250  35 36 0d 00 fa 16 de 20  71 31 25 20 32 35 36 2c  |56..... q1% 256,|
00000260  20 71 32 25 20 35 31 32  0d 01 04 2d c8 99 22 57  | q2% 512...-.."W|
00000270  69 6d 70 5f 49 6e 69 74  69 61 6c 69 73 65 22 2c  |imp_Initialise",|
00000280  32 30 30 2c 26 34 42 35  33 34 31 35 34 2c 22 4d  |200,&4B534154,"M|
00000290  65 72 67 65 22 0d 01 0e  36 c8 99 22 57 69 6d 70  |erge"...6.."Wimp|
000002a0  5f 4f 70 65 6e 54 65 6d  70 6c 61 74 65 22 2c 2c  |_OpenTemplate",,|
000002b0  22 3c 53 79 73 55 70 64  61 74 65 24 44 69 72 3e  |"<SysUpdate$Dir>|
000002c0  2e 54 65 6d 70 6c 61 74  65 73 22 0d 01 18 3d c8  |.Templates"...=.|
000002d0  99 22 57 69 6d 70 5f 4c  6f 61 64 54 65 6d 70 6c  |."Wimp_LoadTempl|
000002e0  61 74 65 22 2c 2c 71 32  25 2c 77 73 25 2c 77 73  |ate",,q2%,ws%,ws|
000002f0  65 6e 64 25 2c 2d 31 2c  22 69 6e 66 6f 22 2c 30  |end%,-1,"info",0|
00000300  20 b8 20 2c 2c 77 73 25  0d 01 22 1e 24 28 71 32  | . ,,ws%..".$(q2|
00000310  25 21 28 38 38 2b 39 36  2b 32 30 29 29 3d 76 65  |%!(88+96+20))=ve|
00000320  72 73 69 6f 6e 24 0d 01  2c 26 c8 99 22 57 69 6d  |rsion$..,&.."Wim|
00000330  70 5f 43 72 65 61 74 65  57 69 6e 64 6f 77 22 2c  |p_CreateWindow",|
00000340  2c 71 32 25 20 b8 20 69  6e 66 6f 25 0d 01 36 46  |,q2% . info%..6F|
00000350  c8 99 22 57 69 6d 70 5f  4c 6f 61 64 54 65 6d 70  |.."Wimp_LoadTemp|
00000360  6c 61 74 65 22 2c 2c 71  32 25 2c 77 73 25 2c 77  |late",,q2%,ws%,w|
00000370  73 65 6e 64 25 2c 2d 31  2c 22 73 79 73 74 65 6d  |send%,-1,"system|
00000380  22 2c 30 20 b8 20 2c 2c  77 73 25 2c 2c 2c 2c 72  |",0 . ,,ws%,,,,r|
00000390  36 25 0d 01 40 19 66 69  6c 65 31 25 3d 71 32 25  |6%..@.file1%=q2%|
000003a0  21 28 38 38 2b 36 34 2b  32 30 29 0d 01 4a 19 66  |!(88+64+20)..J.f|
000003b0  69 6c 65 32 25 3d 71 32  25 21 28 38 38 2b 39 36  |ile2%=q2%!(88+96|
000003c0  2b 32 30 29 0d 01 54 1b  70 72 6f 6d 70 74 25 3d  |+20)..T.prompt%=|
000003d0  71 32 25 21 28 38 38 2b  31 32 38 2b 32 30 29 0d  |q2%!(88+128+20).|
000003e0  01 5e 2b c8 99 22 57 69  6d 70 5f 43 72 65 61 74  |.^+.."Wimp_Creat|
000003f0  65 57 69 6e 64 6f 77 22  2c 2c 71 32 25 20 b8 20  |eWindow",,q2% . |
00000400  53 79 73 55 70 64 61 74  65 25 0d 01 68 1a c8 99  |SysUpdate%..h...|
00000410  22 57 69 6d 70 5f 43 6c  6f 73 65 54 65 6d 70 6c  |"Wimp_CloseTempl|
00000420  61 74 65 22 0d 01 72 15  6d 61 69 6e 6d 65 6e 75  |ate"..r.mainmenu|
00000430  25 3d a4 63 72 6d 65 6e  75 0d 01 7c 1e 20 dc 22  |%=.crmenu..|. ."|
00000440  23 4d 65 72 67 65 2c 49  6e 66 6f 3e 69 6e 66 6f  |#Merge,Info>info|
00000450  25 2c 51 75 69 74 22 0d  01 86 14 f2 69 6e 69 74  |%,Quit".....init|
00000460  5f 73 79 73 5f 77 69 6e  64 6f 77 0d 01 90 0e 73  |_sys_window....s|
00000470  61 76 65 72 65 66 25 3d  30 0d 01 9a 11 65 72 72  |averef%=0....err|
00000480  6f 72 5f 66 6c 61 67 25  3d 33 0d 01 a4 10 f2 67  |or_flag%=3.....g|
00000490  65 74 6d 6f 64 65 69 6e  66 6f 0d 01 ae 49 21 71  |etmodeinfo...I!q|
000004a0  31 25 3d 53 79 73 55 70  64 61 74 65 25 3a c8 99  |1%=SysUpdate%:..|
000004b0  22 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 53  |"Wimp_GetWindowS|
000004c0  74 61 74 65 22 2c 2c 71  31 25 3a c8 99 22 57 69  |tate",,q1%:.."Wi|
000004d0  6d 70 5f 4f 70 65 6e 57  69 6e 64 6f 77 22 2c 2c  |mp_OpenWindow",,|
000004e0  71 31 25 0d 01 b8 05 e1  0d 01 c2 05 3a 0d 01 cc  |q1%.........:...|
000004f0  15 dd f2 69 6e 69 74 5f  73 79 73 5f 77 69 6e 64  |...init_sys_wind|
00000500  6f 77 0d 01 d6 0e 24 66  69 6c 65 31 25 3d 22 22  |ow....$file1%=""|
00000510  0d 01 e0 0e 24 66 69 6c  65 32 25 3d 22 22 0d 01  |....$file2%=""..|
00000520  ea 3e 24 70 72 6f 6d 70  74 25 3d 22 44 72 61 67  |.>$prompt%="Drag|
00000530  20 74 68 65 20 6f 72 69  67 69 6e 61 6c 20 61 70  | the original ap|
00000540  70 6c 69 63 61 74 69 6f  6e 20 69 6e 74 6f 20 74  |plication into t|
00000550  68 69 73 20 77 69 6e 64  6f 77 2e 22 0d 01 f4 0c  |his window."....|
00000560  73 74 61 67 65 25 3d 31  0d 01 fe 17 f2 72 65 66  |stage%=1.....ref|
00000570  72 65 73 68 5f 73 79 73  5f 77 69 6e 64 6f 77 0d  |resh_sys_window.|
00000580  02 08 05 e1 0d 02 12 05  3a 0d 02 1c 11 dd f2 67  |........:......g|
00000590  65 74 6d 6f 64 65 69 6e  66 6f 0d 02 26 0d 71 31  |etmodeinfo..&.q1|
000005a0  25 21 30 20 3d 20 34 0d  02 30 0d 71 31 25 21 34  |%!0 = 4..0.q1%!4|
000005b0  20 3d 20 35 0d 02 3a 0e  71 31 25 21 38 20 3d 20  | = 5..:.q1%!8 = |
000005c0  31 31 0d 02 44 0e 71 31  25 21 31 32 3d 20 31 32  |11..D.q1%!12= 12|
000005d0  0d 02 4e 0e 71 31 25 21  31 36 3d 20 2d 31 0d 02  |..N.q1%!16= -1..|
000005e0  58 26 c8 99 22 4f 53 5f  52 65 61 64 56 64 75 56  |X&.."OS_ReadVduV|
000005f0  61 72 69 61 62 6c 65 73  22 2c 71 31 25 2c 71 31  |ariables",q1%,q1|
00000600  25 2b 32 30 0d 02 62 13  64 78 25 3d 31 3c 3c 28  |%+20..b.dx%=1<<(|
00000610  71 31 25 21 32 30 29 0d  02 6c 13 64 79 25 3d 31  |q1%!20)..l.dy%=1|
00000620  3c 3c 28 71 31 25 21 32  34 29 0d 02 76 19 73 63  |<<(q1%!24)..v.sc|
00000630  72 78 31 25 3d 28 71 31  25 21 32 38 2b 31 29 2a  |rx1%=(q1%!28+1)*|
00000640  64 78 25 0d 02 80 19 73  63 72 79 31 25 3d 28 71  |dx%....scry1%=(q|
00000650  31 25 21 33 32 2b 31 29  2a 64 79 25 0d 02 8a 05  |1%!32+1)*dy%....|
00000660  e1 0d 02 94 05 3a 0d 02  9e 10 dd f2 6d 6f 75 73  |.....:......mous|
00000670  65 63 6c 69 63 6b 0d 02  a8 08 ea 20 70 25 0d 02  |eclick..... p%..|
00000680  b2 0d c8 8e 71 31 25 21  38 20 ca 0d 02 bc 3d c9  |....q1%!8 ....=.|
00000690  32 3a 20 20 20 e7 71 31  25 21 31 32 3d 53 79 73  |2:   .q1%!12=Sys|
000006a0  55 70 64 61 74 65 25 20  f2 64 6f 6d 65 6e 75 28  |Update% .domenu(|
000006b0  6d 61 69 6e 6d 65 6e 75  25 2c 21 71 31 25 2d 36  |mainmenu%,!q1%-6|
000006c0  34 2c 71 31 25 21 34 29  0d 02 c6 05 cb 0d 02 d0  |4,q1%!4)........|
000006d0  05 e1 0d 02 da 05 3a 0d  02 e4 10 dd f2 64 65 63  |......:......dec|
000006e0  6f 64 65 64 72 61 67 0d  02 ee 20 ea 20 66 31 25  |odedrag... . f1%|
000006f0  2c 66 32 25 2c 68 25 2c  69 25 2c 6d 78 25 2c 6d  |,f2%,h%,i%,mx%,m|
00000700  79 25 2c 65 78 74 25 0d  02 f8 34 66 31 25 3d 8e  |y%,ext%...4f1%=.|
00000710  28 22 3c 53 79 73 55 70  64 61 74 65 24 44 69 72  |("<SysUpdate$Dir|
00000720  3e 2e 4f 75 74 70 75 74  22 29 3a 65 78 74 25 3d  |>.Output"):ext%=|
00000730  a2 23 66 31 25 3a d9 23  66 31 25 0d 03 02 11 66  |.#f1%:.#f1%....f|
00000740  31 25 3d 66 69 6c 65 6e  61 6d 65 25 0d 03 0c 05  |1%=filename%....|
00000750  f5 0d 03 16 0c 20 66 32  25 3d 66 31 25 0d 03 20  |..... f2%=f1%.. |
00000760  14 20 66 31 25 2b 3d a7  24 66 31 25 2c 22 2e 22  |. f1%+=.$f1%,"."|
00000770  29 0d 03 2a 0d fd 20 66  31 25 3d 66 32 25 0d 03  |)..*.. f1%=f2%..|
00000780  34 20 c8 99 22 57 69 6d  70 5f 47 65 74 50 6f 69  |4 .."Wimp_GetPoi|
00000790  6e 74 65 72 49 6e 66 6f  22 2c 2c 71 31 25 0d 03  |nterInfo",,q1%..|
000007a0  3e 0c 6d 78 25 3d 21 71  31 25 0d 03 48 0d 6d 79  |>.mx%=!q1%..H.my|
000007b0  25 3d 71 31 25 21 34 0d  03 52 0d 68 25 3d 71 31  |%=q1%!4..R.h%=q1|
000007c0  25 21 31 32 0d 03 5c 0d  69 25 3d 71 31 25 21 31  |%!12..\.i%=q1%!1|
000007d0  36 0d 03 66 16 21 71 31  25 3d 28 34 38 2b a9 24  |6..f.!q1%=(48+.$|
000007e0  66 31 25 29 80 ac 33 0d  03 70 0c 71 31 25 21 31  |f1%)..3..p.q1%!1|
000007f0  32 3d 30 0d 03 7a 0c 71  31 25 21 31 36 3d 31 0d  |2=0..z.q1%!16=1.|
00000800  03 84 0d 71 31 25 21 32  30 3d 68 25 0d 03 8e 0d  |...q1%!20=h%....|
00000810  71 31 25 21 32 34 3d 69  25 0d 03 98 0e 71 31 25  |q1%!24=i%....q1%|
00000820  21 32 38 3d 6d 78 25 0d  03 a2 0e 71 31 25 21 33  |!28=mx%....q1%!3|
00000830  32 3d 6d 79 25 0d 03 ac  0f 71 31 25 21 33 36 3d  |2=my%....q1%!36=|
00000840  65 78 74 25 0d 03 b6 0f  71 31 25 21 34 30 3d 26  |ext%....q1%!40=&|
00000850  46 46 46 0d 03 c0 12 24  28 71 31 25 2b 34 34 29  |FFF....$(q1%+44)|
00000860  3d 24 66 31 25 0d 03 ca  1a 3f 28 71 31 25 2b 34  |=$f1%....?(q1%+4|
00000870  34 2b a9 24 28 71 31 25  2b 34 34 29 29 3d 30 0d  |4+.$(q1%+44))=0.|
00000880  03 d4 25 c8 99 22 57 69  6d 70 5f 53 65 6e 64 4d  |..%.."Wimp_SendM|
00000890  65 73 73 61 67 65 22 2c  31 37 2c 71 31 25 2c 68  |essage",17,q1%,h|
000008a0  25 2c 69 25 0d 03 de 12  73 61 76 65 72 65 66 25  |%,i%....saveref%|
000008b0  3d 71 31 25 21 38 0d 03  e8 05 e1 0d 03 f2 05 3a  |=q1%!8.........:|
000008c0  0d 03 fc 16 dd f2 64 6f  6d 65 6e 75 28 68 25 2c  |......domenu(h%,|
000008d0  78 25 2c 79 25 29 0d 04  06 24 6d 65 6e 75 64 61  |x%,y%)...$menuda|
000008e0  74 61 25 3d 68 25 3a 6d  65 6e 75 78 25 3d 78 25  |ta%=h%:menux%=x%|
000008f0  3a 6d 65 6e 75 79 25 3d  79 25 0d 04 10 21 c8 99  |:menuy%=y%...!..|
00000900  22 57 69 6d 70 5f 43 72  65 61 74 65 4d 65 6e 75  |"Wimp_CreateMenu|
00000910  22 2c 2c 68 25 2c 78 25  2c 79 25 0d 04 1a 05 e1  |",,h%,x%,y%.....|
00000920  0d 04 24 05 3a 0d 04 2e  10 dd f2 6d 65 6e 75 73  |..$.:......menus|
00000930  65 6c 65 63 74 0d 04 38  0b ea 20 61 24 2c 69 25  |elect..8.. a$,i%|
00000940  0d 04 42 38 c8 99 22 57  69 6d 70 5f 44 65 63 6f  |..B8.."Wimp_Deco|
00000950  64 65 4d 65 6e 75 22 2c  2c 6d 65 6e 75 64 61 74  |deMenu",,menudat|
00000960  61 25 2c 71 31 25 2c c4  32 30 30 2c 22 20 22 29  |a%,q1%,.200," ")|
00000970  20 b8 20 2c 2c 2c 61 24  0d 04 4c 0c e7 61 24 3d  | . ,,,a$..L..a$=|
00000980  22 22 20 e1 0d 04 56 1a  e7 61 24 3d 22 51 75 69  |"" ...V..a$="Qui|
00000990  74 22 20 f2 73 68 75 74  64 6f 77 6e 3a e0 0d 04  |t" .shutdown:...|
000009a0  60 05 e1 0d 04 6a 05 3a  0d 04 74 0e dd a4 72 74  |`....j.:..t...rt|
000009b0  6f 7a 28 70 25 29 0d 04  7e 08 ea 20 71 24 0d 04  |oz(p%)..~.. q$..|
000009c0  88 1e c8 95 20 3f 70 25  3c 3e 30 20 71 24 2b 3d  |.... ?p%<>0 q$+=|
000009d0  bd 3f 70 25 3a 70 25 2b  3d 31 3a ce 0d 04 92 07  |.?p%:p%+=1:.....|
000009e0  3d 71 24 0d 04 9c 05 3a  0d 04 a6 11 dd f2 72 65  |=q$....:......re|
000009f0  63 65 69 76 65 28 72 25  29 0d 04 b0 19 ea 20 6e  |ceive(r%)..... n|
00000a00  61 6d 65 24 2c 69 25 2c  78 25 2c 72 65 73 75 6c  |ame$,i%,x%,resul|
00000a10  74 25 0d 04 ba 0f c8 8e  20 71 31 25 21 31 36 20  |t%...... q1%!16 |
00000a20  ca 0d 04 c4 13 c9 30 3a  20 f2 73 68 75 74 64 6f  |......0: .shutdo|
00000a30  77 6e 3a e0 0d 04 ce 39  c9 31 3a 20 f4 20 66 69  |wn:....9.1: . fi|
00000a40  6c 65 20 64 72 6f 70 70  65 64 20 66 72 6f 6d 20  |le dropped from |
00000a50  61 70 70 6c 69 63 61 74  69 6f 6e 20 2d 20 72 65  |application - re|
00000a60  74 75 72 6e 20 66 69 6c  65 6e 61 6d 65 0d 04 d8  |turn filename...|
00000a70  33 20 20 20 20 20 20 20  f2 6f 6b 28 22 41 70 70  |3       .ok("App|
00000a80  6c 69 63 61 74 69 6f 6e  20 64 61 74 61 20 63 61  |lication data ca|
00000a90  6e 6e 6f 74 20 62 65 20  6d 65 72 67 65 64 22 29  |nnot be merged")|
00000aa0  0d 04 e2 0c 20 20 20 20  20 20 20 e1 0d 04 ec 33  |....       ....3|
00000ab0  c9 33 3a 20 f4 20 66 69  6c 65 20 64 72 6f 70 70  |.3: . file dropp|
00000ac0  65 64 20 66 72 6f 6d 20  46 69 6c 65 72 20 2d 20  |ed from Filer - |
00000ad0  69 64 65 6e 74 69 66 79  20 6f 62 6a 65 63 74 0d  |identify object.|
00000ae0  04 f6 11 20 20 c8 8e 20  73 74 61 67 65 25 20 ca  |...  .. stage% .|
00000af0  0d 05 00 15 20 20 c9 31  3a 20 f2 63 68 65 63 6b  |....  .1: .check|
00000b00  5f 74 79 70 65 0d 05 0a  22 20 20 20 20 20 20 20  |_type..."       |
00000b10  20 20 24 66 69 6c 65 31  25 3d a4 72 74 6f 7a 28  |  $file1%=.rtoz(|
00000b20  71 31 25 2b 34 34 29 0d  05 14 41 20 20 20 20 20  |q1%+44)...A     |
00000b30  20 20 20 20 24 70 72 6f  6d 70 74 25 3d 22 44 72  |    $prompt%="Dr|
00000b40  61 67 20 74 68 65 20 6e  65 77 20 61 70 70 6c 69  |ag the new appli|
00000b50  63 61 74 69 6f 6e 20 69  6e 74 6f 20 74 68 69 73  |cation into this|
00000b60  20 77 69 6e 64 6f 77 22  0d 05 1e 20 20 20 20 20  | window"...     |
00000b70  20 20 20 20 20 f2 72 65  66 72 65 73 68 5f 73 79  |     .refresh_sy|
00000b80  73 5f 77 69 6e 64 6f 77  0d 05 28 15 20 20 20 20  |s_window..(.    |
00000b90  20 20 20 20 20 73 74 61  67 65 25 3d 32 0d 05 32  |     stage%=2..2|
00000ba0  15 20 20 c9 32 3a 20 f2  63 68 65 63 6b 5f 74 79  |.  .2: .check_ty|
00000bb0  70 65 0d 05 3c 34 20 20  20 20 20 20 20 20 20 24  |pe..<4         $|
00000bc0  66 69 6c 65 32 25 3d a4  72 74 6f 7a 28 71 31 25  |file2%=.rtoz(q1%|
00000bd0  2b 34 34 29 20 20 20 20  20 20 20 20 20 20 20 20  |+44)            |
00000be0  20 20 20 20 20 20 0d 05  46 33 20 20 20 20 20 20  |      ..F3      |
00000bf0  20 20 20 72 65 73 75 6c  74 25 20 3d 20 a4 63 68  |   result% = .ch|
00000c00  65 63 6b 5f 6c 65 61 66  28 24 66 69 6c 65 31 25  |eck_leaf($file1%|
00000c10  2c 24 66 69 6c 65 32 25  29 0d 05 50 1c 20 20 20  |,$file2%)..P.   |
00000c20  20 20 20 20 20 20 e7 20  72 65 73 75 6c 74 25 20  |      . result% |
00000c30  3d 20 31 20 8c 0d 05 5a  20 20 20 20 20 20 20 20  |= 1 ...Z        |
00000c40  20 20 20 20 20 f2 69 6e  69 74 5f 73 79 73 5f 77  |     .init_sys_w|
00000c50  69 6e 64 6f 77 0d 05 64  47 20 20 20 20 20 20 20  |indow..dG       |
00000c60  20 20 20 20 20 f2 6f 6b  28 22 59 6f 75 20 63 61  |     .ok("You ca|
00000c70  6e 20 6f 6e 6c 79 20 6d  65 72 67 65 20 61 70 70  |n only merge app|
00000c80  6c 69 63 61 74 69 6f 6e  73 20 6f 66 20 74 68 65  |lications of the|
00000c90  20 73 61 6d 65 20 6e 61  6d 65 22 29 0d 05 6e 1a  | same name")..n.|
00000ca0  20 20 20 20 20 20 20 20  20 20 20 20 24 66 69 6c  |            $fil|
00000cb0  65 32 25 3d 22 22 0d 05  78 0e 20 20 20 20 20 20  |e2%=""..x.      |
00000cc0  20 20 20 cd 0d 05 82 1f  20 20 20 20 20 20 20 20  |   .....        |
00000cd0  20 e7 24 66 69 6c 65 31  25 3d 24 66 69 6c 65 32  | .$file1%=$file2|
00000ce0  25 20 8c 0d 05 8c 1e 20  20 20 20 20 20 20 20 20  |% .....         |
00000cf0  20 f2 69 6e 69 74 5f 73  79 73 5f 77 69 6e 64 6f  | .init_sys_windo|
00000d00  77 0d 05 96 33 20 20 20  20 20 20 20 20 20 20 f2  |w...3          .|
00000d10  6f 6b 28 22 54 68 65 20  61 70 70 6c 69 63 61 74  |ok("The applicat|
00000d20  69 6f 6e 73 20 61 72 65  20 69 64 65 6e 74 69 63  |ions are identic|
00000d30  61 6c 22 29 0d 05 a0 0e  20 20 20 20 20 20 20 20  |al")....        |
00000d40  20 cd 0d 05 aa 38 20 20  20 20 20 20 20 20 20 24  | ....8         $|
00000d50  70 72 6f 6d 70 74 25 3d  22 50 6c 65 61 73 65 20  |prompt%="Please |
00000d60  77 61 69 74 20 2e 2e 2e  20 70 72 6f 63 65 73 73  |wait ... process|
00000d70  69 6e 67 20 66 69 6c 65  73 22 0d 05 b4 20 20 20  |ing files"...   |
00000d80  20 20 20 20 20 20 20 f2  72 65 66 72 65 73 68 5f  |       .refresh_|
00000d90  73 79 73 5f 77 69 6e 64  6f 77 0d 05 be 15 20 20  |sys_window....  |
00000da0  20 20 20 20 20 20 20 73  74 61 67 65 25 3d 33 0d  |       stage%=3.|
00000db0  05 c8 07 20 20 cb 0d 05  d2 1c c9 26 35 30 32 3a  |...  ......&502:|
00000dc0  20 f2 69 6e 74 65 72 61  63 74 69 76 65 5f 68 65  | .interactive_he|
00000dd0  6c 70 0d 05 dc 19 c9 26  34 30 30 43 31 3a 20 f2  |lp.....&400C1: .|
00000de0  67 65 74 6d 6f 64 65 69  6e 66 6f 0d 05 e6 05 cb  |getmodeinfo.....|
00000df0  0d 05 f0 05 e1 0d 05 fa  05 3a 0d 06 04 16 dd f2  |.........:......|
00000e00  69 6e 74 65 72 61 63 74  69 76 65 5f 68 65 6c 70  |interactive_help|
00000e10  0d 06 0e 08 ea 20 74 24  0d 06 18 0f c8 8e 20 71  |..... t$...... q|
00000e20  31 25 21 33 32 20 ca 0d  06 22 31 c9 53 79 73 55  |1%!32 ..."1.SysU|
00000e30  70 64 61 74 65 25 3a 20  74 24 3d 22 54 68 69 73  |pdate%: t$="This|
00000e40  20 69 73 20 74 68 65 20  4d 65 72 67 65 20 77 69  | is the Merge wi|
00000e50  6e 64 6f 77 2e 7c 4d 22  0d 06 2c 10 20 c8 8e 20  |ndow.|M"..,. .. |
00000e60  73 74 61 67 65 25 20 ca  0d 06 36 33 20 c9 31 3a  |stage% ...63 .1:|
00000e70  20 74 24 2b 3d 22 44 72  6f 70 20 74 68 65 20 6f  | t$+="Drop the o|
00000e80  72 69 67 69 6e 61 6c 20  61 70 70 6c 69 63 61 74  |riginal applicat|
00000e90  69 6f 6e 20 6f 6e 20 69  74 2e 22 0d 06 40 2e 20  |ion on it."..@. |
00000ea0  c9 32 3a 20 74 24 2b 3d  22 44 72 6f 70 20 74 68  |.2: t$+="Drop th|
00000eb0  65 20 6e 65 77 20 61 70  70 6c 69 63 61 74 69 6f  |e new applicatio|
00000ec0  6e 20 6f 6e 20 69 74 2e  22 0d 06 4a 56 20 c9 34  |n on it."..JV .4|
00000ed0  3a 20 74 24 2b 3d 22 41  70 70 6c 69 63 61 74 69  |: t$+="Applicati|
00000ee0  6f 6e 20 75 70 64 61 74  65 20 77 61 73 20 73 75  |on update was su|
00000ef0  63 63 65 73 73 66 75 6c  2e 7c 4d 43 6c 69 63 6b  |ccessful.|MClick|
00000f00  20 53 45 4c 45 43 54 20  6f 6e 20 63 6c 6f 73 65  | SELECT on close|
00000f10  20 69 63 6f 6e 20 74 6f  20 71 75 69 74 2e 22 0d  | icon to quit.".|
00000f20  06 54 06 20 cb 0d 06 5e  05 cb 0d 06 68 0d e7 74  |.T. ...^....h..t|
00000f30  24 3c 3e 22 22 20 8c 0d  06 72 11 20 71 31 25 21  |$<>"" ...r. q1%!|
00000f40  31 32 3d 71 31 25 21 38  0d 06 7c 10 20 71 31 25  |12=q1%!8..|. q1%|
00000f50  21 31 36 3d 26 35 30 33  0d 06 86 14 20 24 28 71  |!16=&503.... $(q|
00000f60  31 25 2b 32 30 29 3d 74  24 2b bd 30 0d 06 90 15  |1%+20)=t$+.0....|
00000f70  20 21 71 31 25 3d 28 32  35 2b a9 74 24 29 80 ac  | !q1%=(25+.t$)..|
00000f80  33 0d 06 9a 26 20 c8 99  22 57 69 6d 70 5f 53 65  |3...& .."Wimp_Se|
00000f90  6e 64 4d 65 73 73 61 67  65 22 2c 31 37 2c 71 31  |ndMessage",17,q1|
00000fa0  25 2c 71 31 25 21 34 0d  06 a4 05 cd 0d 06 ae 05  |%,q1%!4.........|
00000fb0  e1 0d 06 b8 05 3a 0d 06  c2 10 dd f2 63 68 65 63  |.....:......chec|
00000fc0  6b 5f 74 79 70 65 0d 06  cc 40 e7 71 31 25 21 34  |k_type...@.q1%!4|
00000fd0  30 3c 3e 26 32 30 30 30  20 8c 20 f2 6f 6b 28 22  |0<>&2000 . .ok("|
00000fe0  54 68 69 73 20 69 73 20  6e 6f 74 20 61 6e 20 61  |This is not an a|
00000ff0  70 70 6c 69 63 61 74 69  6f 6e 20 64 69 72 65 63  |pplication direc|
00001000  74 6f 72 79 22 29 0d 06  d6 05 e1 0d 06 e0 05 3a  |tory").........:|
00001010  0d 06 ea 18 dd f2 72 65  66 72 65 73 68 5f 73 79  |......refresh_sy|
00001020  73 5f 77 69 6e 64 6f 77  0d 06 f4 47 21 71 32 25  |s_window...G!q2%|
00001030  3d 53 79 73 55 70 64 61  74 65 25 3a 71 32 25 21  |=SysUpdate%:q2%!|
00001040  34 3d 32 3a 71 32 25 21  38 3d 30 3a 71 32 25 21  |4=2:q2%!8=0:q2%!|
00001050  31 32 3d 30 3a c8 99 22  57 69 6d 70 5f 53 65 74  |12=0:.."Wimp_Set|
00001060  49 63 6f 6e 53 74 61 74  65 22 2c 2c 71 32 25 0d  |IconState",,q2%.|
00001070  06 fe 47 21 71 32 25 3d  53 79 73 55 70 64 61 74  |..G!q2%=SysUpdat|
00001080  65 25 3a 71 32 25 21 34  3d 33 3a 71 32 25 21 38  |e%:q2%!4=3:q2%!8|
00001090  3d 30 3a 71 32 25 21 31  32 3d 30 3a c8 99 22 57  |=0:q2%!12=0:.."W|
000010a0  69 6d 70 5f 53 65 74 49  63 6f 6e 53 74 61 74 65  |imp_SetIconState|
000010b0  22 2c 2c 71 32 25 0d 07  08 47 21 71 32 25 3d 53  |",,q2%...G!q2%=S|
000010c0  79 73 55 70 64 61 74 65  25 3a 71 32 25 21 34 3d  |ysUpdate%:q2%!4=|
000010d0  34 3a 71 32 25 21 38 3d  30 3a 71 32 25 21 31 32  |4:q2%!8=0:q2%!12|
000010e0  3d 30 3a c8 99 22 57 69  6d 70 5f 53 65 74 49 63  |=0:.."Wimp_SetIc|
000010f0  6f 6e 53 74 61 74 65 22  2c 2c 71 32 25 0d 07 12  |onState",,q2%...|
00001100  05 e1 0d 07 1c 05 3a 0d  07 26 0e dd f2 73 68 75  |......:..&...shu|
00001110  74 64 6f 77 6e 0d 07 30  16 c8 99 22 57 69 6d 70  |tdown..0..."Wimp|
00001120  5f 43 6c 6f 73 65 44 6f  77 6e 22 0d 07 3a 05 e1  |_CloseDown"..:..|
00001130  0d 07 44 05 3a 0d 07 4e  0b dd f2 65 72 72 6f 72  |..D.:..N...error|
00001140  0d 07 58 14 e7 65 72 72  6f 72 5f 66 6c 61 67 25  |..X..error_flag%|
00001150  3d 33 20 8c 0d 07 62 37  20 f2 65 72 72 6f 72 62  |=3 ...b7 .errorb|
00001160  6f 78 28 22 55 6e 65 78  70 65 63 74 65 64 20 65  |ox("Unexpected e|
00001170  72 72 6f 72 20 3a 2d 20  22 2b f6 24 2b 22 20 28  |rror :- "+.$+" (|
00001180  22 2b c3 28 9e 29 2b 22  29 22 29 0d 07 6c 05 cc  |"+.(.)+")")..l..|
00001190  0d 07 76 12 20 f2 65 72  72 6f 72 62 6f 78 28 f6  |..v. .errorbox(.|
000011a0  24 29 0d 07 80 05 cd 0d  07 8a 11 65 72 72 6f 72  |$).........error|
000011b0  5f 66 6c 61 67 25 3d 33  0d 07 94 05 e1 0d 07 9e  |_flag%=3........|
000011c0  05 3a 0d 07 a8 0c dd f2  6f 6b 28 65 24 29 0d 07  |.:......ok(e$)..|
000011d0  b2 11 65 72 72 6f 72 5f  66 6c 61 67 25 3d 31 0d  |..error_flag%=1.|
000011e0  07 bc 0a 85 20 31 2c 65  24 0d 07 c6 05 e1 0d 07  |.... 1,e$.......|
000011f0  d0 05 3a 0d 07 da 0f dd  f2 66 61 74 61 6c 28 65  |..:......fatal(e|
00001200  24 29 0d 07 e4 11 65 72  72 6f 72 5f 66 6c 61 67  |$)....error_flag|
00001210  25 3d 32 0d 07 ee 0a 85  20 31 2c 65 24 0d 07 f8  |%=2..... 1,e$...|
00001220  05 e1 0d 08 02 05 3a 0d  08 0c 12 dd f2 65 72 72  |......:......err|
00001230  6f 72 62 6f 78 28 72 24  29 0d 08 16 08 ea 20 72  |orbox(r$)..... r|
00001240  25 0d 08 20 19 21 71 31  25 3d 9f 3a 24 28 71 31  |%.. .!q1%=.:$(q1|
00001250  25 2b 34 29 3d 72 24 2b  bd 30 0d 08 2a 3e c8 99  |%+4)=r$+.0..*>..|
00001260  22 57 69 6d 70 5f 52 65  70 6f 72 74 45 72 72 6f  |"Wimp_ReportErro|
00001270  72 22 2c 71 31 25 2c 65  72 72 6f 72 5f 66 6c 61  |r",q1%,error_fla|
00001280  67 25 2c 22 4d 65 72 67  65 20 75 74 69 6c 69 74  |g%,"Merge utilit|
00001290  79 22 20 b8 20 2c 72 25  0d 08 34 1e e7 72 25 3d  |y" . ,r%..4..r%=|
000012a0  32 20 c8 99 22 57 69 6d  70 5f 43 6c 6f 73 65 44  |2 .."Wimp_CloseD|
000012b0  6f 77 6e 22 3a e0 0d 08  3e 05 e1 0d 08 48 05 3a  |own":...>....H.:|
000012c0  0d 08 52 0c dd a4 63 72  6d 65 6e 75 0d 08 5c 11  |..R...crmenu..\.|
000012d0  ea 20 6d 25 2c 6d 65 6e  75 24 2c 6d 24 0d 08 66  |. m%,menu$,m$..f|
000012e0  36 e7 20 28 6d 65 6e 75  66 72 65 65 25 2b 32 38  |6. (menufree%+28|
000012f0  3e 6d 65 6e 75 65 6e 64  25 29 20 f2 66 61 74 61  |>menuend%) .fata|
00001300  6c 28 22 4d 65 6e 75 20  61 72 65 61 20 66 75 6c  |l("Menu area ful|
00001310  6c 22 29 0d 08 70 0b f3  20 6d 65 6e 75 24 0d 08  |l")..p.. menu$..|
00001320  7a 15 c8 95 20 c2 6d 65  6e 75 24 2c 32 29 3d 22  |z... .menu$,2)="|
00001330  2b 2b 22 0d 08 84 09 20  f3 20 6d 24 0d 08 8e 1e  |++".... . m$....|
00001340  20 6d 65 6e 75 24 3d c0  6d 65 6e 75 24 2c a9 6d  | menu$=.menu$,.m|
00001350  65 6e 75 24 2d 32 29 2b  6d 24 0d 08 98 05 ce 0d  |enu$-2)+m$......|
00001360  08 a2 16 6d 65 6e 75 70  74 72 25 3d 6d 65 6e 75  |...menuptr%=menu|
00001370  66 72 65 65 25 0d 08 ac  08 69 25 3d 30 0d 08 b6  |free%....i%=0...|
00001380  3d e7 20 c0 6d 65 6e 75  24 2c 31 29 3d 22 23 22  |=. .menu$,1)="#"|
00001390  20 69 25 3d 31 3a 6d 65  6e 75 74 69 74 6c 65 24  | i%=1:menutitle$|
000013a0  3d a4 70 61 72 28 22 2c  22 29 20 8b 20 6d 65 6e  |=.par(",") . men|
000013b0  75 74 69 74 6c 65 24 3d  22 22 0d 08 c0 18 24 6d  |utitle$=""....$m|
000013c0  65 6e 75 70 74 72 25 3d  6d 65 6e 75 74 69 74 6c  |enuptr%=menutitl|
000013d0  65 24 0d 08 ca 11 6d 65  6e 75 70 74 72 25 3f 31  |e$....menuptr%?1|
000013e0  32 3d 37 0d 08 d4 11 6d  65 6e 75 70 74 72 25 3f  |2=7....menuptr%?|
000013f0  31 33 3d 32 0d 08 de 11  6d 65 6e 75 70 74 72 25  |13=2....menuptr%|
00001400  3f 31 34 3d 37 0d 08 e8  11 6d 65 6e 75 70 74 72  |?14=7....menuptr|
00001410  25 3f 31 35 3d 31 0d 08  f2 13 6d 65 6e 75 70 74  |%?15=1....menupt|
00001420  72 25 21 31 36 3d 31 39  36 0d 08 fc 12 6d 65 6e  |r%!16=196....men|
00001430  75 70 74 72 25 21 32 30  3d 34 34 0d 09 06 11 6d  |uptr%!20=44....m|
00001440  65 6e 75 70 74 72 25 21  32 34 3d 30 0d 09 10 10  |enuptr%!24=0....|
00001450  6d 65 6e 75 70 74 72 25  2b 3d 32 38 0d 09 1a 17  |menuptr%+=28....|
00001460  6d 61 78 78 25 3d a9 6d  65 6e 75 74 69 74 6c 65  |maxx%=.menutitle|
00001470  24 2d 33 0d 09 24 05 f5  0d 09 2e 14 20 69 74 65  |$-3..$...... ite|
00001480  6d 24 3d a4 70 61 72 28  22 2c 22 29 0d 09 38 15  |m$=.par(",")..8.|
00001490  20 f2 6d 65 6e 75 69 74  65 6d 28 69 74 65 6d 24  | .menuitem(item$|
000014a0  29 0d 09 42 0e fd 20 69  74 65 6d 24 3d 22 22 0d  |)..B.. item$="".|
000014b0  09 4c 10 6d 25 3d 6d 65  6e 75 66 72 65 65 25 0d  |.L.m%=menufree%.|
000014c0  09 56 17 6d 25 21 31 36  3d 28 6d 61 78 78 25 2a  |.V.m%!16=(maxx%*|
000014d0  38 2b 36 29 2a 32 0d 09  60 16 6d 65 6e 75 66 72  |8+6)*2..`.menufr|
000014e0  65 65 25 3d 6d 65 6e 75  70 74 72 25 0d 09 6a 07  |ee%=menuptr%..j.|
000014f0  3d 6d 25 0d 09 74 05 3a  0d 09 7e 15 dd f2 6d 65  |=m%..t.:..~...me|
00001500  6e 75 69 74 65 6d 28 74  65 78 74 24 29 0d 09 88  |nuitem(text$)...|
00001510  18 ea 20 69 25 2c 66 6c  67 25 2c 73 75 62 70 74  |.. i%,flg%,subpt|
00001520  72 25 2c 4c 25 0d 09 92  30 e7 20 74 65 78 74 24  |r%,L%...0. text$|
00001530  3d 22 22 20 6d 65 6e 75  70 74 72 25 21 2d 32 34  |="" menuptr%!-24|
00001540  3d 28 6d 65 6e 75 70 74  72 25 21 2d 32 34 29 84  |=(menuptr%!-24).|
00001550  26 38 30 3a e1 0d 09 9c  35 e7 20 28 6d 65 6e 75  |&80:....5. (menu|
00001560  70 74 72 25 2b 32 34 3e  6d 65 6e 75 65 6e 64 25  |ptr%+24>menuend%|
00001570  29 20 f2 66 61 74 61 6c  28 22 4d 65 6e 75 20 61  |) .fatal("Menu a|
00001580  72 65 61 20 66 75 6c 6c  22 29 0d 09 a6 0c 66 6c  |rea full")....fl|
00001590  67 25 3d 26 30 30 0d 09  b0 12 69 25 3d a7 74 65  |g%=&00....i%=.te|
000015a0  78 74 24 2c 22 3e 22 29  0d 09 ba 0c e7 20 69 25  |xt$,">")..... i%|
000015b0  3e 30 20 8c 0d 09 c4 1a  20 73 75 62 70 74 72 25  |>0 ..... subptr%|
000015c0  3d a0 c1 74 65 78 74 24  2c 69 25 2b 31 29 0d 09  |=..text$,i%+1)..|
000015d0  ce 17 20 74 65 78 74 24  3d c0 74 65 78 74 24 2c  |.. text$=.text$,|
000015e0  69 25 2d 31 29 0d 09 d8  05 cc 0d 09 e2 0f 20 73  |i%-1)......... s|
000015f0  75 62 70 74 72 25 3d 2d  31 0d 09 ec 05 cd 0d 09  |ubptr%=-1.......|
00001600  f6 34 e7 20 c2 74 65 78  74 24 2c 31 29 3d 22 23  |.4. .text$,1)="#|
00001610  22 20 74 65 78 74 24 3d  c0 74 65 78 74 24 2c a9  |" text$=.text$,.|
00001620  74 65 78 74 24 2d 31 29  3a 66 6c 67 25 2b 3d 26  |text$-1):flg%+=&|
00001630  30 32 0d 0a 00 13 6d 65  6e 75 70 74 72 25 21 30  |02....menuptr%!0|
00001640  3d 66 6c 67 25 0d 0a 0a  16 6d 65 6e 75 70 74 72  |=flg%....menuptr|
00001650  25 21 34 3d 73 75 62 70  74 72 25 0d 0a 14 18 6d  |%!4=subptr%....m|
00001660  65 6e 75 70 74 72 25 21  38 3d 26 30 37 30 30 30  |enuptr%!8=&07000|
00001670  30 32 31 0d 0a 1e 15 e7  20 c0 74 65 78 74 24 2c  |021..... .text$,|
00001680  31 29 3d 22 24 22 20 8c  0d 0a 28 13 20 21 6d 65  |1)="$" ...(. !me|
00001690  6e 75 70 74 72 25 2b 3d  26 30 34 0d 0a 32 15 20  |nuptr%+=&04..2. |
000016a0  6d 65 6e 75 70 74 72 25  21 38 2b 3d 26 31 30 30  |menuptr%!8+=&100|
000016b0  0d 0a 3c 13 20 69 25 3d  a7 74 65 78 74 24 2c 22  |..<. i%=.text$,"|
000016c0  28 22 29 0d 0a 46 0d 20  e7 20 69 25 3e 30 20 8c  |(")..F. . i%>0 .|
000016d0  0d 0a 50 16 20 20 4c 25  3d bb c1 74 65 78 74 24  |..P.  L%=..text$|
000016e0  2c 69 25 2b 31 29 0d 0a  5a 18 20 20 74 65 78 74  |,i%+1)..Z.  text|
000016f0  24 3d c0 74 65 78 74 24  2c 69 25 2d 31 29 0d 0a  |$=.text$,i%-1)..|
00001700  64 06 20 cc 0d 0a 6e 0b  20 20 4c 25 3d 31 32 0d  |d. ...n.  L%=12.|
00001710  0a 78 06 20 cd 0d 0a 82  1b 20 6d 65 6e 75 70 74  |.x. ..... menupt|
00001720  72 25 21 31 32 3d a0 c1  74 65 78 74 24 2c 32 29  |r%!12=..text$,2)|
00001730  0d 0a 8c 13 20 6d 65 6e  75 70 74 72 25 21 31 36  |.... menuptr%!16|
00001740  3d 2d 31 0d 0a 96 13 20  6d 65 6e 75 70 74 72 25  |=-1.... menuptr%|
00001750  21 32 30 3d 4c 25 0d 0a  a0 11 20 e7 4c 25 3e 31  |!20=L%.... .L%>1|
00001760  36 20 4c 25 3d 31 36 0d  0a aa 13 20 74 65 78 74  |6 L%=16.... text|
00001770  24 3d c4 4c 25 2c 22 20  22 29 0d 0a b4 05 cc 0d  |$=.L%," ")......|
00001780  0a be 11 20 e7 a9 74 65  78 74 24 3c 3d 31 32 8c  |... ..text$<=12.|
00001790  0d 0a c8 1a 20 20 24 28  6d 65 6e 75 70 74 72 25  |....  $(menuptr%|
000017a0  2b 31 32 29 3d 74 65 78  74 24 0d 0a d2 06 20 cc  |+12)=text$.... .|
000017b0  0d 0a dc 27 20 20 49 25  3d a4 77 6f 72 6b 73 70  |...'  I%=.worksp|
000017c0  61 63 65 28 a9 74 65 78  74 24 2b 31 29 3a 24 49  |ace(.text$+1):$I|
000017d0  25 3d 74 65 78 74 24 0d  0a e6 38 20 20 6d 65 6e  |%=text$...8  men|
000017e0  75 70 74 72 25 21 31 32  3d 49 25 3a 6d 65 6e 75  |uptr%!12=I%:menu|
000017f0  70 74 72 25 21 31 36 3d  2d 31 3a 6d 65 6e 75 70  |ptr%!16=-1:menup|
00001800  74 72 25 21 32 30 3d a9  74 65 78 74 24 2b 31 0d  |tr%!20=.text$+1.|
00001810  0a f0 22 20 20 6d 65 6e  75 70 74 72 25 21 38 3d  |.."  menuptr%!8=|
00001820  6d 65 6e 75 70 74 72 25  21 38 20 84 20 26 31 30  |menuptr%!8 . &10|
00001830  30 0d 0a fa 06 20 cd 0d  0b 04 05 cd 0d 0b 0e 1f  |0.... ..........|
00001840  e7 20 a9 74 65 78 74 24  3e 6d 61 78 78 25 20 6d  |. .text$>maxx% m|
00001850  61 78 78 25 3d a9 74 65  78 74 24 0d 0b 18 10 6d  |axx%=.text$....m|
00001860  65 6e 75 70 74 72 25 2b  3d 32 34 0d 0b 22 05 e1  |enuptr%+=24.."..|
00001870  0d 0b 2c 05 3a 0d 0b 36  0f dd a4 70 61 72 28 73  |..,.:..6...par(s|
00001880  65 70 24 29 0d 0b 40 09  ea 20 69 31 25 0d 0b 4a  |ep$)..@.. i1%..J|
00001890  0c 69 31 25 3d 69 25 2b  31 0d 0b 54 1c 69 25 3d  |.i1%=i%+1..T.i%=|
000018a0  a7 6d 65 6e 75 24 2b 73  65 70 24 2c 73 65 70 24  |.menu$+sep$,sep$|
000018b0  2c 69 31 25 29 0d 0b 5e  17 3d c1 6d 65 6e 75 24  |,i1%)..^.=.menu$|
000018c0  2c 69 31 25 2c 69 25 2d  69 31 25 29 0d 0b 68 05  |,i1%,i%-i1%)..h.|
000018d0  3a 0d 0b 72 1e dd f2 73  68 61 64 65 28 6d 65 6e  |:..r...shade(men|
000018e0  75 68 61 6e 64 6c 65 25  2c 69 74 65 6d 25 29 0d  |uhandle%,item%).|
000018f0  0b 7c 43 6d 65 6e 75 68  61 6e 64 6c 65 25 21 28  |.|Cmenuhandle%!(|
00001900  32 38 2b 38 2b 32 34 2a  69 74 65 6d 25 29 3d 6d  |28+8+24*item%)=m|
00001910  65 6e 75 68 61 6e 64 6c  65 25 21 28 32 38 2b 38  |enuhandle%!(28+8|
00001920  2b 32 34 2a 69 74 65 6d  25 29 82 26 34 30 30 30  |+24*item%).&4000|
00001930  30 30 0d 0b 86 05 e1 0d  0b 90 05 3a 0d 0b 9a 25  |00.........:...%|
00001940  dd a4 73 68 61 64 65 5f  73 74 61 74 75 73 28 6d  |..shade_status(m|
00001950  65 6e 75 68 61 6e 64 6c  65 25 2c 69 74 65 6d 25  |enuhandle%,item%|
00001960  29 0d 0b a4 38 3d 20 2d  28 28 6d 65 6e 75 68 61  |)...8= -((menuha|
00001970  6e 64 6c 65 25 21 28 32  38 2b 38 2b 32 34 2a 69  |ndle%!(28+8+24*i|
00001980  74 65 6d 25 29 20 80 20  26 34 30 30 30 30 30 29  |tem%) . &400000)|
00001990  3d 26 34 30 30 30 30 30  29 0d 0b ae 05 3a 0d 0b  |=&400000)....:..|
000019a0  b8 29 dd f2 73 65 74 5f  73 68 61 64 65 28 6d 65  |.)..set_shade(me|
000019b0  6e 75 68 61 6e 64 6c 65  25 2c 69 74 65 6d 25 2c  |nuhandle%,item%,|
000019c0  76 61 6c 75 65 25 29 0d  0b c2 47 e7 a4 73 68 61  |value%)...G..sha|
000019d0  64 65 5f 73 74 61 74 75  73 28 6d 65 6e 75 68 61  |de_status(menuha|
000019e0  6e 64 6c 65 25 2c 69 74  65 6d 25 29 3c 3e 76 61  |ndle%,item%)<>va|
000019f0  6c 75 65 25 20 f2 73 68  61 64 65 28 6d 65 6e 75  |lue% .shade(menu|
00001a00  68 61 6e 64 6c 65 25 2c  69 74 65 6d 25 29 0d 0b  |handle%,item%)..|
00001a10  cc 05 e1 0d 0b d6 05 3a  0d 0b e0 1d dd f2 74 69  |.......:......ti|
00001a20  63 6b 28 6d 65 6e 75 68  61 6e 64 6c 65 25 2c 69  |ck(menuhandle%,i|
00001a30  74 65 6d 25 29 0d 0b ea  39 6d 65 6e 75 68 61 6e  |tem%)...9menuhan|
00001a40  64 6c 65 25 21 28 32 38  2b 32 34 2a 69 74 65 6d  |dle%!(28+24*item|
00001a50  25 29 3d 6d 65 6e 75 68  61 6e 64 6c 65 25 21 28  |%)=menuhandle%!(|
00001a60  32 38 2b 32 34 2a 69 74  65 6d 25 29 82 31 0d 0b  |28+24*item%).1..|
00001a70  f4 05 e1 0d 0b fe 05 3a  0d 0c 08 24 dd a4 74 69  |.......:...$..ti|
00001a80  63 6b 5f 73 74 61 74 75  73 28 6d 65 6e 75 68 61  |ck_status(menuha|
00001a90  6e 64 6c 65 25 2c 69 74  65 6d 25 29 0d 0c 12 21  |ndle%,item%)...!|
00001aa0  3d 20 6d 65 6e 75 68 61  6e 64 6c 65 25 21 28 32  |= menuhandle%!(2|
00001ab0  38 2b 32 34 2a 69 74 65  6d 25 29 80 31 0d 0c 1c  |8+24*item%).1...|
00001ac0  05 3a 0d 0c 26 28 dd f2  73 65 74 5f 74 69 63 6b  |.:..&(..set_tick|
00001ad0  28 6d 65 6e 75 68 61 6e  64 6c 65 25 2c 69 74 65  |(menuhandle%,ite|
00001ae0  6d 25 2c 76 61 6c 75 65  25 29 0d 0c 30 45 e7 a4  |m%,value%)..0E..|
00001af0  74 69 63 6b 5f 73 74 61  74 75 73 28 6d 65 6e 75  |tick_status(menu|
00001b00  68 61 6e 64 6c 65 25 2c  69 74 65 6d 25 29 3c 3e  |handle%,item%)<>|
00001b10  76 61 6c 75 65 25 20 f2  74 69 63 6b 28 6d 65 6e  |value% .tick(men|
00001b20  75 68 61 6e 64 6c 65 25  2c 69 74 65 6d 25 29 0d  |uhandle%,item%).|
00001b30  0c 3a 05 e1 0d 0c 44 05  3a 0d 0c 4e 13 dd a4 77  |.:....D.:..N...w|
00001b40  6f 72 6b 73 70 61 63 65  28 4c 25 29 0d 0c 58 38  |orkspace(L%)..X8|
00001b50  e7 20 63 75 72 77 73 25  2b 4c 25 3e 77 73 25 2b  |. curws%+L%>ws%+|
00001b60  6d 61 78 77 73 25 20 8c  20 f2 66 61 74 61 6c 28  |maxws% . .fatal(|
00001b70  22 4e 6f 20 6d 6f 72 65  20 77 6f 72 6b 73 70 61  |"No more workspa|
00001b80  63 65 22 29 0d 0c 62 0e  63 75 72 77 73 25 2b 3d  |ce")..b.curws%+=|
00001b90  4c 25 0d 0c 6c 0e 3d 63  75 72 77 73 25 2d 4c 25  |L%..l.=curws%-L%|
00001ba0  0d 0c 76 05 3a 0d 0c 80  10 dd f2 63 6f 70 79 5f  |..v.:......copy_|
00001bb0  66 69 6c 65 73 0d 0c 8a  14 c8 99 22 48 6f 75 72  |files......"Hour|
00001bc0  67 6c 61 73 73 5f 4f 6e  22 0d 0c 94 44 c8 99 22  |glass_On"...D.."|
00001bd0  58 4f 53 5f 46 53 43 6f  6e 74 72 6f 6c 22 2c 32  |XOS_FSControl",2|
00001be0  36 2c 24 66 69 6c 65 32  25 2c 24 66 69 6c 65 31  |6,$file2%,$file1|
00001bf0  25 2c 25 31 30 31 30 30  30 30 30 30 30 30 30 30  |%,%1010000000000|
00001c00  31 31 20 b8 20 72 30 25  3b 72 65 67 25 0d 0c 9e  |11 . r0%;reg%...|
00001c10  13 e7 20 28 72 65 67 25  80 20 31 29 3d 31 20 8c  |.. (reg%. 1)=1 .|
00001c20  0d 0c a8 38 20 65 72 72  6f 72 5f 66 6c 61 67 25  |...8 error_flag%|
00001c30  3d 31 3a f2 65 72 72 6f  72 62 6f 78 28 a4 72 74  |=1:.errorbox(.rt|
00001c40  6f 7a 28 72 30 25 2b 34  29 29 3a 65 72 72 6f 72  |oz(r0%+4)):error|
00001c50  5f 66 6c 61 67 25 3d 33  0d 0c b2 0f 20 24 66 69  |_flag%=3.... $fi|
00001c60  6c 65 31 25 3d 22 22 0d  0c bc 0f 20 24 66 69 6c  |le1%="".... $fil|
00001c70  65 32 25 3d 22 22 0d 0c  c6 74 20 24 70 72 6f 6d  |e2%=""...t $prom|
00001c80  70 74 25 3d 22 41 70 70  6c 69 63 61 74 69 6f 6e  |pt%="Application|
00001c90  20 75 70 64 61 74 65 20  66 61 69 6c 65 64 2e 20  | update failed. |
00001ca0  20 43 6f 72 72 65 63 74  20 74 68 65 20 70 72 6f  | Correct the pro|
00001cb0  62 6c 65 6d 20 74 68 65  6e 20 64 72 61 67 20 74  |blem then drag t|
00001cc0  68 65 20 6f 72 69 67 69  6e 61 6c 20 61 70 70 6c  |he original appl|
00001cd0  69 63 61 74 69 6f 6e 20  69 6e 74 6f 20 74 68 69  |ication into thi|
00001ce0  73 20 77 69 6e 64 6f 77  2e 22 0d 0c d0 0d 20 73  |s window.".... s|
00001cf0  74 61 67 65 25 3d 31 0d  0c da 18 20 f2 72 65 66  |tage%=1.... .ref|
00001d00  72 65 73 68 5f 73 79 73  5f 77 69 6e 64 6f 77 0d  |resh_sys_window.|
00001d10  0c e4 06 20 e1 0d 0c ee  05 cd 0d 0c f8 3e f4 20  |... .........>. |
00001d20  4f 53 43 4c 49 22 63 6f  70 79 20 22 2b 24 66 69  |OSCLI"copy "+$fi|
00001d30  6c 65 32 25 2b 22 20 22  2b 24 66 69 6c 65 31 25  |le2%+" "+$file1%|
00001d40  2b 22 20 72 6e 66 7e 63  7e 76 61 7e 64 6c 7e 70  |+" rnf~c~va~dl~p|
00001d50  7e 71 7e 73 7e 74 22 31  0d 0d 02 0c 73 74 61 67  |~q~s~t"1....stag|
00001d60  65 25 3d 34 0d 0d 0c 23  24 70 72 6f 6d 70 74 25  |e%=4...#$prompt%|
00001d70  3d 22 41 70 70 6c 69 63  61 74 69 6f 6e 20 75 70  |="Application up|
00001d80  64 61 74 65 64 2e 22 0d  0d 16 17 f2 72 65 66 72  |dated.".....refr|
00001d90  65 73 68 5f 73 79 73 5f  77 69 6e 64 6f 77 0d 0d  |esh_sys_window..|
00001da0  20 15 c8 99 22 48 6f 75  72 67 6c 61 73 73 5f 4f  | ..."Hourglass_O|
00001db0  66 66 22 0d 0d 2a 05 e1  0d 0d 34 05 3a 0d 0d 3e  |ff"..*....4.:..>|
00001dc0  11 dd a4 75 70 70 65 72  28 73 74 72 24 29 0d 0d  |...upper(str$)..|
00001dd0  48 11 ea 72 74 6e 24 2c  20 6c 25 2c 20 63 24 0d  |H..rtn$, l%, c$.|
00001de0  0d 52 0b 72 74 6e 24 3d  22 22 0d 0d 5c 12 e3 20  |.R.rtn$=""..\.. |
00001df0  6c 25 3d 31 20 b8 20 a9  73 74 72 24 0d 0d 66 14  |l%=1 . .str$..f.|
00001e00  20 20 63 24 3d c1 73 74  72 24 2c 6c 25 2c 31 29  |  c$=.str$,l%,1)|
00001e10  0d 0d 70 1b 20 20 e7 20  63 24 3e 3d 22 61 22 20  |..p.  . c$>="a" |
00001e20  80 20 63 24 3c 3d 22 7a  22 20 8c 0d 0d 7a 19 20  |. c$<="z" ...z. |
00001e30  20 20 20 20 72 74 6e 24  2b 3d bd 28 97 63 24 82  |    rtn$+=.(.c$.|
00001e40  26 32 30 29 0d 0d 84 07  20 20 cc 0d 0d 8e 11 20  |&20)....  ..... |
00001e50  20 20 20 20 72 74 6e 24  2b 3d 63 24 0d 0d 98 07  |    rtn$+=c$....|
00001e60  20 20 cd 0d 0d a2 05 ed  0d 0d ac 09 3d 72 74 6e  |  ..........=rtn|
00001e70  24 0d 0d b6 05 3a 0d 0d  c0 27 dd a4 63 68 65 63  |$....:...'..chec|
00001e80  6b 5f 6c 65 61 66 28 66  69 6c 65 6e 61 6d 65 31  |k_leaf(filename1|
00001e90  24 2c 66 69 6c 65 6e 61  6d 65 32 24 29 0d 0d ca  |$,filename2$)...|
00001ea0  37 f4 20 43 68 65 63 6b  73 20 74 68 61 74 20 74  |7. Checks that t|
00001eb0  68 65 20 32 20 66 69 6c  65 6e 61 6d 65 73 20 72  |he 2 filenames r|
00001ec0  65 66 65 72 20 74 6f 20  74 68 65 20 73 61 6d 65  |efer to the same|
00001ed0  20 61 70 70 0d 0d d4 1d  f4 20 54 68 69 73 20 69  | app..... This i|
00001ee0  73 20 61 20 62 69 74 20  6f 66 20 61 20 68 61 63  |s a bit of a hac|
00001ef0  6b 0d 0d de 2e ea 20 49  25 2c 73 69 7a 65 25 2c  |k..... I%,size%,|
00001f00  69 6e 64 65 78 25 2c 72  65 73 75 6c 74 25 2c 6e  |index%,result%,n|
00001f10  61 6d 65 31 24 2c 6e 61  6d 65 32 24 2c 63 24 0d  |ame1$,name2$,c$.|
00001f20  0d e8 0d 72 65 73 75 6c  74 25 3d 30 0d 0d f2 17  |...result%=0....|
00001f30  73 69 7a 65 25 3d a9 28  66 69 6c 65 6e 61 6d 65  |size%=.(filename|
00001f40  31 24 29 0d 0d fc 0d 49  25 3d 73 69 7a 65 25 20  |1$)....I%=size% |
00001f50  0d 0e 06 0c 69 6e 64 65  78 25 3d 30 0d 0e 10 18  |....index%=0....|
00001f60  63 24 3d c1 66 69 6c 65  6e 61 6d 65 31 24 2c 49  |c$=.filename1$,I|
00001f70  25 2c 31 29 0d 0e 1a 11  c8 95 20 63 24 20 3c 3e  |%,1)...... c$ <>|
00001f80  20 22 2e 22 20 0d 0e 24  0d 20 20 49 25 3d 49 25  | "." ..$.  I%=I%|
00001f90  2d 31 0d 0e 2e 13 20 20  69 6e 64 65 78 3d 69 6e  |-1....  index=in|
00001fa0  64 65 78 2b 31 0d 0e 38  1a 20 20 63 24 3d c1 66  |dex+1..8.  c$=.f|
00001fb0  69 6c 65 6e 61 6d 65 31  24 2c 49 25 2c 31 29 0d  |ilename1$,I%,1).|
00001fc0  0e 42 17 ce 20 20 20 20  20 20 20 20 20 20 20 20  |.B..            |
00001fd0  20 20 20 20 20 20 0d 0e  4c 27 6e 61 6d 65 31 24  |      ..L'name1$|
00001fe0  20 3d 20 c1 66 69 6c 65  6e 61 6d 65 31 24 2c 49  | = .filename1$,I|
00001ff0  25 2b 31 2c 73 69 7a 65  25 2d 49 25 29 0d 0e 56  |%+1,size%-I%)..V|
00002000  17 73 69 7a 65 25 3d a9  28 66 69 6c 65 6e 61 6d  |.size%=.(filenam|
00002010  65 32 24 29 0d 0e 60 0d  49 25 3d 73 69 7a 65 25  |e2$)..`.I%=size%|
00002020  20 0d 0e 6a 0c 69 6e 64  65 78 25 3d 30 0d 0e 74  | ..j.index%=0..t|
00002030  18 63 24 3d c1 66 69 6c  65 6e 61 6d 65 32 24 2c  |.c$=.filename2$,|
00002040  49 25 2c 31 29 0d 0e 7e  11 c8 95 20 63 24 20 3c  |I%,1)..~... c$ <|
00002050  3e 20 22 2e 22 20 0d 0e  88 0d 20 20 49 25 3d 49  |> "." ....  I%=I|
00002060  25 2d 31 0d 0e 92 13 20  20 69 6e 64 65 78 3d 69  |%-1....  index=i|
00002070  6e 64 65 78 2b 31 0d 0e  9c 1a 20 20 63 24 3d c1  |ndex+1....  c$=.|
00002080  66 69 6c 65 6e 61 6d 65  32 24 2c 49 25 2c 31 29  |filename2$,I%,1)|
00002090  0d 0e a6 17 ce 20 20 20  20 20 20 20 20 20 20 20  |.....           |
000020a0  20 20 20 20 20 20 20 0d  0e b0 27 6e 61 6d 65 32  |       ...'name2|
000020b0  24 20 3d 20 c1 66 69 6c  65 6e 61 6d 65 32 24 2c  |$ = .filename2$,|
000020c0  49 25 2b 31 2c 73 69 7a  65 25 2d 49 25 29 0d 0e  |I%+1,size%-I%)..|
000020d0  ba 2e e7 20 6e 61 6d 65  31 24 20 3c 3e 20 6e 61  |... name1$ <> na|
000020e0  6d 65 32 24 20 8c 20 72  65 73 75 6c 74 25 3d 31  |me2$ . result%=1|
000020f0  20 8b 20 72 65 73 75 6c  74 25 3d 30 0d 0e c4 0c  | . result%=0....|
00002100  3d 72 65 73 75 6c 74 25  0d 0e ce 04 0d 0e d8 04  |=result%........|
00002110  0d 0e e2 04 0d 0e ec 06  20 20 0d 0e f6 04 0d ff  |........  ......|
00002120
!Merge/!RunImage.m0
!Merge/!RunImage.m1
!Merge/!RunImage.m2
!Merge/!RunImage.m4
!Merge/!RunImage.m5