Home » Personal collection » Acorn hard disk » apps » !Style » !MailMerge/!RunImage

!MailMerge/!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 hard disk » apps » !Style
Filename: !MailMerge/!RunImage
Read OK:
File size: 6733 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > !RunImage
   20Debug% = FALSE
   30ON ERROR ERROR EXT ERR,REPORT$+" at line "+STR$(ERL)
   40PROCconsts
   50hourglass_count%=0
   60PROChourglass_on
   70DIM countrybuff 64
   80PROCreadopsys
   90SYS "OS_Byte", 70, 127 TO ,country%
  100SYS "OS_ServiceCall", , &43, 2, country% , countrybuff, 256 TO ,,,,, length%
  110countrybuff?length%=13
  120PROCmsg_initialise(appdir$+"."+$countrybuff)
  130PROCtask_initialise(FNmsg_0("ID"))
  140PROCicon_initialise
  150PROCwin_initialise
  160PROCerror_initialise
  170PROCinitialise
  180END=END+8096
  190heap_end%=HIMEM
  200HIMEM=END+8096
  210heap_start%=HIMEM
  220heap_size%=heap_end%-heap_start%
  230SYS"OS_ReadMemMapInfo" TO heap_psize%
  240IFheap_size%<>0 THEN
  250 SYS"OS_Heap",0,heap_start%,,heap_size%
  260ELSE
  270 PROCheap_increase
  280ENDIF
  290PROChourglass_off
  300ON ERROR PROCerror
  310REPEAT
  320 SYS "Wimp_Poll",task_mask%,task_buff% TO task_action%
  330 SYS "Impulse_Decode",task_action%,task_buff%,,,,method_table%,task_handle% TO task_action%,,,,,token%,params%,object%
  340 CASE task_action% OF
  350   WHEN 0 : PROCnull
  360   WHEN 2 : SYS"Wimp_OpenWindow",,task_buff%
  370   WHEN 3 : IF printing% THEN
  380              pending_close%=TRUE
  390            ELSE
  400              PROChost_shutdown
  410            ENDIF
  420   WHEN 6 : PROCmouse_click
  430   WHEN 9 : PROCmenu_click
  440   WHEN 17,18 : PROCreceive
  450   WHEN Impulse_Command%, Impulse_Request%
  460     PROCcommand(token%,params%,object%)
  470   WHEN Impulse_Reply%
  480     PROCreply(token%)
  490   WHEN Impulse_SendData%
  500     PROCsend_data(token%,params%,object%)
  510 ENDCASE
  520UNTIL FALSE
  530END
  540DEF PROCinitialise
  550SYS"Impulse_Initialise",0,task_handle%,FNmsg_0("ID"),-1
  560PROCwin_load_create(appdir$+".Templates","main",1,main%)
  570PROCicon_hide(main%,Icon_ToProc%)
  580PROCicon_hide(main%,Icon_RecsProc%)
  590PROCicon_hide(main%,Icon_PrintAll%)
  600PROCicon_hide(main%,Icon_ToGo%)
  610PROCicon_hide(main%,Icon_Done%)
  620PROCicon_hide(main%,Icon_Print%)
  630PROCicon_hide(main%,Icon_Next%)
  640PROCicon_hide(main%,Icon_Edit%)
  650PROCicon_hide(main%,Icon_StartMerge%)
  660PROCicon_write(main%,Icon_CSV%,"")
  670PROCicon_write(main%,Icon_document%,"")
  680PROCicon_shade(main%,Icon_DispHead%)
  690!win_buff%=main%:SYS"Wimp_GetWindowState",,win_buff%
  700win_buff%!8=win_buff%!16 - Window_Small%
  710SYS"Wimp_OpenWindow",,win_buff%
  720DIM method_table% 64
  730P%=method_table%
  740[ OPT 0
  750   EQUD 0                       ; method structure format
  760   EQUD 0                       ; flags
  770   EQUD T_GetField%       ; token
  780   EQUS "GetField"+CHR$0        ; method
  790   EQUS CHR$0                   ; syntax
  800   ALIGN
  810   EQUD 0
  820   EQUD T_CloseDown%      ; token
  830   EQUS "CloseDown"+CHR$0       ; method
  840   EQUS CHR$0                   ; syntax
  850   ALIGN
  860]
  870menu%=0
  880merge%=FALSE
  890printing%=FALSE
  900dieplease%=FALSE      : 
  910preserved_start_of_data_ptr%=0
  920pending_close%=FALSE
  930transmit%=FALSE
  940transmit_count%=0
  950transmit_block%=0
  960gotprintreply%=FALSE
  970PROCmerge_off
  980ENDPROC
  990DEF PROCnull
 1000LOCAL result%
 1010IF ((printing%=TRUE) AND (gotprintreply%=TRUE)) THEN
 1020        gotprintreply%=FALSE
 1030        PROCsend("Print",T_Print%)
 1040ENDIF
 1050ENDPROC
 1060DEF PROChost_shutdown
 1070IF NOT dieplease% THEN PROCsend("MailDied",-1)     : 
 1080PROCclose_csv_file
 1090WHILE hourglass_count%
 1100 PROChourglass_off
 1110ENDWHILE
 1120IFmerge% PROCmerge_off
 1130SYS"Impulse_CloseDown",task_handle%
 1140PROCtask_shutdown
 1150ENDPROC
 1160DEF PROCreceive
 1170CASE task_buff%!16 OF
 1180WHEN Message_Quit%
 1190  PROChost_shutdown
 1200WHEN Message_DataSave%
 1210  PROCdatasave
 1220WHEN Message_DataLoad%
 1230  PROCdataload
 1240WHEN Message_PreQuit%
 1250  PROCprequit
 1260WHEN Message_TaskCloseDown%
 1270  IFdoc_file$<>"" AND task_buff%!4=doc_task% PROChost_shutdown
 1280WHEN Message_WindowClosed%
 1290WHEN Message_MM_Document%
 1300  IF doc_file$="" THEN PROCdoc_received
 1310ENDCASE
 1320ENDPROC
 1330DEF PROCmouse_click
 1340LOCAL menuptr%,maxx%,i%,p%,ix%,iy%
 1350IF task_buff%!8<>4 ENDPROC
 1360CASE task_buff%!16 OF
 1370  WHEN Icon_Headings%
 1380    IF csv_file$<>"" THEN
 1390      IF FNicon_set(main%,Icon_Headings%) THEN
 1400        PROCcreate_csv_headings
 1410        rec_togo% += 1
 1420      ELSE
 1430        PROCget_csv_headings
 1440        rec_togo% -= 1
 1450      ENDIF
 1460    ENDIF
 1470  WHEN Icon_DispHead%
 1480    IF menu% PROCheap_free("MENU",menu%)
 1490    menu%=FNheap_claim("MENU",28+csv_count%*24)
 1500    $menu%=FNmsg_0("MT")
 1510    menu%?12=7
 1520    menu%?13=2
 1530    menu%?14=7
 1540    menu%?15=0
 1550    menu%!20=44
 1560    menu%!24=0
 1570    menuptr%=menu%+28
 1580    maxx%=LEN(FNmsg_0("MT"))-3
 1590    p%=csv_headings%
 1600    FORi%=1 TO csv_count%
 1610      IFi%=csv_count% !menuptr%=&80 ELSE !menuptr%=0
 1620      menuptr%!4=-1
 1630      menuptr%!8=&07000121
 1640      menuptr%!12=p%+4
 1650      menuptr%!16=-1
 1660      menuptr%!20=LEN($(p%+4))+1
 1670      menuptr%+=24
 1680      IFLEN($(p%+4))>maxx% maxx%=LEN($(p%+4))
 1690      p%=!p%
 1700    NEXT
 1710    menu%!16=(maxx%*8+6)*2
 1720    !task_buff%=main%:task_buff%!4=Icon_DispHead%
 1730    SYS"Wimp_GetIconState",,task_buff%:ix%=task_buff%!16:iy%=task_buff%!20
 1740    SYS"Wimp_GetWindowState",,task_buff%
 1750    display_menu_x% = task_buff%!20+task_buff%!4+ix%+2
 1760    display_menu_y% = task_buff%!24+task_buff%!16+iy%-2
 1770    SYS"Wimp_CreateMenu",,menu%,display_menu_x%,display_menu_y%
 1780  WHEN Icon_StartMerge%
 1790    PROCtry_merge_on
 1800  WHEN Icon_Next%
 1810    PROCmerge_next_record
 1820  WHEN Icon_Print%
 1830    PROCsend("Print",T_Print%)
 1840    printing%=TRUE
 1850    PROCdisable_merging_buttons
 1860  WHEN Icon_Edit%
 1870    PROCsend("ClearMerge",-1)
 1880    PROChost_shutdown
 1890ENDCASE
 1900ENDPROC
 1910DEFPROCmenu_click
 1920LOCAL c%,l%,f%
 1930f%=!task_buff%
 1940SYS"Wimp_GetCaretPosition",,task_buff%+20
 1950IFtask_buff%!20<>doc_window% ERROR task_ok%, FNmsg_0("OK5")
 1960l%=csv_headings%
 1970WHILE f%
 1980  l%=!l%
 1990  f%-=1
 2000ENDWHILE
 2010c%=OPENOUT"<Wimp$Scrap>"
 2020BPUT#c%,"{ merge "+CHR$Char_Quote%+":"+FNmsg_0("ID")+" GetField "+$(l%+4)+CHR$Char_Quote%+"}";
 2030l%=EXT#c%
 2040CLOSE#c%
 2050SYS"OS_File",18,"<Wimp$Scrap>",DDF_Type%
 2060!task_buff%=60
 2070task_buff%!12=0
 2080task_buff%!16=3
 2090task_buff%!24=&4B535554
 2100task_buff%!36=l%
 2110task_buff%!40=DDF_Type%
 2120$(task_buff%+44)="<Wimp$Scrap>"+CHR$0
 2130SYS"Wimp_SendMessage",17,task_buff%,doc_task%
 2140SYS"Wimp_GetPointerInfo",,task_buff%
 2150IF(task_buff%!8 AND 1) SYS"Wimp_CreateMenu",,menu%,display_menu_x%,display_menu_y%
 2160ENDPROC
 2170DEF PROCdataload
 2180IFtask_buff%!40<>CSV_Type% OR doc_file$="" ENDPROC
 2190IFmerge% ERROR task_ok%,FNmsg_0("OK1")
 2200csv_file$=FNtask_rtoz(task_buff%+44)
 2210task_buff%!12=task_buff%!8
 2220task_buff%!16=4
 2230SYS"Wimp_SendMessage",17,task_buff%,task_buff%!4
 2240PROCicon_hide(main%,Icon_DropHere%)
 2250PROCicon_unhide(main%,Icon_StartMerge%)
 2260PROCicon_unshade(main%,Icon_DispHead%)
 2270csv_count%=FNdetermine_number_of_fields
 2280IF NOT FNicon_set(main%,Icon_Headings%) PROCget_csv_headings ELSE PROCcreate_csv_headings
 2290rec_togo%=FNdetermine_number_of_records
 2300PROCicon_write(main%,Icon_CSV%,FNleaf(csv_file$))
 2310ENDPROC
 2320DEF PROCcopy_field(to%, RETURN last_field%, RETURN field_length%, fudge_spaces%)
 2330LOCAL got_quote%, got_slash%, b%, finished%
 2340got_quote%=FALSE
 2350got_slash%=FALSE
 2360last_field%=FALSE
 2370field_length%=0
 2380finished%=FALSE
 2390REPEAT
 2400 b%=BGET#csv_file_handle%
 2410 CASE TRUE OF
 2420 WHEN b%=Char_Quote%
 2430  got_quote%=NOT got_quote%
 2440 WHEN b%=Char_Slash%
 2450  IF got_slash% THEN
 2460   PROCcopy_field_stuff_char(to%,ASC"\",field_length%)
 2470   got_slash%=FALSE
 2480  ELSE
 2490   got_slash%=TRUE
 2500  ENDIF
 2510 WHEN b%=Char_Space%
 2520  IF fudge_spaces% THEN
 2530   PROCcopy_field_stuff_char(to%,Char_HardSpace%,field_length%)
 2540  ELSE
 2550   PROCcopy_field_stuff_char(to%,Char_Space%,field_length%)
 2560  ENDIF
 2570 WHEN b%=Char_Comma%
 2580  IF got_quote% PROCcopy_field_stuff_char(to%,b%,field_length%) ELSE finished%=TRUE
 2590 WHEN b%=Char_LF% OR b%=Char_CR% OR EOF#csv_file_handle%
 2600  last_field%=TRUE
 2610  finished%=TRUE
 2620 OTHERWISE
 2630  IF got_slash% THEN
 2640   CASE b% OF
 2650        WHEN ASC"n": PROCcopy_field_stuff_char(to%,10,field_length%)
 2660   ENDCASE
 2670   got_slash%=FALSE
 2680  ELSE
 2690   PROCcopy_field_stuff_char(to%,b%,field_length%)
 2700  ENDIF
 2710 ENDCASE
 2720UNTIL finished%
 2730IF to% ?to%=13
 2740ENDPROC
 2750DEFPROCcopy_field_stuff_char(RETURN to%, char%, RETURN length%)
 2760length%+=1
 2770IFto% ?to%=char%:to%+=1
 2780ENDPROC
 2790DEF FNdetermine_number_of_fields
 2800LOCAL s$,count%,last_field%,dummy%
 2810PROCopen_csv_file
 2820IF csv_file_handle%=0 s$=csv_file$:csv_file$="":ERROR task_ok%,FNmsg_1("OK2",s$)
 2830REPEAT
 2840 PROCcopy_field(0,last_field%,dummy%,FALSE)
 2850 count%+=1
 2860UNTIL last_field%
 2870PROCclose_csv_file
 2880=count%
 2890DEF PROCget_csv_headings
 2900LOCAL s$,i%,last_node%,node%,dummy%
 2910WHILE csv_headings%
 2920 next%=!csv_headings%
 2930 PROCheap_free("CSVH",csv_headings%)
 2940 csv_headings%=next%
 2950ENDWHILE
 2960PROCopen_csv_file
 2970last_node%=0
 2980FOR i%=1 TO csv_count%
 2990 PROCcopy_field(task_buff%,dummy%,dummy%,TRUE)
 3000 s$=$task_buff%
 3010 IF s$="" s$=FNmsg_1("FI",STR$(i%))
 3020 node%=FNheap_claim("CSVH",LEN(s$)+5)
 3030 !node%=0
 3040 $(node%+4)=s$
 3050 IF last_node% !last_node%=node% ELSE csv_headings%=node%
 3060 last_node%=node%
 3070NEXT
 3080csv_file_ptr%=PTR#csv_file_handle%
 3090PROCclose_csv_file
 3100ENDPROC
 3110DEF PROCcreate_csv_headings
 3120LOCAL s$,i%,last%,node%
 3130WHILE csv_headings%
 3140 node%=!csv_headings%
 3150 PROCheap_free("CSVH",csv_headings%)
 3160 csv_headings%=node%
 3170ENDWHILE
 3180last%=0
 3190FOR i%=1 TO csv_count%
 3200 s$=FNmsg_1("FI",STR$(i%))
 3210 node%=FNheap_claim("CSVH",LEN(s$)+5)
 3220 !node%=0
 3230 $(node%+4)=s$
 3240 IF last% !last%=node% ELSE csv_headings%=node%
 3250 last%=node%
 3260NEXT
 3270csv_file_ptr%=0
 3280ENDPROC
 3290DEF FNdetermine_number_of_records
 3300LOCAL count%,b%,new_line%
 3310count%=0
 3320PROChourglass_on
 3330PROCopen_csv_file
 3340PTR#csv_file_handle%=csv_file_ptr% 
 3350new_line%=TRUE
 3360REPEAT
 3370 b%=BGET#csv_file_handle%
 3380 IF b%=Char_CR% OR b%=Char_LF% OR EOF#csv_file_handle% THEN
 3390  IF NOT new_line% THEN count%+=1
 3400  new_line%=TRUE
 3410 ELSE
 3420  new_line%=FALSE
 3430 ENDIF
 3440UNTIL EOF#csv_file_handle%
 3450PROCclose_csv_file
 3460PROChourglass_off
 3470=count%
 3480DEF PROCdoc_received
 3490LOCAL loop%, temp$
 3500IF doc_file$="" THEN
 3510 doc_task%=task_buff%!4
 3520 doc_window%=task_buff%!20
 3530 doc_file$=FNleaf(FNtask_rtoz(task_buff%+24))
 3540ENDIF
 3550IFdoc_task%=task_buff%!4 AND doc_window%=task_buff%!20 AND doc_file$=FNleaf(FNtask_rtoz(task_buff%+24)) THEN
 3560 task_buff%!12=task_buff%!8
 3570 SYS"Wimp_SendMessage",19,task_buff%,task_buff%!4
 3580 !win_buff%=main%:SYS"Wimp_GetWindowState",,win_buff%
 3590 win_buff%!28=-1:SYS"Wimp_OpenWindow",,win_buff%
 3600 PROCicon_write(main%,Icon_document%,doc_file$)
 3610ENDIF
 3620temp$=""
 3630FOR loop%=1 TO LEN(doc_file$)
 3640IF ASC(MID$(doc_file$, loop%,1))>32 THEN temp$+=MID$(doc_file$, loop%, 1)
 3650NEXT loop%
 3660doc_file$=temp$
 3670ENDPROC
 3680DEF PROCdatasave
 3690LOCAL loop%, byte%
 3700IF task_buff%!40=CSV_Type% THEN
 3710 task_buff%!0=256
 3720 task_buff%!12=task_buff%!8
 3730 task_buff%!16=2
 3740 task_buff%!36=-1
 3750loop%=44
 3760WHILE (task_buff%?loop%)>31
 3770      loop%+=1
 3780ENDWHILE
 3790task_buff%?loop%=13
 3800$(task_buff%+44)="<Wimp$ScrapDir>."+$(task_buff%+44)
 3810SYS"Wimp_SendMessage",17,task_buff%,task_buff%!4
 3820ENDIF
 3830ENDPROC
 3840DEF FNleaf(s$)
 3850LOCAL dotindex%
 3860dotindex%=0
 3870WHILE INSTR(s$,".",dotindex%+1)
 3880  dotindex%=INSTR(s$,".",dotindex%+1)
 3890ENDWHILE
 3900=MID$(s$,dotindex%+1)
 3910DEF PROCprequit
 3920IFmerge% THEN
 3930 
 3940ENDIF
 3950ENDPROC
 3960DEF PROCtry_merge_on
 3970merge%=TRUE
 3980preserved_start_of_data_ptr%=csv_file_ptr%
 3990PROCsend("Edit Off",-1)
 4000PROCmerge_next_record
 4010ENDPROC
 4020DEF PROCmerge_off
 4030LOCAL next%
 4040IF merge% PROCsend("Edit On",-1)
 4050merge%=FALSE
 4060csv_file$=""
 4070csv_file_handle%=0
 4080csv_count%=0
 4090csv_headings%=0
 4100csv_field_ptrs%=0
 4110csv_field_lens%=0
 4120csv_file_ptr%=0
 4130doc_file$=""
 4140doc_task%=0
 4150doc_window%=0
 4160field_count%=0
 4170rec_togo%=0
 4180rec_done%=0
 4190ENDPROC
 4200DEF PROCmerge_next_record
 4210IF rec_togo%<>0 THEN
 4220 PROChourglass_on
 4230 PROCnext_record
 4240 PROCsend("Merge",T_Merge%)
 4250 PROCdisable_merging_buttons
 4260ELSE
 4270 $(error_buff%+4)=FNmsg_0("OK6")+CHR$0
 4280 SYS"Wimp_ReportError",error_buff%,%10001,FNmsg_1("MS",FNmsg_0("ID"))
 4290 PROChost_shutdown
 4300ENDIF
 4310ENDPROC
 4320DEF PROCnext_record
 4330LOCAL len%,i%,dummy%,finished%,this_ptr%
 4340LOCAL numfields%
 4350numfields%=0
 4360PROCopen_csv_file
 4370IF csv_file_handle%=0 ERROR task_ok%,FNmsg_1("OK2",csv_file$)
 4380WHILE csv_field_ptrs%
 4390 next%=!csv_field_ptrs%
 4400 PROCheap_free("CSVP",csv_field_ptrs%)
 4410 csv_field_ptrs%=next%
 4420ENDWHILE
 4430WHILE csv_field_lens%
 4440 next%=!csv_field_lens%
 4450 PROCheap_free("CSVL",csv_field_lens%)
 4460 csv_field_lens%=next%
 4470ENDWHILE
 4480PTR#csv_file_handle%=csv_file_ptr%
 4490i%=0
 4500REPEAT
 4510  i%+=1
 4520  REPEAT
 4530    this_ptr%=PTR#csv_file_handle%    
 4540    PROCcopy_field(0,dummy%,len%,FALSE)
 4550    finished%=TRUE
 4560    IF NOT EOF#csv_file_handle% AND i%=1 AND len%=0 AND dummy% THEN finished%=FALSE
 4570  UNTIL finished%
 4580  PROCadd_field_ptr(this_ptr%)
 4590  PROCadd_field_len(len%)
 4600UNTIL i%=csv_count% OR dummy% OR EOF#csv_file_handle%
 4610IF NOT dummy% PROCeol
 4620IF i%<csv_count% THEN
 4630  WHILE i%<csv_count%
 4640   i%+=1
 4650   PROCadd_field_ptr(0)
 4660   PROCadd_field_len(0)
 4670  ENDWHILE
 4680ENDIF
 4690csv_file_ptr%=PTR#csv_file_handle%
 4700PROCclose_csv_file
 4710ENDPROC
 4720DEF PROCeol
 4730LOCAL x
 4740x=0
 4750REPEAT
 4760 IF NOT EOF#csv_file_handle% THEN x=BGET#csv_file_handle%
 4770UNTIL x=Char_CR% OR x=Char_LF% OR EOF#csv_file_handle%
 4780ENDPROC
 4790DEF PROCadd_field_ptr(index%)
 4800LOCAL node%,last%
 4810node%=FNheap_claim("CSVP",8)
 4820node%!0=0
 4830node%!4=index%
 4840IF csv_field_ptrs%=0 THEN
 4850 csv_field_ptrs%=node%
 4860ELSE
 4870 last%=csv_field_ptrs%
 4880 WHILE !last%
 4890  last%=!last%
 4900 ENDWHILE
 4910 !last%=node%
 4920ENDIF
 4930ENDPROC
 4940DEFPROCadd_field_len(index%)
 4950LOCAL node%,last%
 4960node%=FNheap_claim("CSVL",8)
 4970node%!0=0
 4980node%!4=index%
 4990IF csv_field_lens%=0 THEN
 5000 csv_field_lens%=node%
 5010ELSE
 5020 last%=csv_field_lens%
 5030 WHILE !last%
 5040  last%=!last%
 5050 ENDWHILE
 5060 !last%=node%
 5070ENDIF
 5080ENDPROC
 5090DEF FNfield_ptr(index%)
 5100LOCAL node%
 5110node%=csv_field_ptrs%
 5120WHILE index%
 5130 
 5140 node%=!node%:IFnode%=0 ERROR task_fatal%,"Bad field ptr requested"
 5150 index%-=1
 5160ENDWHILE
 5170=node%!4
 5180DEF FNfield_len(index%)
 5190LOCAL node%
 5200node%=csv_field_lens%
 5210WHILE index%
 5220 
 5230 node%=!node%:IFnode%=0 ERROR task_fatal%,"Bad field len requested"
 5240 index%-=1
 5250ENDWHILE
 5260=node%!4
 5270DEF PROCsend(command$,replytoken%)
 5280LOCAL i%,m$
 5290IF doc_file$="" THEN ENDPROC
 5300IF replytoken%<>-1 i%=Impulse_Request% ELSE i%=Impulse_Command%
 5310m$=":"+FNmsg_0("SV")+"."+doc_file$+" "+command$
 5320SYS"Impulse_SendMessage",i%,m$,0,0,0,replytoken%,task_handle%,0
 5330ENDPROC
 5340DEFPROCdisable_merging_buttons
 5350PROCicon_shade(main%,Icon_PrintAll%)
 5360PROCicon_shade(main%,Icon_Print%)
 5370PROCicon_shade(main%,Icon_Next%)
 5380PROCicon_shade(main%,Icon_Edit%)
 5390ENDPROC
 5400DEFPROCenable_merging_buttons
 5410PROCicon_unshade(main%,Icon_PrintAll%)
 5420PROCicon_unshade(main%,Icon_Print%)
 5430PROCicon_unshade(main%,Icon_Next%)
 5440PROCicon_unshade(main%,Icon_Edit%)
 5450ENDPROC
 5460DEF PROCcommand(token%,params%,object%)
 5470CASE token% OF
 5480  WHEN T_GetField%
 5490      PROCget_field(params%,object%)
 5500      field_count%+=1
 5510  WHEN T_CloseDown%
 5520      dieplease% = TRUE
 5530      PROChost_shutdown
 5540ENDCASE
 5550ENDPROC
 5560DEF PROCget_field(params%,object%)
 5570LOCAL field_index%, field_name$, ptr%, finished%
 5580IF params%=-1 ENDPROC
 5590field_name$=FNtask_rtoz(params%)
 5600field_index%=0
 5610ptr%=csv_headings%
 5620finished%=FALSE
 5630REPEAT
 5640 field_index%+=1
 5650 IF $(ptr%+4)=field_name$ THEN
 5660  finished%=TRUE
 5670 ELSE
 5680  ptr%=!ptr%
 5690  IF ptr%=0 THEN finished%=TRUE:field_index%=-1
 5700 ENDIF
 5710  IF ptr%=0 THEN
 5720    $(error_buff%+4)=FNmsg_1("OK4", field_name$)
 5730    SYS "Wimp_ReportError",error_buff%,%10001,FNmsg_1("MS",FNmsg_0("ID"))
 5740  ENDIF
 5750UNTIL finished%
 5760IF field_index%<1 OR field_index%>csv_count% THEN
 5770  PROCtrans_reply_block(0,0)
 5780ELSE
 5790  PROCtrans_reply_block(FNfield_ptr(field_index%-1),FNfield_len(field_index%-1))
 5800ENDIF
 5810ENDPROC
 5820DEFPROCtrans_reply_block(ptr%,len%)
 5830LOCAL dummy%
 5840transmit%=TRUE
 5850transmit_ptr%=0
 5860IF transmit_block% PROCheap_free("BLCK",transmit_block%)
 5870transmit_block%=FNheap_claim("BLCK",len%+1)
 5880IF len%>0 THEN
 5890  PROCopen_csv_file
 5900  IF csv_file_handle%=0 transmit%=FALSE:ERROR task_ok%,FNmsg_2("OK2",csv_file$)
 5910  PTR#csv_file_handle%=ptr%
 5920  PROCcopy_field(transmit_block%,dummy%,len%,FALSE)
 5930  PROCclose_csv_file
 5940ELSE
 5950  $transmit_block%=""
 5960ENDIF
 5970transmit_top%=(len%+1+3)ANDNOT3
 5980transmit_size%=len%
 5990transmit_tag%=FNnext_transmit_tag
 6000SYS"Impulse_SendMessage",Impulse_Reply%,"Dummy text",-1,,,transmit_tag%,task_handle%,transmit_top%-transmit_ptr%
 6010ENDPROC
 6020DEFFNnext_transmit_tag
 6030transmit_count%+=1
 6040=transmit_count%
 6050DEFPROCsend_data(token%,buffer%,buffersize%)
 6060LOCAL size%,i%
 6070IFNOTtransmit% OR (token%<>transmit_tag%) ERROR task_ok%, FNmsg_0("OK3")
 6080size%=transmit_top%-transmit_ptr%
 6090IF size%<buffersize% OR size%=0 transmit%=FALSE
 6100IF size%>buffersize% size=buffersize%
 6110?(transmit_ptr%+transmit_block%+transmit_size%)=0
 6120SYS"Impulse_TransmitData",transmit_ptr%+transmit_block%,size%,,,,,task_handle%
 6130transmit_ptr%+=size%
 6140ENDPROC
 6150DEF PROCreply(token%)
 6160CASE token% OF
 6170  WHEN T_Print%: PROCreply_print
 6180  WHEN T_Merge%: PROCmerge_done
 6190ENDCASE
 6200ENDPROC
 6210DEF PROCmerge_done
 6220IFrec_done%=0 THEN
 6230  IFfield_count%=0 THEN
 6240    PROCsend("Edit On",-1)
 6250    csv_file_ptr%=preserved_start_of_data_ptr%
 6260    merge%=FALSE
 6270    ERROR task_ok%, FNmsg_0("OK7")
 6280  ENDIF
 6290  PROCicon_write(main%,Icon_ToGo%,STR$(rec_togo%))
 6300  PROCicon_write(main%,Icon_Done%,"1")
 6310  PROCicon_unhide(main%,Icon_ToProc%)
 6320  PROCicon_unhide(main%,Icon_RecsProc%)
 6330  PROCicon_unhide(main%,Icon_PrintAll%)
 6340  PROCicon_unhide(main%,Icon_ToGo%)
 6350  PROCicon_unhide(main%,Icon_Done%)
 6360  PROCicon_unhide(main%,Icon_Print%)
 6370  PROCicon_unhide(main%,Icon_Next%)
 6380  PROCicon_unhide(main%,Icon_Edit%)
 6390  PROCicon_hide(main%,Icon_Headings%)
 6400  PROCicon_hide(main%,Icon_DispHead%)
 6410  PROCicon_hide(main%,Icon_StartMerge%)
 6420  !win_buff%=main%:SYS"Wimp_GetWindowState",,win_buff%
 6430  win_buff%!8=win_buff%!16 - Window_Big%
 6440  SYS"Wimp_OpenWindow",,win_buff%
 6450ENDIF
 6460PROCdone_record
 6470PROCenable_merging_buttons
 6480PROChourglass_off
 6490ENDPROC
 6500DEFPROCdone_record
 6510rec_togo%-=1
 6520rec_done%+=1
 6530PROCicon_write(main%,Icon_ToGo%,STR$(rec_togo%))
 6540PROCicon_write(main%,Icon_Done%,STR$(rec_done%))
 6550ENDPROC
 6560DEFPROCreply_print
 6570LOCAL command$
 6580  command$=FNtask_rtoz(task_buff%+36)
 6590  CASE command$ OF
 6600    WHEN "PrintDone" : PROCprint_done
 6610    WHEN "PrintError": PROCprint_error
 6620  ENDCASE
 6630ENDPROC
 6640DEFPROCprint_error
 6650  printing%=FALSE
 6660  gotprintreply%=FALSE
 6670  $(error_buff%+4)=FNmsg_0("OK9")
 6680  SYS "Wimp_ReportError", error_buff%, %10001, FNmsg_1("MS",FNmsg_0("ID"))
 6690  IFpending_close% THEN PROChost_shutdown
 6700  PROCenable_merging_buttons
 6710  PROCicon_unhide(main%, Icon_PrintAll%)
 6720ENDPROC
 6730DEFPROCprint_done
 6740printing%=FALSE
 6750IFpending_close% THEN
 6760        PROChost_shutdown
 6770ELSE
 6780        IFFNicon_set(main%,Icon_PrintAll%) THEN
 6790                
 6800                PROCmerge_next_record
 6810                
 6820                
 6830                
 6840        
 6850                
 6860                gotprintreply%=TRUE
 6870                
 6880                printing%=TRUE
 6890        ELSE
 6900                PROCenable_merging_buttons
 6910        ENDIF
 6920ENDIF
 6930ENDPROC
 6940DEFPROCerror_initialise
 6950DIM error_buff% 256
 6960ENDPROC
 6970DEFPROCerror
 6980LOCAL r$,r%
 6990r$=REPORT$
 7000IFERR=task_ok% OR ERR=task_fatal% THEN
 7010 r%=INSTR(r$,"in "+CHR$Char_Quote%)
 7020 IFr%<>0 r$=LEFT$(r$,r%-1)
 7030ENDIF
 7040CASE ERR OF
 7050WHEN    task_ok%: PROCerror_box(r$,1)
 7060WHEN task_fatal%: PROCerror_box(r$,2)
 7070       OTHERWISE: PROCerror_box("Unexpected error :- "+r$+" ("+STR$(ERR)+"/"+STR$(ERL)+")",3)
 7080ENDCASE
 7090ENDPROC
 7100DEFPROCerror_box(r$,error_flag%)
 7110LOCAL r%
 7120SYS"Wimp_CreateMenu",,-1
 7130!error_buff%=ERR:$(error_buff%+4)=r$+CHR$0
 7140SYS"Wimp_ReportError",error_buff%,error_flag%,task_id$ TO ,r%
 7150IFr%=2 ON ERROR OFF:PROChost_shutdown:END
 7160ENDPROC
 7170DEFPROCheap_free(ident$,block%)
 7180LOCAL r0%,f%
 7190IFblock%<>0 THEN
 7200 block%-=4
 7210 
 7220 IF!block%<>FNheap_ident_num(ident$) ERROR task_ok%,"Corrupt "+ident$+" block not freed"
 7230 SYS"XOS_Heap",3,heap_start%,block% TO r0%;f%
 7240 IF(f% AND 1) ERROR task_fatal%,"Block "+ident$+": "+FNtask_rtoz(r0%+4)
 7250ENDIF
 7260ENDPROC
 7270DEFFNheap_claim(ident$,size%)
 7280LOCAL p%
 7290size%+=4
 7300WHILE size%>=FNheap_freespace PROCheap_increase:ENDWHILE
 7310SYS"OS_Heap",2,heap_start%,,size% TO ,,p%
 7320!p%=FNheap_ident_num(ident$)
 7330p%+=4
 7340=p%
 7350DEFPROCheap_increase
 7360LOCAL slot%
 7370SYS"Wimp_SlotSize",-1,-1 TO slot%
 7380SYS"Wimp_SlotSize",slot%+heap_psize%,-1
 7390IFheap_size%=0 THEN
 7400 SYS"OS_Heap",0,heap_start%,,heap_psize%
 7410ELSE
 7420 SYS"OS_Heap",5,heap_start%,,heap_psize%
 7430ENDIF
 7440heap_size%+=heap_psize%
 7450ENDPROC
 7460DEFFNheap_ident_num(v$)
 7470LOCAL i%,j%
 7480FORi%=0 TO 3
 7490 j%=j% OR ASC(MID$(v$,i%+1,1))<<(i%*8)
 7500NEXT
 7510=j%
 7520DEFFNheap_freespace
 7530LOCAL f%
 7540IFheap_size%=0 THEN =0
 7550SYS"OS_Heap",1,heap_start% TO ,,f%
 7560=f%
 7570DEFPROCwin_initialise
 7580DIM win_buff% 2048
 7590win_template$=""
 7600ENDPROC
 7610DEFPROCwin_load_create(f$,n$,sprite_pool%,RETURN handle%)
 7620PROCwin_load(f$,n$,win_buff%,2048)
 7630win_buff%!64=sprite_pool%
 7640PROCwin_create(win_buff%,handle%)
 7650ENDPROC
 7660DEFPROCwin_load(f$,n$,buf%,limit%)
 7670LOCAL ws_buf%
 7680LOCAL size%
 7690LOCAL data%
 7700LOCAL found%
 7710LOCAL s%,f%
 7720IFf$<>"" THEN
 7730 PROCwin_sizes(f$,n$,size%,data%)
 7740ELSE
 7750 PROCwin_sizes(win_template$,n$,size%,data%)
 7760ENDIF
 7770IFlimit%<(size%+data%) ERROR task_ok%,"Buffer not big enough for '"+n$+"' - "+STR$(size%)+" + "+STR$(data%)+" bytes required"
 7780IFf$<>"" SYS"Wimp_OpenTemplate",,f$
 7790IF data%<>0 THEN
 7800 DIM ws_buf% data%
 7810 SYS"XWimp_LoadTemplate",,buf%,ws_buf%,ws_buf%+data%,-1,n$,0 TO s%,,,,,,found%;f%
 7820ELSE
 7830 SYS"XWimp_LoadTemplate",,buf%,0,0,-1,n$,0 TO s%,,,,,,found%;f%
 7840ENDIF
 7850IFf$<>"" SYS"Wimp_CloseTemplate"
 7860IF(f%AND1) ERROR task_ok%,n$+": "+FNtask_rtoz(s%+4)
 7870IFfound%=0 ERROR task_ok%,"Template '"+n$+"' not found"
 7880ENDPROC
 7890DEFPROCwin_create(buf%,RETURN handle%)
 7900SYS"Wimp_CreateWindow",,buf% TO handle%
 7910ENDPROC
 7920DEFPROCwin_sizes(f$,n$,RETURN size%,RETURN data%)
 7930LOCAL i%
 7940LOCAL file%
 7950LOCAL ptr%
 7960LOCAL offset%
 7970LOCAL type%
 7980LOCAL ident$
 7990LOCAL num_icons%
 8000file%=OPENIN(f$)
 8010size%=0
 8020data%=0
 8030ptr%=16
 8040REPEAT
 8050 PTR#file%=ptr%
 8060 offset%=FNwin_word(file%)
 8070 IF offset%<>0 THEN
 8080  PTR#file%=ptr%+8
 8090  type%=FNwin_word(file%)
 8100  ident$=FNwin_string(file%)
 8110  ptr%+=24
 8120  IFtype%=1 THEN
 8130   IFident$=n$ THEN
 8140    PTR#file%=offset%+84
 8150    num_icons%=FNwin_word(file%)
 8160    data%=FNwin_title(file%,offset%)
 8170    IFnum_icons%<>0 data%+=FNwin_icon(file%,num_icons%,offset%)
 8180    size%=88+(num_icons%*32)
 8190    offset%=0
 8200   ENDIF
 8210  ENDIF
 8220 ENDIF
 8230UNTIL offset%=0
 8240CLOSE#file%
 8250ENDPROC
 8260DEFFNwin_word(h%)
 8270=BGET#h%+(BGET#h% << 8)+(BGET#h% << 16)+(BGET#h% << 24)
 8280DEFFNwin_string(h%)
 8290LOCAL s$,c%
 8300REPEAT
 8310 c%=BGET#h%
 8320 IFc%>31 s$+=CHR$(c%)
 8330UNTIL c%<32
 8340=s$
 8350DEFFNwin_title(file%,offset%)
 8360LOCAL v%
 8370PTR#file%=offset%+28
 8380v%=FNwin_word(file%)
 8390IF (v% AND 1<<31) THEN
 8400 IF (v% AND 1<<26) THEN
 8410  =FNwin_isd(file%,offset%+56,offset%+72,offset%)
 8420 ENDIF
 8430ELSE
 8440 IF (v% AND 1) THEN
 8450  =FNwin_isd(file%,offset%+56,offset%+72,offset%)
 8460 ENDIF
 8470ENDIF
 8480=0
 8490DEFFNwin_icon(file%,num%,offset%)
 8500LOCAL i%,j%
 8510j%=0
 8520FORi%=0 TO num%-1
 8530 j%+=FNwin_isd(file%,offset%+88+i%*32+16,offset%+88+i%*32+20,offset%)
 8540NEXT
 8550=j%
 8560DEFFNwin_isd(file%,o1%,o2%,offset%)
 8570LOCAL v%,ist%,size%,i%
 8580PTR#file%=o1%
 8590v%=FNwin_word(file%)
 8600i%=(v% AND %100000000)
 8610ist%=(v% AND 3) + (i% >> 6)
 8620CASE ist% OF
 8630WHEN   0: size%=0
 8640WHEN   1: size%=0
 8650WHEN   2: size%=0
 8660WHEN   3: size%=0
 8670WHEN   4: size%=0
 8680WHEN 5,7: PTR#file%=o2%+4
 8690          v%=FNwin_word(file%)
 8700          IFv%=-1 THEN
 8710           size%=0
 8720          ELSE
 8730           PTR#file%=offset%+v%
 8740           size%=LEN(FNwin_string(file%))+1
 8750          ENDIF
 8760          PTR#file%=o2%+8
 8770          size%+=FNwin_word(file%)
 8780WHEN   6: PTR#file%=o2%+8
 8790          size%=FNwin_word(file%)
 8800ENDCASE
 8810=size%
 8820DEFPROCicon_initialise
 8830DIM icon_buffer% 256
 8840ENDPROC
 8850DEFPROCicon_hide(a%,b%)
 8860!icon_buffer%=a%
 8870icon_buffer%!4=b%
 8880icon_buffer%!8=(1<<7)+(1<<23)
 8890icon_buffer%!12=(1<<7)+(1<<23)
 8900SYS"Wimp_SetIconState",,icon_buffer%
 8910ENDPROC
 8920DEFPROCicon_write(a%,b%,s$)
 8930!icon_buffer%=a%
 8940icon_buffer%!4=b%
 8950SYS"Wimp_GetIconState",,icon_buffer%
 8960IF(LEN(s$)+1)>icon_buffer%!36 THEN
 8970 ERROR task_fatal%,"'"+s$+"' won't fit icon "+STR$(b%)
 8980ENDIF
 8990$(icon_buffer%!28)=s$
 9000icon_buffer%!8=0:icon_buffer%!12=0
 9010SYS"Wimp_SetIconState",,icon_buffer%
 9020ENDPROC
 9030DEFPROCicon_shade(a%,b%)
 9040!icon_buffer%=a%
 9050icon_buffer%!4=b%
 9060icon_buffer%!8=1<<22
 9070icon_buffer%!12=1<<22
 9080SYS"Wimp_SetIconState",,icon_buffer%
 9090ENDPROC
 9100DEFFNicon_set(a%,b%)
 9110!icon_buffer%=a%
 9120icon_buffer%!4=b%
 9130SYS"Wimp_GetIconState",,icon_buffer%
 9140=((icon_buffer%!24 AND (1<<21))<>0)
 9150DEFPROCicon_unhide(a%,b%)
 9160!icon_buffer%=a%
 9170icon_buffer%!4=b%
 9180icon_buffer%!8=0
 9190icon_buffer%!12=1<<23
 9200SYS"Wimp_SetIconState",,icon_buffer%
 9210ENDPROC
 9220DEFPROCicon_unshade(a%,b%)
 9230!icon_buffer%=a%
 9240icon_buffer%!4=b%
 9250icon_buffer%!8=0
 9260icon_buffer%!12=1<<22
 9270SYS"Wimp_SetIconState",,icon_buffer%
 9280ENDPROC
 9290DEF PROCtask_initialise(n$)
 9300task_id$=n$
 9310DIM task_buff% 256
 9320IF RiscOS%>=300 THEN
 9330  task_buff%!0=Message_MM_Document%
 9340  task_buff%!4=Message_WindowClosed%
 9350  task_buff%!8=Message_TaskCloseDown%
 9360  task_buff%!12=Message_PreQuit%
 9370  task_buff%!16=Message_RAMFetch%
 9380  task_buff%!20=Message_DataLoad%
 9390  task_buff%!24=Message_DataSave%
 9400  task_buff%!28=Message_Impulse_1%
 9410  task_buff%!32=Message_Impulse_2%
 9420  task_buff%!36=Message_Quit%
 9430  SYS"Wimp_Initialise",310,&4B534154,n$,task_buff%+36 TO wimp_version%,task_handle%
 9440ELSE
 9450  SYS "Wimp_Initialise",200,&4B534154,n$ TO wimp_version%,task_handle%
 9460ENDIF
 9470OSCLI("Set MailMerge$Running TRUE")
 9480task_action%=0
 9490task_mask%=0           : 
 9500task_ok%=254
 9510task_fatal%=253
 9520ENDPROC
 9530DEFPROCtask_shutdown
 9540SYS"Wimp_CloseDown"
 9550OSCLI("UnSet MailMerge$Running")
 9560END
 9570ENDPROC
 9580DEFFNtask_rtoz(p%)
 9590LOCAL p$
 9600WHILE ?p%<>0
 9610 p$+=CHR$(?p%)
 9620 p%+=1
 9630ENDWHILE
 9640=p$
 9650DEFPROCmsg_initialise(N$)
 9660LOCAL c%,c$,i%
 9670c%=OPENIN(N$)
 9680IFc%=0 ERROR 0, "Cannot find messages file"
 9690ms_tags%=0
 9700PROChourglass_on
 9710WHILE NOT(EOF#c%)
 9720 c$=GET$#c%
 9730 IFc$<>"" THEN
 9740  IFLEFT$(c$,1)<>"#" THEN
 9750   IFINSTR(c$,":")<>0 ms_tags%+=1
 9760  ENDIF
 9770 ENDIF
 9780ENDWHILE
 9790IFms_tags%<>0 THEN
 9800 DIM ms_text$(ms_tags%-1),ms_tags$(ms_tags%-1)
 9810 PTR#c%=0
 9820 i%=0
 9830 WHILE NOTEOF#c%
 9840  c$=GET$#c%
 9850  IFc$<>"" THEN
 9860   IFLEFT$(c$,1)<>"#" THEN
 9870    ms_tags$(i%)=LEFT$(c$,INSTR(c$,":")-1)
 9880    ms_text$(i%)=MID$(c$,INSTR(c$,":")+1)
 9890    i%+=1
 9900   ENDIF
 9910  ENDIF
 9920 ENDWHILE
 9930ENDIF
 9940CLOSE#c%
 9950PROChourglass_off
 9960ENDPROC
 9970DEFFNmsg_0(T$)
 9980=FNmsg_4(T$,"","","","")
 9990DEFFNmsg_1(T$,S$)
10000=FNmsg_4(T$,S$,"","","")
10010;
10020DEFFNmsg_2(T$,S0$,S1$)
10030=FNmsg_4(T$,S0$,S1$,"","")
10040DEFFNmsg_4(T$,S0$,S1$,S2$,S3$)
10050LOCAL i%,f%
10060IFms_tags%=0 THEN
10070 =T$
10080ELSE
10090 FORi%=0 TO ms_tags%-1
10100  IFT$=ms_tags$(i%) THEN
10110   T$=ms_text$(i%)
10120   f%=INSTR(T$,"%0")
10130   IFf%<>0 T$=LEFT$(T$,f%-1)+S0$+MID$(T$,f%+2)
10140   f%=INSTR(T$,"%1")
10150   IFf%<>0 T$=LEFT$(T$,f%-1)+S1$+MID$(T$,f%+2)
10160   f%=INSTR(T$,"%2")
10170   IFf%<>0 T$=LEFT$(T$,f%-1)+S2$+MID$(T$,f%+2)
10180   f%=INSTR(T$,"%3")
10190   IFf%<>0 T$=LEFT$(T$,f%-1)+S3$+MID$(T$,f%+2)
10200   i%=ms_tags%
10210  ENDIF
10220 NEXT
10230ENDIF
10240=T$
10250DEFPROChourglass_on
10260SYS"Hourglass_On"
10270hourglass_count%+=1
10280ENDPROC
10290DEFPROChourglass_off
10300SYS"Hourglass_Off"
10310hourglass_count%-=1
10320ENDPROC
10330DEFPROCopen_csv_file
10340IF csv_file$="" ENDPROC
10350csv_file_handle%=OPENIN(csv_file$)
10360ENDPROC
10370DEFPROCclose_csv_file
10380IFcsv_file_handle%=0 ENDPROC
10390CLOSE#csv_file_handle%
10400csv_file_handle%=0
10410ENDPROC
10420DEF PROCconsts
10430appdir$="<MailMerge$Dir>"
10440Icon_ToProc%=1
10450Icon_RecsProc%=2
10460Icon_Headings%=3
10470Icon_PrintAll%=4
10480Icon_CSV%=5
10490Icon_ToGo%=6
10500Icon_Done%=7
10510Icon_Print%=8
10520Icon_document%=10
10530Icon_Next%=11
10540Icon_Edit%=12
10550Icon_DispHead%=13
10560Icon_StartMerge%=14
10570Icon_DropHere%=15
10580Window_Small%=236
10590Window_Big%=360
10600T_GetField%=0
10610T_GetData%=1
10620T_GetTimeDate%=2
10630T_Print%=3
10640T_Merge%=4
10650T_CloseDown%=7
10660Impulse_Command%=&200
10670Impulse_Request%=&201
10680Impulse_Reply%=&202
10690Impulse_SendData%=&203
10700Impulse_ReceiveData%=&204
10710Impulse_DeferredReply%=&205
10720DDF_Type%=&D93
10730CSV_Type%=&DFE
10740Message_Quit%=0
10750Message_DataSave%=1
10760Message_DataLoad%=3
10770Message_RAMFetch%=6
10780Message_PreQuit%=8
10790Message_TaskCloseDown%=&400C3
10800Message_WindowClosed%=&400CB
10810Message_Impulse_1%=&80E18
10820Message_Impulse_2%=&80E19
10830Message_MM_Document%=&82140
10840Char_Space%=32
10850Char_Quote%=34
10860Char_Comma%=44
10870Char_LF%=10
10880Char_CR%=13
10890Char_Slash%=92
10900Char_HardSpace%=160
10910ENDPROC
10920DEF PROCreadopsys
10930SYS "OS_Byte",129,0,255 TO ,RiscOS%
10940IF RiscOS%<163 THEN RiscOS%=200 ELSE RiscOS%=300
10950ENDPROC
10960  
10970  
10980  
10990  
11000  
11010  
11020  
11030  
11040  
11050  
11060  

� > !RunImage
Debug% = �
!� � � � �,�$+" at line "+�(�)
(�consts
2hourglass_count%=0
<�hourglass_on
F� countrybuff 64
P�readopsys
Z%ș "OS_Byte", 70, 127 � ,country%
dNș "OS_ServiceCall", , &43, 2, country% , countrybuff, 256 � ,,,,, length%
ncountrybuff?length%=13
x-�msg_initialise(appdir$+"."+$countrybuff)
�"�task_initialise(�msg_0("ID"))
��icon_initialise
��win_initialise
��error_initialise
��initialise
��=�+8096
�heap_end%=�
��=�+8096
�heap_start%=�
�$heap_size%=heap_end%-heap_start%
�'ș"OS_ReadMemMapInfo" � heap_psize%
��heap_size%<>0 �
�* ș"OS_Heap",0,heap_start%,,heap_size%
�
 �heap_increase
�
"�hourglass_off
,� � �error
6�
@8 ș "Wimp_Poll",task_mask%,task_buff% � task_action%
Jx ș "Impulse_Decode",task_action%,task_buff%,,,,method_table%,task_handle% � task_action%,,,,,token%,params%,object%
T Ȏ task_action% �
^   � 0 : �null
h,   � 2 : ș"Wimp_OpenWindow",,task_buff%
r   � 3 : � printing% �
|"              pending_close%=�
�            �
�               �host_shutdown
�            �
�   � 6 : �mouse_click
�   � 9 : �menu_click
�   � 17,18 : �receive
�+   � Impulse_Command%, Impulse_Request%
�)     �command(token%,params%,object%)
�   � Impulse_Reply%
�     �reply(token%)
�   � Impulse_SendData%
�+     �send_data(token%,params%,object%)
� �
� �
�
� �initialise
&9ș"Impulse_Initialise",0,task_handle%,�msg_0("ID"),-1
09�win_load_create(appdir$+".Templates","main",1,main%)
:"�icon_hide(main%,Icon_ToProc%)
D$�icon_hide(main%,Icon_RecsProc%)
N$�icon_hide(main%,Icon_PrintAll%)
X �icon_hide(main%,Icon_ToGo%)
b �icon_hide(main%,Icon_Done%)
l!�icon_hide(main%,Icon_Print%)
v �icon_hide(main%,Icon_Next%)
� �icon_hide(main%,Icon_Edit%)
�&�icon_hide(main%,Icon_StartMerge%)
�#�icon_write(main%,Icon_CSV%,"")
�(�icon_write(main%,Icon_document%,"")
�%�icon_shade(main%,Icon_DispHead%)
�7!win_buff%=main%:ș"Wimp_GetWindowState",,win_buff%
�,win_buff%!8=win_buff%!16 - Window_Small%
�"ș"Wimp_OpenWindow",,win_buff%
�� method_table% 64
�P%=method_table%
�[ OPT 0
�=   EQUD 0                       ; method structure format
�+   EQUD 0                       ; flags
%   EQUD T_GetField%       ; token
)   EQUS "GetField"+�0        ; method
)   EQUS �0                   ; syntax
    ALIGN
*
   EQUD 0
4%   EQUD T_CloseDown%      ; token
>)   EQUS "CloseDown"+�0       ; method
H)   EQUS �0                   ; syntax
R   ALIGN
\]
fmenu%=0
pmerge%=�
zprinting%=�
�dieplease%=�      : 
�"preserved_start_of_data_ptr%=0
�pending_close%=�
�transmit%=�
�transmit_count%=0
�transmit_block%=0
�gotprintreply%=�
��merge_off
��
�� �null
�
� result%
�,� ((printing%=�) � (gotprintreply%=�)) �
�        gotprintreply%=�
#        �send("Print",T_Print%)
�
�
$� �host_shutdown
.0� � dieplease% � �send("MailDied",-1)     : 
8�close_csv_file
Bȕ hourglass_count%
L �hourglass_off
V�
`�merge% �merge_off
j&ș"Impulse_CloseDown",task_handle%
t�task_shutdown
~�
�� �receive
�Ȏ task_buff%!16 �
�� Message_Quit%
�  �host_shutdown
�� Message_DataSave%
�  �datasave
�� Message_DataLoad%
�  �dataload
�� Message_PreQuit%
�  �prequit
�� Message_TaskCloseDown%
�<  �doc_file$<>"" � task_buff%!4=doc_task% �host_shutdown
� Message_WindowClosed%

� Message_MM_Document%
$  � doc_file$="" � �doc_received
�
(�
2� �mouse_click
<"� menuptr%,maxx%,i%,p%,ix%,iy%
F� task_buff%!8<>4 �
PȎ task_buff%!16 �
Z  � Icon_Headings%
d    � csv_file$<>"" �
n-      � �icon_set(main%,Icon_Headings%) �
x         �create_csv_headings
�        rec_togo% += 1
�      �
�        �get_csv_headings
�        rec_togo% -= 1
�      �
�	    �
�  � Icon_DispHead%
�(    � menu% �heap_free("MENU",menu%)
�2    menu%=�heap_claim("MENU",28+csv_count%*24)
�    $menu%=�msg_0("MT")
�    menu%?12=7
�    menu%?13=2
�    menu%?14=7
    menu%?15=0
    menu%!20=44
    menu%!24=0
"    menuptr%=menu%+28
,    maxx%=�(�msg_0("MT"))-3
6    p%=csv_headings%
@    �i%=1 � csv_count%
J4      �i%=csv_count% !menuptr%=&80 � !menuptr%=0
T      menuptr%!4=-1
^      menuptr%!8=&07000121
h      menuptr%!12=p%+4
r      menuptr%!16=-1
|"      menuptr%!20=�($(p%+4))+1
�      menuptr%+=24
�,      �($(p%+4))>maxx% maxx%=�($(p%+4))
�      p%=!p%
�	    �
�    menu%!16=(maxx%*8+6)*2
�5    !task_buff%=main%:task_buff%!4=Icon_DispHead%
�M    ș"Wimp_GetIconState",,task_buff%:ix%=task_buff%!16:iy%=task_buff%!20
�+    ș"Wimp_GetWindowState",,task_buff%
�:    display_menu_x% = task_buff%!20+task_buff%!4+ix%+2
�;    display_menu_y% = task_buff%!24+task_buff%!16+iy%-2
�B    ș"Wimp_CreateMenu",,menu%,display_menu_x%,display_menu_y%
�  � Icon_StartMerge%
�    �try_merge_on
  � Icon_Next%
    �merge_next_record
  � Icon_Print%
&    �send("Print",T_Print%)
0    printing%=�
:     �disable_merging_buttons
D  � Icon_Edit%
N    �send("ClearMerge",-1)
X    �host_shutdown
b�
l�
v��menu_click
�� c%,l%,f%
�f%=!task_buff%
�,ș"Wimp_GetCaretPosition",,task_buff%+20
�9�task_buff%!20<>doc_window% � task_ok%, �msg_0("OK5")
�l%=csv_headings%
�	ȕ f%
�  l%=!l%
�  f%-=1
��
�c%=�"<Wimp$Scrap>"
�X�#c%,"{ merge "+�Char_Quote%+":"+�msg_0("ID")+" GetField "+$(l%+4)+�Char_Quote%+"}";
�l%=�#c%
��#c%
+ș"OS_File",18,"<Wimp$Scrap>",DDF_Type%
!task_buff%=60
task_buff%!12=0
 task_buff%!16=3
*task_buff%!24=&4B535554
4task_buff%!36=l%
>task_buff%!40=DDF_Type%
H&$(task_buff%+44)="<Wimp$Scrap>"+�0
R0ș"Wimp_SendMessage",17,task_buff%,doc_task%
\'ș"Wimp_GetPointerInfo",,task_buff%
fR�(task_buff%!8 � 1) ș"Wimp_CreateMenu",,menu%,display_menu_x%,display_menu_y%
p�
z� �dataload
�.�task_buff%!40<>CSV_Type% � doc_file$="" �
�$�merge% � task_ok%,�msg_0("OK1")
�'csv_file$=�task_rtoz(task_buff%+44)
�task_buff%!12=task_buff%!8
�task_buff%!16=4
�3ș"Wimp_SendMessage",17,task_buff%,task_buff%!4
�$�icon_hide(main%,Icon_DropHere%)
�(�icon_unhide(main%,Icon_StartMerge%)
�'�icon_unshade(main%,Icon_DispHead%)
�*csv_count%=�determine_number_of_fields
�P� � �icon_set(main%,Icon_Headings%) �get_csv_headings � �create_csv_headings
�*rec_togo%=�determine_number_of_records
�1�icon_write(main%,Icon_CSV%,�leaf(csv_file$))
	�
	E� �copy_field(to%, � last_field%, � field_length%, fudge_spaces%)
	+� got_quote%, got_slash%, b%, finished%
	$got_quote%=�
	.got_slash%=�
	8last_field%=�
	Bfield_length%=0
	Lfinished%=�
	V�
	` b%=�#csv_file_handle%
	j Ȏ � �
	t � b%=Char_Quote%
	~  got_quote%=� got_quote%
	� � b%=Char_Slash%
	�  � got_slash% �
	�5   �copy_field_stuff_char(to%,�"\",field_length%)
	�   got_slash%=�
	�  �
	�   got_slash%=�
	�  �
	� � b%=Char_Space%
	�  � fudge_spaces% �
	�@   �copy_field_stuff_char(to%,Char_HardSpace%,field_length%)
	�  �
	�<   �copy_field_stuff_char(to%,Char_Space%,field_length%)
  �

 � b%=Char_Comma%
M  � got_quote% �copy_field_stuff_char(to%,b%,field_length%) � finished%=�
5 � b%=Char_LF% � b%=Char_CR% � �#csv_file_handle%
(  last_field%=�
2  finished%=�
< 
F  � got_slash% �
P   Ȏ b% �
Z@        � �"n": �copy_field_stuff_char(to%,10,field_length%)
d   �
n   got_slash%=�
x  �
�3   �copy_field_stuff_char(to%,b%,field_length%)
�  �
� �
�� finished%
�� to% ?to%=13
��
�4��copy_field_stuff_char(� to%, char%, � length%)
�length%+=1
��to% ?to%=char%:to%+=1
��
�!� �determine_number_of_fields
�"� s$,count%,last_field%,dummy%
��open_csv_file
N� csv_file_handle%=0 s$=csv_file$:csv_file$="":� task_ok%,�msg_1("OK2",s$)
�
( �copy_field(0,last_field%,dummy%,�)
" count%+=1
,� last_field%
6�close_csv_file
@=count%
J� �get_csv_headings
T#� s$,i%,last_node%,node%,dummy%
^ȕ csv_headings%
h next%=!csv_headings%
r% �heap_free("CSVH",csv_headings%)
| csv_headings%=next%
��
��open_csv_file
�last_node%=0
�� i%=1 � csv_count%
�, �copy_field(task_buff%,dummy%,dummy%,�)
� s$=$task_buff%
�" � s$="" s$=�msg_1("FI",�(i%))
�& node%=�heap_claim("CSVH",�(s$)+5)
�
 !node%=0
� $(node%+4)=s$
�9 � last_node% !last_node%=node% � csv_headings%=node%
� last_node%=node%
��
$csv_file_ptr%=�#csv_file_handle%
�close_csv_file
�
&� �create_csv_headings
0� s$,i%,last%,node%
:ȕ csv_headings%
D node%=!csv_headings%
N% �heap_free("CSVH",csv_headings%)
X csv_headings%=node%
b�
llast%=0
v� i%=1 � csv_count%
� s$=�msg_1("FI",�(i%))
�& node%=�heap_claim("CSVH",�(s$)+5)
�
 !node%=0
� $(node%+4)=s$
�/ � last% !last%=node% � csv_headings%=node%
� last%=node%
��
�csv_file_ptr%=0
��
�"� �determine_number_of_records
�� count%,b%,new_line%
�count%=0
��hourglass_on

�open_csv_file

%�#csv_file_handle%=csv_file_ptr% 

new_line%=�

 �

* b%=�#csv_file_handle%

47 � b%=Char_CR% � b%=Char_LF% � �#csv_file_handle% �

>  � � new_line% � count%+=1

H  new_line%=�

R �

\  new_line%=�

f �

p� �#csv_file_handle%

z�close_csv_file

��hourglass_off

�=count%

�� �doc_received

�� loop%, temp$

�� doc_file$="" �

� doc_task%=task_buff%!4

� doc_window%=task_buff%!20

�/ doc_file$=�leaf(�task_rtoz(task_buff%+24))

��

�f�doc_task%=task_buff%!4 � doc_window%=task_buff%!20 � doc_file$=�leaf(�task_rtoz(task_buff%+24)) �

� task_buff%!12=task_buff%!8

�4 ș"Wimp_SendMessage",19,task_buff%,task_buff%!4

�8 !win_buff%=main%:ș"Wimp_GetWindowState",,win_buff%
3 win_buff%!28=-1:ș"Wimp_OpenWindow",,win_buff%
0 �icon_write(main%,Icon_document%,doc_file$)
�
$temp$=""
.� loop%=1 � �(doc_file$)
8?� �(�doc_file$, loop%,1))>32 � temp$+=�doc_file$, loop%, 1)
B� loop%
Ldoc_file$=temp$
V�
`� �datasave
j� loop%, byte%
t� task_buff%!40=CSV_Type% �
~ task_buff%!0=256
� task_buff%!12=task_buff%!8
� task_buff%!16=2
� task_buff%!36=-1
�loop%=44
�ȕ (task_buff%?loop%)>31
�      loop%+=1
��
�task_buff%?loop%=13
�8$(task_buff%+44)="<Wimp$ScrapDir>."+$(task_buff%+44)
�3ș"Wimp_SendMessage",17,task_buff%,task_buff%!4
��
��
� �leaf(s$)

� dotindex%
dotindex%=0
ȕ �s$,".",dotindex%+1)
($  dotindex%=�s$,".",dotindex%+1)
2�
<=�s$,dotindex%+1)
F� �prequit
P
�merge% �
Z 
d�
n�
x� �try_merge_on
�merge%=�
�.preserved_start_of_data_ptr%=csv_file_ptr%
��send("Edit Off",-1)
��merge_next_record
��
�� �merge_off
�� next%
� � merge% �send("Edit On",-1)
�merge%=�
�csv_file$=""
�csv_file_handle%=0
�csv_count%=0
�csv_headings%=0
csv_field_ptrs%=0
csv_field_lens%=0
csv_file_ptr%=0
"doc_file$=""
,doc_task%=0
6doc_window%=0
@field_count%=0
Jrec_togo%=0
Trec_done%=0
^�
h� �merge_next_record
r� rec_togo%<>0 �
| �hourglass_on
� �next_record
� �send("Merge",T_Merge%)
� �disable_merging_buttons
��
�& $(error_buff%+4)=�msg_0("OK6")+�0
�F ș"Wimp_ReportError",error_buff%,%10001,�msg_1("MS",�msg_0("ID"))
� �host_shutdown
��
��
�� �next_record
�(� len%,i%,dummy%,finished%,this_ptr%
�� numfields%
�numfields%=0
�open_csv_file
;� csv_file_handle%=0 � task_ok%,�msg_1("OK2",csv_file$)
ȕ csv_field_ptrs%
& next%=!csv_field_ptrs%
0' �heap_free("CSVP",csv_field_ptrs%)
: csv_field_ptrs%=next%
D�
Nȕ csv_field_lens%
X next%=!csv_field_lens%
b' �heap_free("CSVL",csv_field_lens%)
l csv_field_lens%=next%
v�
�$�#csv_file_handle%=csv_file_ptr%
�i%=0
��
�  i%+=1
�  �
�(    this_ptr%=�#csv_file_handle%    
�$    �copy_field(0,dummy%,len%,�)
�    finished%=�
�E    � � �#csv_file_handle% � i%=1 � len%=0 � dummy% � finished%=�
�  � finished%
�  �add_field_ptr(this_ptr%)
�  �add_field_len(len%)
�1� i%=csv_count% � dummy% � �#csv_file_handle%
� � dummy% �eol
� i%<csv_count% �
  ȕ i%<csv_count%
    i%+=1
*   �add_field_ptr(0)
4   �add_field_len(0)
>  �
H�
R$csv_file_ptr%=�#csv_file_handle%
\�close_csv_file
f�
p
� �eol
z� x
�x=0
��
�2 � � �#csv_file_handle% � x=�#csv_file_handle%
�2� x=Char_CR% � x=Char_LF% � �#csv_file_handle%
��
�� �add_field_ptr(index%)
�� node%,last%
�node%=�heap_claim("CSVP",8)
�
node%!0=0
�node%!4=index%
�� csv_field_ptrs%=0 �
� csv_field_ptrs%=node%
��
 last%=csv_field_ptrs%
 ȕ !last%
  last%=!last%
$ �
. !last%=node%
8�
B�
L��add_field_len(index%)
V� node%,last%
`node%=�heap_claim("CSVL",8)
j
node%!0=0
tnode%!4=index%
~� csv_field_lens%=0 �
� csv_field_lens%=node%
��
� last%=csv_field_lens%
� ȕ !last%
�  last%=!last%
� �
� !last%=node%
��
��
�� �field_ptr(index%)
�� node%
�node%=csv_field_ptrs%

ȕ index%

 
B node%=!node%:�node%=0 � task_fatal%,"Bad field ptr requested"
 index%-=1
(�
2=node%!4
<� �field_len(index%)
F� node%
Pnode%=csv_field_lens%
Z
ȕ index%
d 
nB node%=!node%:�node%=0 � task_fatal%,"Bad field len requested"
x index%-=1
��
�=node%!4
�!� �send(command$,replytoken%)
�� i%,m$
�� doc_file$="" � �
�?� replytoken%<>-1 i%=Impulse_Request% � i%=Impulse_Command%
�2m$=":"+�msg_0("SV")+"."+doc_file$+" "+command$
�Bș"Impulse_SendMessage",i%,m$,0,0,0,replytoken%,task_handle%,0
��
���disable_merging_buttons
�%�icon_shade(main%,Icon_PrintAll%)
�"�icon_shade(main%,Icon_Print%)
�!�icon_shade(main%,Icon_Next%)
!�icon_shade(main%,Icon_Edit%)
�
��enable_merging_buttons
"'�icon_unshade(main%,Icon_PrintAll%)
,$�icon_unshade(main%,Icon_Print%)
6#�icon_unshade(main%,Icon_Next%)
@#�icon_unshade(main%,Icon_Edit%)
J�
T&� �command(token%,params%,object%)
^Ȏ token% �
h  � T_GetField%
r%      �get_field(params%,object%)
|      field_count%+=1
�  � T_CloseDown%
�      dieplease% = �
�      �host_shutdown
��
��
�!� �get_field(params%,object%)
�0� field_index%, field_name$, ptr%, finished%
�� params%=-1 �
�#field_name$=�task_rtoz(params%)
�field_index%=0
�ptr%=csv_headings%
�finished%=�
��
 field_index%+=1
 � $(ptr%+4)=field_name$ �
  finished%=�
& �
0  ptr%=!ptr%
:,  � ptr%=0 � finished%=�:field_index%=-1
D �
N  � ptr%=0 �
X3    $(error_buff%+4)=�msg_1("OK4", field_name$)
bJ    ș "Wimp_ReportError",error_buff%,%10001,�msg_1("MS",�msg_0("ID"))
l  �
v� finished%
�0� field_index%<1 � field_index%>csv_count% �
�  �trans_reply_block(0,0)
��
�O  �trans_reply_block(�field_ptr(field_index%-1),�field_len(field_index%-1))
��
��
�"��trans_reply_block(ptr%,len%)
�� dummy%
�transmit%=�
�transmit_ptr%=0
�8� transmit_block% �heap_free("BLCK",transmit_block%)
�.transmit_block%=�heap_claim("BLCK",len%+1)
�� len%>0 �
  �open_csv_file
I  � csv_file_handle%=0 transmit%=�:� task_ok%,�msg_2("OK2",csv_file$)
  �#csv_file_handle%=ptr%
 0  �copy_field(transmit_block%,dummy%,len%,�)
*  �close_csv_file
4�
>  $transmit_block%=""
H�
Rtransmit_top%=(len%+1+3)��3
\transmit_size%=len%
f$transmit_tag%=�next_transmit_tag
psș"Impulse_SendMessage",Impulse_Reply%,"Dummy text",-1,,,transmit_tag%,task_handle%,transmit_top%-transmit_ptr%
z�
�ݤnext_transmit_tag
�transmit_count%+=1
�=transmit_count%
�+��send_data(token%,buffer%,buffersize%)
�� size%,i%
�C�transmit% � (token%<>transmit_tag%) � task_ok%, �msg_0("OK3")
�%size%=transmit_top%-transmit_ptr%
�-� size%<buffersize% � size%=0 transmit%=�
�(� size%>buffersize% size=buffersize%
�5?(transmit_ptr%+transmit_block%+transmit_size%)=0
�Qș"Impulse_TransmitData",transmit_ptr%+transmit_block%,size%,,,,,task_handle%
�transmit_ptr%+=size%
��
� �reply(token%)
Ȏ token% �
  � T_Print%: �reply_print
$  � T_Merge%: �merge_done
.�
8�
B� �merge_done
L�rec_done%=0 �
V  �field_count%=0 �
`    �send("Edit On",-1)
j2    csv_file_ptr%=preserved_start_of_data_ptr%
t    merge%=�
~!    � task_ok%, �msg_0("OK7")
�  �
�0  �icon_write(main%,Icon_ToGo%,�(rec_togo%))
�'  �icon_write(main%,Icon_Done%,"1")
�&  �icon_unhide(main%,Icon_ToProc%)
�(  �icon_unhide(main%,Icon_RecsProc%)
�(  �icon_unhide(main%,Icon_PrintAll%)
�$  �icon_unhide(main%,Icon_ToGo%)
�$  �icon_unhide(main%,Icon_Done%)
�%  �icon_unhide(main%,Icon_Print%)
�$  �icon_unhide(main%,Icon_Next%)
�$  �icon_unhide(main%,Icon_Edit%)
�&  �icon_hide(main%,Icon_Headings%)
&  �icon_hide(main%,Icon_DispHead%)

(  �icon_hide(main%,Icon_StartMerge%)
9  !win_buff%=main%:ș"Wimp_GetWindowState",,win_buff%
,  win_buff%!8=win_buff%!16 - Window_Big%
($  ș"Wimp_OpenWindow",,win_buff%
2�
<�done_record
F�enable_merging_buttons
P�hourglass_off
Z�
d��done_record
nrec_togo%-=1
xrec_done%+=1
�.�icon_write(main%,Icon_ToGo%,�(rec_togo%))
�.�icon_write(main%,Icon_Done%,�(rec_done%))
��
���reply_print
�� command$
�(  command$=�task_rtoz(task_buff%+36)
�  Ȏ command$ �
�#    � "PrintDone" : �print_done
�$    � "PrintError": �print_error
�  �
��
���print_error
�  printing%=�
  gotprintreply%=�
$  $(error_buff%+4)=�msg_0("OK9")
K  ș "Wimp_ReportError", error_buff%, %10001, �msg_1("MS",�msg_0("ID"))
"&  �pending_close% � �host_shutdown
,  �enable_merging_buttons
6)  �icon_unhide(main%, Icon_PrintAll%)
@�
J��print_done
Tprinting%=�
^�pending_close% �
h        �host_shutdown
r�
|.        �icon_set(main%,Icon_PrintAll%) �
�                
�&                �merge_next_record
�                
�                
�                
�        
�                
�$                gotprintreply%=�
�                
�                printing%=�
�
        �
�+                �enable_merging_buttons
�
        �
�
�
��error_initialise
&� error_buff% 256
0�
:��error
D� r$,r%
N	r$=�$
X!�=task_ok% � �=task_fatal% �
b r%=�r$,"in "+�Char_Quote%)
l �r%<>0 r$=�r$,r%-1)
v�
�
Ȏ � �
�#�    task_ok%: �error_box(r$,1)
�#� task_fatal%: �error_box(r$,2)
�L       : �error_box("Unexpected error :- "+r$+" ("+�(�)+"/"+�(�)+")",3)
��
��
���error_box(r$,error_flag%)
�� r%
�ș"Wimp_CreateMenu",,-1
�)!error_buff%=�:$(error_buff%+4)=r$+�0
�?ș"Wimp_ReportError",error_buff%,error_flag%,task_id$ � ,r%
� �r%=2 � � �:�host_shutdown:�
��
��heap_free(ident$,block%)
� r0%,f%
�block%<>0 �
  block%-=4
* 
4V �!block%<>�heap_ident_num(ident$) � task_ok%,"Corrupt "+ident$+" block not freed"
>/ ș"XOS_Heap",3,heap_start%,block% � r0%;f%
HC �(f% � 1) � task_fatal%,"Block "+ident$+": "+�task_rtoz(r0%+4)
R�
\�
fݤheap_claim(ident$,size%)
p� p%
zsize%+=4
�.ȕ size%>=�heap_freespace �heap_increase:�
�+ș"OS_Heap",2,heap_start%,,size% � ,,p%
�!p%=�heap_ident_num(ident$)
�	p%+=4
�=p%
���heap_increase
�� slot%
�#ș"Wimp_SlotSize",-1,-1 � slot%
�*ș"Wimp_SlotSize",slot%+heap_psize%,-1
��heap_size%=0 �
�+ ș"OS_Heap",0,heap_start%,,heap_psize%
��
�+ ș"OS_Heap",5,heap_start%,,heap_psize%
�
heap_size%+=heap_psize%
�
$ݤheap_ident_num(v$)
.� i%,j%
8
�i%=0 � 3
B# j%=j% � �(�v$,i%+1,1))<<(i%*8)
L�
V=j%
`ݤheap_freespace
j� f%
t�heap_size%=0 � =0
~$ș"OS_Heap",1,heap_start% � ,,f%
�=f%
���win_initialise
�� win_buff% 2048
�win_template$=""
��
�3��win_load_create(f$,n$,sprite_pool%,� handle%)
�#�win_load(f$,n$,win_buff%,2048)
�win_buff%!64=sprite_pool%
�"�win_create(win_buff%,handle%)
��
�!��win_load(f$,n$,buf%,limit%)
�
� ws_buf%
� size%

� data%
� found%
� s%,f%
(
�f$<>"" �
2" �win_sizes(f$,n$,size%,data%)
<�
F- �win_sizes(win_template$,n$,size%,data%)
P�
Zv�limit%<(size%+data%) � task_ok%,"Buffer not big enough for '"+n$+"' - "+�(size%)+" + "+�(data%)+" bytes required"
d%�f$<>"" ș"Wimp_OpenTemplate",,f$
n� data%<>0 �
x � ws_buf% data%
�S ș"XWimp_LoadTemplate",,buf%,ws_buf%,ws_buf%+data%,-1,n$,0 � s%,,,,,,found%;f%
��
�A ș"XWimp_LoadTemplate",,buf%,0,0,-1,n$,0 � s%,,,,,,found%;f%
��
�"�f$<>"" ș"Wimp_CloseTemplate"
�/�(f%�1) � task_ok%,n$+": "+�task_rtoz(s%+4)
�6�found%=0 � task_ok%,"Template '"+n$+"' not found"
��
� ��win_create(buf%,� handle%)
�)ș"Wimp_CreateWindow",,buf% � handle%
��
�&��win_sizes(f$,n$,� size%,� data%)
�� i%
� file%

� ptr%

� offset%
"� type%
,� ident$
6� num_icons%
@file%=�(f$)
Jsize%=0
Tdata%=0
^ptr%=16
h�
r �#file%=ptr%
| offset%=�win_word(file%)
� � offset%<>0 �
�  �#file%=ptr%+8
�  type%=�win_word(file%)
�  ident$=�win_string(file%)
�  ptr%+=24
�  �type%=1 �
�   �ident$=n$ �
�    �#file%=offset%+84
�#    num_icons%=�win_word(file%)
�'    data%=�win_title(file%,offset%)
�A    �num_icons%<>0 data%+=�win_icon(file%,num_icons%,offset%)
�     size%=88+(num_icons%*32)
�    offset%=0
    �
   �
  �
 &� offset%=0
 0�#file%
 :�
 Dݤwin_word(h%)
 N/=�#h%+(�#h% << 8)+(�#h% << 16)+(�#h% << 24)
 Xݤwin_string(h%)
 b� s$,c%
 l�
 v c%=�#h%
 � �c%>31 s$+=�(c%)
 �� c%<32
 �=s$
 �ݤwin_title(file%,offset%)
 �� v%
 ��#file%=offset%+28
 �v%=�win_word(file%)
 �� (v% � 1<<31) �
 � � (v% � 1<<26) �
 �4  =�win_isd(file%,offset%+56,offset%+72,offset%)
 � �
 ��
 � � (v% � 1) �
!4  =�win_isd(file%,offset%+56,offset%+72,offset%)
! �
!�
! =0
!*"ݤwin_icon(file%,num%,offset%)
!4� i%,j%
!>j%=0
!H�i%=0 � num%-1
!RH j%+=�win_isd(file%,offset%+88+i%*32+16,offset%+88+i%*32+20,offset%)
!\�
!f=j%
!p$ݤwin_isd(file%,o1%,o2%,offset%)
!z� v%,ist%,size%,i%
!��#file%=o1%
!�v%=�win_word(file%)
!�i%=(v% � %100000000)
!�ist%=(v% � 3) + (i% >> 6)
!�
Ȏ ist% �
!��   0: size%=0
!��   1: size%=0
!��   2: size%=0
!��   3: size%=0
!��   4: size%=0
!�� 5,7: �#file%=o2%+4
!�!          v%=�win_word(file%)
!�          �v%=-1 �
"           size%=0
"          �
"!           �#file%=offset%+v%
"$,           size%=�(�win_string(file%))+1
".          �
"8          �#file%=o2%+8
"B%          size%+=�win_word(file%)
"L�   6: �#file%=o2%+8
"V$          size%=�win_word(file%)
"`�
"j
=size%
"t��icon_initialise
"~� icon_buffer% 256
"��
"���icon_hide(a%,b%)
"�!icon_buffer%=a%
"�icon_buffer%!4=b%
"�!icon_buffer%!8=(1<<7)+(1<<23)
"�"icon_buffer%!12=(1<<7)+(1<<23)
"�'ș"Wimp_SetIconState",,icon_buffer%
"��
"���icon_write(a%,b%,s$)
"�!icon_buffer%=a%
"�icon_buffer%!4=b%
"�'ș"Wimp_GetIconState",,icon_buffer%
# �(�(s$)+1)>icon_buffer%!36 �
#
3 � task_fatal%,"'"+s$+"' won't fit icon "+�(b%)
#�
#$(icon_buffer%!28)=s$
#(&icon_buffer%!8=0:icon_buffer%!12=0
#2'ș"Wimp_SetIconState",,icon_buffer%
#<�
#F��icon_shade(a%,b%)
#P!icon_buffer%=a%
#Zicon_buffer%!4=b%
#dicon_buffer%!8=1<<22
#nicon_buffer%!12=1<<22
#x'ș"Wimp_SetIconState",,icon_buffer%
#��
#�ݤicon_set(a%,b%)
#�!icon_buffer%=a%
#�icon_buffer%!4=b%
#�'ș"Wimp_GetIconState",,icon_buffer%
#�%=((icon_buffer%!24 � (1<<21))<>0)
#���icon_unhide(a%,b%)
#�!icon_buffer%=a%
#�icon_buffer%!4=b%
#�icon_buffer%!8=0
#�icon_buffer%!12=1<<23
#�'ș"Wimp_SetIconState",,icon_buffer%
#��
$��icon_unshade(a%,b%)
$!icon_buffer%=a%
$icon_buffer%!4=b%
$"icon_buffer%!8=0
$,icon_buffer%!12=1<<22
$6'ș"Wimp_SetIconState",,icon_buffer%
$@�
$J� �task_initialise(n$)
$Ttask_id$=n$
$^� task_buff% 256
$h� RiscOS%>=300 �
$r'  task_buff%!0=Message_MM_Document%
$|(  task_buff%!4=Message_WindowClosed%
$�)  task_buff%!8=Message_TaskCloseDown%
$�$  task_buff%!12=Message_PreQuit%
$�%  task_buff%!16=Message_RAMFetch%
$�%  task_buff%!20=Message_DataLoad%
$�%  task_buff%!24=Message_DataSave%
$�&  task_buff%!28=Message_Impulse_1%
$�&  task_buff%!32=Message_Impulse_2%
$�!  task_buff%!36=Message_Quit%
$�U  ș"Wimp_Initialise",310,&4B534154,n$,task_buff%+36 � wimp_version%,task_handle%
$��
$�H  ș "Wimp_Initialise",200,&4B534154,n$ � wimp_version%,task_handle%
$��
$�#�("Set MailMerge$Running TRUE")
%task_action%=0
%task_mask%=0           : 
%task_ok%=254
%&task_fatal%=253
%0�
%:��task_shutdown
%Dș"Wimp_CloseDown"
%N �("UnSet MailMerge$Running")
%X�
%b�
%lݤtask_rtoz(p%)
%v� p$
%�
ȕ ?p%<>0
%� p$+=�(?p%)
%�
 p%+=1
%��
%�=p$
%���msg_initialise(N$)
%�� c%,c$,i%
%�c%=�(N$)
%�*�c%=0 � 0, "Cannot find messages file"
%�ms_tags%=0
%��hourglass_on
%�ȕ �(�#c%)
%� c$=�#c%
& �c$<>"" �
&  �c$,1)<>"#" �
&   �c$,":")<>0 ms_tags%+=1
&   �
&* �
&4�
&>�ms_tags%<>0 �
&H0 � ms_text$(ms_tags%-1),ms_tags$(ms_tags%-1)
&R �#c%=0
&\	 i%=0
&f
 ȕ ��#c%
&p
  c$=�#c%
&z  �c$<>"" �
&�   �c$,1)<>"#" �
&�$    ms_tags$(i%)=�c$,�c$,":")-1)
&�$    ms_text$(i%)=�c$,�c$,":")+1)
&�
    i%+=1
&�   �
&�  �
&� �
&��
&��#c%
&��hourglass_off
&��
&�ݤmsg_0(T$)
&�=�msg_4(T$,"","","","")
'ݤmsg_1(T$,S$)
'=�msg_4(T$,S$,"","","")
';
'$ݤmsg_2(T$,S0$,S1$)
'.=�msg_4(T$,S0$,S1$,"","")
'8ݤmsg_4(T$,S0$,S1$,S2$,S3$)
'B� i%,f%
'L�ms_tags%=0 �
'V =T$
'`�
'j �i%=0 � ms_tags%-1
't  �T$=ms_tags$(i%) �
'~   T$=ms_text$(i%)
'�   f%=�T$,"%0")
'�(   �f%<>0 T$=�T$,f%-1)+S0$+�T$,f%+2)
'�   f%=�T$,"%1")
'�(   �f%<>0 T$=�T$,f%-1)+S1$+�T$,f%+2)
'�   f%=�T$,"%2")
'�(   �f%<>0 T$=�T$,f%-1)+S2$+�T$,f%+2)
'�   f%=�T$,"%3")
'�(   �f%<>0 T$=�T$,f%-1)+S3$+�T$,f%+2)
'�   i%=ms_tags%
'�  �
'� �
'��
(=T$
(
��hourglass_on
(ș"Hourglass_On"
(hourglass_count%+=1
((�
(2��hourglass_off
(<ș"Hourglass_Off"
(Fhourglass_count%-=1
(P�
(Z��open_csv_file
(d� csv_file$="" �
(n!csv_file_handle%=�(csv_file$)
(x�
(���close_csv_file
(��csv_file_handle%=0 �
(��#csv_file_handle%
(�csv_file_handle%=0
(��
(�
� �consts
(�appdir$="<MailMerge$Dir>"
(�Icon_ToProc%=1
(�Icon_RecsProc%=2
(�Icon_Headings%=3
(�Icon_PrintAll%=4
(�Icon_CSV%=5
(�Icon_ToGo%=6
)Icon_Done%=7
)Icon_Print%=8
)Icon_document%=10
)"Icon_Next%=11
),Icon_Edit%=12
)6Icon_DispHead%=13
)@Icon_StartMerge%=14
)JIcon_DropHere%=15
)TWindow_Small%=236
)^Window_Big%=360
)hT_GetField%=0
)rT_GetData%=1
)|T_GetTimeDate%=2
)�T_Print%=3
)�T_Merge%=4
)�T_CloseDown%=7
)�Impulse_Command%=&200
)�Impulse_Request%=&201
)�Impulse_Reply%=&202
)�Impulse_SendData%=&203
)�Impulse_ReceiveData%=&204
)�Impulse_DeferredReply%=&205
)�DDF_Type%=&D93
)�CSV_Type%=&DFE
)�Message_Quit%=0
)�Message_DataSave%=1
*Message_DataLoad%=3
*Message_RAMFetch%=6
*Message_PreQuit%=8
*&!Message_TaskCloseDown%=&400C3
*0 Message_WindowClosed%=&400CB
*:Message_Impulse_1%=&80E18
*DMessage_Impulse_2%=&80E19
*NMessage_MM_Document%=&82140
*XChar_Space%=32
*bChar_Quote%=34
*lChar_Comma%=44
*vChar_LF%=10
*�Char_CR%=13
*�Char_Slash%=92
*�Char_HardSpace%=160
*��
*�� �readopsys
*�%ș "OS_Byte",129,0,255 � ,RiscOS%
*�-� RiscOS%<163 � RiscOS%=200 � RiscOS%=300
*��
*�  
*�  
*�  
*�  
*�  
+  
+  
+  
+   
+*  
+4  
�
00000000  0d 00 0a 11 f4 20 3e 20  21 52 75 6e 49 6d 61 67  |..... > !RunImag|
00000010  65 0d 00 14 0e 44 65 62  75 67 25 20 3d 20 a3 0d  |e....Debug% = ..|
00000020  00 1e 21 ee 20 85 20 85  20 a2 20 9f 2c f6 24 2b  |..!. . . . .,.$+|
00000030  22 20 61 74 20 6c 69 6e  65 20 22 2b c3 28 9e 29  |" at line "+.(.)|
00000040  0d 00 28 0b f2 63 6f 6e  73 74 73 0d 00 32 16 68  |..(..consts..2.h|
00000050  6f 75 72 67 6c 61 73 73  5f 63 6f 75 6e 74 25 3d  |ourglass_count%=|
00000060  30 0d 00 3c 11 f2 68 6f  75 72 67 6c 61 73 73 5f  |0..<..hourglass_|
00000070  6f 6e 0d 00 46 14 de 20  63 6f 75 6e 74 72 79 62  |on..F.. countryb|
00000080  75 66 66 20 36 34 0d 00  50 0e f2 72 65 61 64 6f  |uff 64..P..reado|
00000090  70 73 79 73 0d 00 5a 25  c8 99 20 22 4f 53 5f 42  |psys..Z%.. "OS_B|
000000a0  79 74 65 22 2c 20 37 30  2c 20 31 32 37 20 b8 20  |yte", 70, 127 . |
000000b0  2c 63 6f 75 6e 74 72 79  25 0d 00 64 4e c8 99 20  |,country%..dN.. |
000000c0  22 4f 53 5f 53 65 72 76  69 63 65 43 61 6c 6c 22  |"OS_ServiceCall"|
000000d0  2c 20 2c 20 26 34 33 2c  20 32 2c 20 63 6f 75 6e  |, , &43, 2, coun|
000000e0  74 72 79 25 20 2c 20 63  6f 75 6e 74 72 79 62 75  |try% , countrybu|
000000f0  66 66 2c 20 32 35 36 20  b8 20 2c 2c 2c 2c 2c 20  |ff, 256 . ,,,,, |
00000100  6c 65 6e 67 74 68 25 0d  00 6e 1a 63 6f 75 6e 74  |length%..n.count|
00000110  72 79 62 75 66 66 3f 6c  65 6e 67 74 68 25 3d 31  |rybuff?length%=1|
00000120  33 0d 00 78 2d f2 6d 73  67 5f 69 6e 69 74 69 61  |3..x-.msg_initia|
00000130  6c 69 73 65 28 61 70 70  64 69 72 24 2b 22 2e 22  |lise(appdir$+"."|
00000140  2b 24 63 6f 75 6e 74 72  79 62 75 66 66 29 0d 00  |+$countrybuff)..|
00000150  82 22 f2 74 61 73 6b 5f  69 6e 69 74 69 61 6c 69  |.".task_initiali|
00000160  73 65 28 a4 6d 73 67 5f  30 28 22 49 44 22 29 29  |se(.msg_0("ID"))|
00000170  0d 00 8c 14 f2 69 63 6f  6e 5f 69 6e 69 74 69 61  |.....icon_initia|
00000180  6c 69 73 65 0d 00 96 13  f2 77 69 6e 5f 69 6e 69  |lise.....win_ini|
00000190  74 69 61 6c 69 73 65 0d  00 a0 15 f2 65 72 72 6f  |tialise.....erro|
000001a0  72 5f 69 6e 69 74 69 61  6c 69 73 65 0d 00 aa 0f  |r_initialise....|
000001b0  f2 69 6e 69 74 69 61 6c  69 73 65 0d 00 b4 0c e0  |.initialise.....|
000001c0  3d e0 2b 38 30 39 36 0d  00 be 0f 68 65 61 70 5f  |=.+8096....heap_|
000001d0  65 6e 64 25 3d 93 0d 00  c8 0c d3 3d e0 2b 38 30  |end%=......=.+80|
000001e0  39 36 0d 00 d2 11 68 65  61 70 5f 73 74 61 72 74  |96....heap_start|
000001f0  25 3d 93 0d 00 dc 24 68  65 61 70 5f 73 69 7a 65  |%=....$heap_size|
00000200  25 3d 68 65 61 70 5f 65  6e 64 25 2d 68 65 61 70  |%=heap_end%-heap|
00000210  5f 73 74 61 72 74 25 0d  00 e6 27 c8 99 22 4f 53  |_start%...'.."OS|
00000220  5f 52 65 61 64 4d 65 6d  4d 61 70 49 6e 66 6f 22  |_ReadMemMapInfo"|
00000230  20 b8 20 68 65 61 70 5f  70 73 69 7a 65 25 0d 00  | . heap_psize%..|
00000240  f0 14 e7 68 65 61 70 5f  73 69 7a 65 25 3c 3e 30  |...heap_size%<>0|
00000250  20 8c 0d 00 fa 2a 20 c8  99 22 4f 53 5f 48 65 61  | ....* .."OS_Hea|
00000260  70 22 2c 30 2c 68 65 61  70 5f 73 74 61 72 74 25  |p",0,heap_start%|
00000270  2c 2c 68 65 61 70 5f 73  69 7a 65 25 0d 01 04 05  |,,heap_size%....|
00000280  cc 0d 01 0e 13 20 f2 68  65 61 70 5f 69 6e 63 72  |..... .heap_incr|
00000290  65 61 73 65 0d 01 18 05  cd 0d 01 22 12 f2 68 6f  |ease......."..ho|
000002a0  75 72 67 6c 61 73 73 5f  6f 66 66 0d 01 2c 0e ee  |urglass_off..,..|
000002b0  20 85 20 f2 65 72 72 6f  72 0d 01 36 05 f5 0d 01  | . .error..6....|
000002c0  40 38 20 c8 99 20 22 57  69 6d 70 5f 50 6f 6c 6c  |@8 .. "Wimp_Poll|
000002d0  22 2c 74 61 73 6b 5f 6d  61 73 6b 25 2c 74 61 73  |",task_mask%,tas|
000002e0  6b 5f 62 75 66 66 25 20  b8 20 74 61 73 6b 5f 61  |k_buff% . task_a|
000002f0  63 74 69 6f 6e 25 0d 01  4a 78 20 c8 99 20 22 49  |ction%..Jx .. "I|
00000300  6d 70 75 6c 73 65 5f 44  65 63 6f 64 65 22 2c 74  |mpulse_Decode",t|
00000310  61 73 6b 5f 61 63 74 69  6f 6e 25 2c 74 61 73 6b  |ask_action%,task|
00000320  5f 62 75 66 66 25 2c 2c  2c 2c 6d 65 74 68 6f 64  |_buff%,,,,method|
00000330  5f 74 61 62 6c 65 25 2c  74 61 73 6b 5f 68 61 6e  |_table%,task_han|
00000340  64 6c 65 25 20 b8 20 74  61 73 6b 5f 61 63 74 69  |dle% . task_acti|
00000350  6f 6e 25 2c 2c 2c 2c 2c  74 6f 6b 65 6e 25 2c 70  |on%,,,,,token%,p|
00000360  61 72 61 6d 73 25 2c 6f  62 6a 65 63 74 25 0d 01  |arams%,object%..|
00000370  54 16 20 c8 8e 20 74 61  73 6b 5f 61 63 74 69 6f  |T. .. task_actio|
00000380  6e 25 20 ca 0d 01 5e 12  20 20 20 c9 20 30 20 3a  |n% ...^.   . 0 :|
00000390  20 f2 6e 75 6c 6c 0d 01  68 2c 20 20 20 c9 20 32  | .null..h,   . 2|
000003a0  20 3a 20 c8 99 22 57 69  6d 70 5f 4f 70 65 6e 57  | : .."Wimp_OpenW|
000003b0  69 6e 64 6f 77 22 2c 2c  74 61 73 6b 5f 62 75 66  |indow",,task_buf|
000003c0  66 25 0d 01 72 1a 20 20  20 c9 20 33 20 3a 20 e7  |f%..r.   . 3 : .|
000003d0  20 70 72 69 6e 74 69 6e  67 25 20 8c 0d 01 7c 22  | printing% ...|"|
000003e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 70 65  |              pe|
000003f0  6e 64 69 6e 67 5f 63 6c  6f 73 65 25 3d b9 0d 01  |nding_close%=...|
00000400  86 11 20 20 20 20 20 20  20 20 20 20 20 20 cc 0d  |..            ..|
00000410  01 90 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00000420  20 f2 68 6f 73 74 5f 73  68 75 74 64 6f 77 6e 0d  | .host_shutdown.|
00000430  01 9a 11 20 20 20 20 20  20 20 20 20 20 20 20 cd  |...            .|
00000440  0d 01 a4 19 20 20 20 c9  20 36 20 3a 20 f2 6d 6f  |....   . 6 : .mo|
00000450  75 73 65 5f 63 6c 69 63  6b 0d 01 ae 18 20 20 20  |use_click....   |
00000460  c9 20 39 20 3a 20 f2 6d  65 6e 75 5f 63 6c 69 63  |. 9 : .menu_clic|
00000470  6b 0d 01 b8 19 20 20 20  c9 20 31 37 2c 31 38 20  |k....   . 17,18 |
00000480  3a 20 f2 72 65 63 65 69  76 65 0d 01 c2 2b 20 20  |: .receive...+  |
00000490  20 c9 20 49 6d 70 75 6c  73 65 5f 43 6f 6d 6d 61  | . Impulse_Comma|
000004a0  6e 64 25 2c 20 49 6d 70  75 6c 73 65 5f 52 65 71  |nd%, Impulse_Req|
000004b0  75 65 73 74 25 0d 01 cc  29 20 20 20 20 20 f2 63  |uest%...)     .c|
000004c0  6f 6d 6d 61 6e 64 28 74  6f 6b 65 6e 25 2c 70 61  |ommand(token%,pa|
000004d0  72 61 6d 73 25 2c 6f 62  6a 65 63 74 25 29 0d 01  |rams%,object%)..|
000004e0  d6 17 20 20 20 c9 20 49  6d 70 75 6c 73 65 5f 52  |..   . Impulse_R|
000004f0  65 70 6c 79 25 0d 01 e0  17 20 20 20 20 20 f2 72  |eply%....     .r|
00000500  65 70 6c 79 28 74 6f 6b  65 6e 25 29 0d 01 ea 1a  |eply(token%)....|
00000510  20 20 20 c9 20 49 6d 70  75 6c 73 65 5f 53 65 6e  |   . Impulse_Sen|
00000520  64 44 61 74 61 25 0d 01  f4 2b 20 20 20 20 20 f2  |dData%...+     .|
00000530  73 65 6e 64 5f 64 61 74  61 28 74 6f 6b 65 6e 25  |send_data(token%|
00000540  2c 70 61 72 61 6d 73 25  2c 6f 62 6a 65 63 74 25  |,params%,object%|
00000550  29 0d 01 fe 06 20 cb 0d  02 08 07 fd 20 a3 0d 02  |).... ...... ...|
00000560  12 05 e0 0d 02 1c 11 dd  20 f2 69 6e 69 74 69 61  |........ .initia|
00000570  6c 69 73 65 0d 02 26 39  c8 99 22 49 6d 70 75 6c  |lise..&9.."Impul|
00000580  73 65 5f 49 6e 69 74 69  61 6c 69 73 65 22 2c 30  |se_Initialise",0|
00000590  2c 74 61 73 6b 5f 68 61  6e 64 6c 65 25 2c a4 6d  |,task_handle%,.m|
000005a0  73 67 5f 30 28 22 49 44  22 29 2c 2d 31 0d 02 30  |sg_0("ID"),-1..0|
000005b0  39 f2 77 69 6e 5f 6c 6f  61 64 5f 63 72 65 61 74  |9.win_load_creat|
000005c0  65 28 61 70 70 64 69 72  24 2b 22 2e 54 65 6d 70  |e(appdir$+".Temp|
000005d0  6c 61 74 65 73 22 2c 22  6d 61 69 6e 22 2c 31 2c  |lates","main",1,|
000005e0  6d 61 69 6e 25 29 0d 02  3a 22 f2 69 63 6f 6e 5f  |main%)..:".icon_|
000005f0  68 69 64 65 28 6d 61 69  6e 25 2c 49 63 6f 6e 5f  |hide(main%,Icon_|
00000600  54 6f 50 72 6f 63 25 29  0d 02 44 24 f2 69 63 6f  |ToProc%)..D$.ico|
00000610  6e 5f 68 69 64 65 28 6d  61 69 6e 25 2c 49 63 6f  |n_hide(main%,Ico|
00000620  6e 5f 52 65 63 73 50 72  6f 63 25 29 0d 02 4e 24  |n_RecsProc%)..N$|
00000630  f2 69 63 6f 6e 5f 68 69  64 65 28 6d 61 69 6e 25  |.icon_hide(main%|
00000640  2c 49 63 6f 6e 5f 50 72  69 6e 74 41 6c 6c 25 29  |,Icon_PrintAll%)|
00000650  0d 02 58 20 f2 69 63 6f  6e 5f 68 69 64 65 28 6d  |..X .icon_hide(m|
00000660  61 69 6e 25 2c 49 63 6f  6e 5f 54 6f 47 6f 25 29  |ain%,Icon_ToGo%)|
00000670  0d 02 62 20 f2 69 63 6f  6e 5f 68 69 64 65 28 6d  |..b .icon_hide(m|
00000680  61 69 6e 25 2c 49 63 6f  6e 5f 44 6f 6e 65 25 29  |ain%,Icon_Done%)|
00000690  0d 02 6c 21 f2 69 63 6f  6e 5f 68 69 64 65 28 6d  |..l!.icon_hide(m|
000006a0  61 69 6e 25 2c 49 63 6f  6e 5f 50 72 69 6e 74 25  |ain%,Icon_Print%|
000006b0  29 0d 02 76 20 f2 69 63  6f 6e 5f 68 69 64 65 28  |)..v .icon_hide(|
000006c0  6d 61 69 6e 25 2c 49 63  6f 6e 5f 4e 65 78 74 25  |main%,Icon_Next%|
000006d0  29 0d 02 80 20 f2 69 63  6f 6e 5f 68 69 64 65 28  |)... .icon_hide(|
000006e0  6d 61 69 6e 25 2c 49 63  6f 6e 5f 45 64 69 74 25  |main%,Icon_Edit%|
000006f0  29 0d 02 8a 26 f2 69 63  6f 6e 5f 68 69 64 65 28  |)...&.icon_hide(|
00000700  6d 61 69 6e 25 2c 49 63  6f 6e 5f 53 74 61 72 74  |main%,Icon_Start|
00000710  4d 65 72 67 65 25 29 0d  02 94 23 f2 69 63 6f 6e  |Merge%)...#.icon|
00000720  5f 77 72 69 74 65 28 6d  61 69 6e 25 2c 49 63 6f  |_write(main%,Ico|
00000730  6e 5f 43 53 56 25 2c 22  22 29 0d 02 9e 28 f2 69  |n_CSV%,"")...(.i|
00000740  63 6f 6e 5f 77 72 69 74  65 28 6d 61 69 6e 25 2c  |con_write(main%,|
00000750  49 63 6f 6e 5f 64 6f 63  75 6d 65 6e 74 25 2c 22  |Icon_document%,"|
00000760  22 29 0d 02 a8 25 f2 69  63 6f 6e 5f 73 68 61 64  |")...%.icon_shad|
00000770  65 28 6d 61 69 6e 25 2c  49 63 6f 6e 5f 44 69 73  |e(main%,Icon_Dis|
00000780  70 48 65 61 64 25 29 0d  02 b2 37 21 77 69 6e 5f  |pHead%)...7!win_|
00000790  62 75 66 66 25 3d 6d 61  69 6e 25 3a c8 99 22 57  |buff%=main%:.."W|
000007a0  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
000007b0  74 65 22 2c 2c 77 69 6e  5f 62 75 66 66 25 0d 02  |te",,win_buff%..|
000007c0  bc 2c 77 69 6e 5f 62 75  66 66 25 21 38 3d 77 69  |.,win_buff%!8=wi|
000007d0  6e 5f 62 75 66 66 25 21  31 36 20 2d 20 57 69 6e  |n_buff%!16 - Win|
000007e0  64 6f 77 5f 53 6d 61 6c  6c 25 0d 02 c6 22 c8 99  |dow_Small%..."..|
000007f0  22 57 69 6d 70 5f 4f 70  65 6e 57 69 6e 64 6f 77  |"Wimp_OpenWindow|
00000800  22 2c 2c 77 69 6e 5f 62  75 66 66 25 0d 02 d0 16  |",,win_buff%....|
00000810  de 20 6d 65 74 68 6f 64  5f 74 61 62 6c 65 25 20  |. method_table% |
00000820  36 34 0d 02 da 14 50 25  3d 6d 65 74 68 6f 64 5f  |64....P%=method_|
00000830  74 61 62 6c 65 25 0d 02  e4 0b 5b 20 4f 50 54 20  |table%....[ OPT |
00000840  30 0d 02 ee 3d 20 20 20  45 51 55 44 20 30 20 20  |0...=   EQUD 0  |
00000850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000860  20 20 20 20 20 3b 20 6d  65 74 68 6f 64 20 73 74  |     ; method st|
00000870  72 75 63 74 75 72 65 20  66 6f 72 6d 61 74 0d 02  |ructure format..|
00000880  f8 2b 20 20 20 45 51 55  44 20 30 20 20 20 20 20  |.+   EQUD 0     |
00000890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000008a0  20 20 3b 20 66 6c 61 67  73 0d 03 02 25 20 20 20  |  ; flags...%   |
000008b0  45 51 55 44 20 54 5f 47  65 74 46 69 65 6c 64 25  |EQUD T_GetField%|
000008c0  20 20 20 20 20 20 20 3b  20 74 6f 6b 65 6e 0d 03  |       ; token..|
000008d0  0c 29 20 20 20 45 51 55  53 20 22 47 65 74 46 69  |.)   EQUS "GetFi|
000008e0  65 6c 64 22 2b bd 30 20  20 20 20 20 20 20 20 3b  |eld"+.0        ;|
000008f0  20 6d 65 74 68 6f 64 0d  03 16 29 20 20 20 45 51  | method...)   EQ|
00000900  55 53 20 bd 30 20 20 20  20 20 20 20 20 20 20 20  |US .0           |
00000910  20 20 20 20 20 20 20 20  3b 20 73 79 6e 74 61 78  |        ; syntax|
00000920  0d 03 20 0c 20 20 20 41  4c 49 47 4e 0d 03 2a 0d  |.. .   ALIGN..*.|
00000930  20 20 20 45 51 55 44 20  30 0d 03 34 25 20 20 20  |   EQUD 0..4%   |
00000940  45 51 55 44 20 54 5f 43  6c 6f 73 65 44 6f 77 6e  |EQUD T_CloseDown|
00000950  25 20 20 20 20 20 20 3b  20 74 6f 6b 65 6e 0d 03  |%      ; token..|
00000960  3e 29 20 20 20 45 51 55  53 20 22 43 6c 6f 73 65  |>)   EQUS "Close|
00000970  44 6f 77 6e 22 2b bd 30  20 20 20 20 20 20 20 3b  |Down"+.0       ;|
00000980  20 6d 65 74 68 6f 64 0d  03 48 29 20 20 20 45 51  | method..H)   EQ|
00000990  55 53 20 bd 30 20 20 20  20 20 20 20 20 20 20 20  |US .0           |
000009a0  20 20 20 20 20 20 20 20  3b 20 73 79 6e 74 61 78  |        ; syntax|
000009b0  0d 03 52 0c 20 20 20 41  4c 49 47 4e 0d 03 5c 05  |..R.   ALIGN..\.|
000009c0  5d 0d 03 66 0b 6d 65 6e  75 25 3d 30 0d 03 70 0c  |]..f.menu%=0..p.|
000009d0  6d 65 72 67 65 25 3d a3  0d 03 7a 0f 70 72 69 6e  |merge%=...z.prin|
000009e0  74 69 6e 67 25 3d a3 0d  03 84 18 64 69 65 70 6c  |ting%=.....diepl|
000009f0  65 61 73 65 25 3d a3 20  20 20 20 20 20 3a 20 0d  |ease%=.      : .|
00000a00  03 8e 22 70 72 65 73 65  72 76 65 64 5f 73 74 61  |.."preserved_sta|
00000a10  72 74 5f 6f 66 5f 64 61  74 61 5f 70 74 72 25 3d  |rt_of_data_ptr%=|
00000a20  30 0d 03 98 14 70 65 6e  64 69 6e 67 5f 63 6c 6f  |0....pending_clo|
00000a30  73 65 25 3d a3 0d 03 a2  0f 74 72 61 6e 73 6d 69  |se%=.....transmi|
00000a40  74 25 3d a3 0d 03 ac 15  74 72 61 6e 73 6d 69 74  |t%=.....transmit|
00000a50  5f 63 6f 75 6e 74 25 3d  30 0d 03 b6 15 74 72 61  |_count%=0....tra|
00000a60  6e 73 6d 69 74 5f 62 6c  6f 63 6b 25 3d 30 0d 03  |nsmit_block%=0..|
00000a70  c0 14 67 6f 74 70 72 69  6e 74 72 65 70 6c 79 25  |..gotprintreply%|
00000a80  3d a3 0d 03 ca 0e f2 6d  65 72 67 65 5f 6f 66 66  |=......merge_off|
00000a90  0d 03 d4 05 e1 0d 03 de  0b dd 20 f2 6e 75 6c 6c  |.......... .null|
00000aa0  0d 03 e8 0d ea 20 72 65  73 75 6c 74 25 0d 03 f2  |..... result%...|
00000ab0  2c e7 20 28 28 70 72 69  6e 74 69 6e 67 25 3d b9  |,. ((printing%=.|
00000ac0  29 20 80 20 28 67 6f 74  70 72 69 6e 74 72 65 70  |) . (gotprintrep|
00000ad0  6c 79 25 3d b9 29 29 20  8c 0d 03 fc 1c 20 20 20  |ly%=.)) .....   |
00000ae0  20 20 20 20 20 67 6f 74  70 72 69 6e 74 72 65 70  |     gotprintrep|
00000af0  6c 79 25 3d a3 0d 04 06  23 20 20 20 20 20 20 20  |ly%=....#       |
00000b00  20 f2 73 65 6e 64 28 22  50 72 69 6e 74 22 2c 54  | .send("Print",T|
00000b10  5f 50 72 69 6e 74 25 29  0d 04 10 05 cd 0d 04 1a  |_Print%)........|
00000b20  05 e1 0d 04 24 14 dd 20  f2 68 6f 73 74 5f 73 68  |....$.. .host_sh|
00000b30  75 74 64 6f 77 6e 0d 04  2e 30 e7 20 ac 20 64 69  |utdown...0. . di|
00000b40  65 70 6c 65 61 73 65 25  20 8c 20 f2 73 65 6e 64  |eplease% . .send|
00000b50  28 22 4d 61 69 6c 44 69  65 64 22 2c 2d 31 29 20  |("MailDied",-1) |
00000b60  20 20 20 20 3a 20 0d 04  38 13 f2 63 6c 6f 73 65  |    : ..8..close|
00000b70  5f 63 73 76 5f 66 69 6c  65 0d 04 42 17 c8 95 20  |_csv_file..B... |
00000b80  68 6f 75 72 67 6c 61 73  73 5f 63 6f 75 6e 74 25  |hourglass_count%|
00000b90  0d 04 4c 13 20 f2 68 6f  75 72 67 6c 61 73 73 5f  |..L. .hourglass_|
00000ba0  6f 66 66 0d 04 56 05 ce  0d 04 60 16 e7 6d 65 72  |off..V....`..mer|
00000bb0  67 65 25 20 f2 6d 65 72  67 65 5f 6f 66 66 0d 04  |ge% .merge_off..|
00000bc0  6a 26 c8 99 22 49 6d 70  75 6c 73 65 5f 43 6c 6f  |j&.."Impulse_Clo|
00000bd0  73 65 44 6f 77 6e 22 2c  74 61 73 6b 5f 68 61 6e  |seDown",task_han|
00000be0  64 6c 65 25 0d 04 74 12  f2 74 61 73 6b 5f 73 68  |dle%..t..task_sh|
00000bf0  75 74 64 6f 77 6e 0d 04  7e 05 e1 0d 04 88 0e dd  |utdown..~.......|
00000c00  20 f2 72 65 63 65 69 76  65 0d 04 92 16 c8 8e 20  | .receive...... |
00000c10  74 61 73 6b 5f 62 75 66  66 25 21 31 36 20 ca 0d  |task_buff%!16 ..|
00000c20  04 9c 13 c9 20 4d 65 73  73 61 67 65 5f 51 75 69  |.... Message_Qui|
00000c30  74 25 0d 04 a6 14 20 20  f2 68 6f 73 74 5f 73 68  |t%....  .host_sh|
00000c40  75 74 64 6f 77 6e 0d 04  b0 17 c9 20 4d 65 73 73  |utdown..... Mess|
00000c50  61 67 65 5f 44 61 74 61  53 61 76 65 25 0d 04 ba  |age_DataSave%...|
00000c60  0f 20 20 f2 64 61 74 61  73 61 76 65 0d 04 c4 17  |.  .datasave....|
00000c70  c9 20 4d 65 73 73 61 67  65 5f 44 61 74 61 4c 6f  |. Message_DataLo|
00000c80  61 64 25 0d 04 ce 0f 20  20 f2 64 61 74 61 6c 6f  |ad%....  .datalo|
00000c90  61 64 0d 04 d8 16 c9 20  4d 65 73 73 61 67 65 5f  |ad..... Message_|
00000ca0  50 72 65 51 75 69 74 25  0d 04 e2 0e 20 20 f2 70  |PreQuit%....  .p|
00000cb0  72 65 71 75 69 74 0d 04  ec 1c c9 20 4d 65 73 73  |requit..... Mess|
00000cc0  61 67 65 5f 54 61 73 6b  43 6c 6f 73 65 44 6f 77  |age_TaskCloseDow|
00000cd0  6e 25 0d 04 f6 3c 20 20  e7 64 6f 63 5f 66 69 6c  |n%...<  .doc_fil|
00000ce0  65 24 3c 3e 22 22 20 80  20 74 61 73 6b 5f 62 75  |e$<>"" . task_bu|
00000cf0  66 66 25 21 34 3d 64 6f  63 5f 74 61 73 6b 25 20  |ff%!4=doc_task% |
00000d00  f2 68 6f 73 74 5f 73 68  75 74 64 6f 77 6e 0d 05  |.host_shutdown..|
00000d10  00 1b c9 20 4d 65 73 73  61 67 65 5f 57 69 6e 64  |... Message_Wind|
00000d20  6f 77 43 6c 6f 73 65 64  25 0d 05 0a 1a c9 20 4d  |owClosed%..... M|
00000d30  65 73 73 61 67 65 5f 4d  4d 5f 44 6f 63 75 6d 65  |essage_MM_Docume|
00000d40  6e 74 25 0d 05 14 24 20  20 e7 20 64 6f 63 5f 66  |nt%...$  . doc_f|
00000d50  69 6c 65 24 3d 22 22 20  8c 20 f2 64 6f 63 5f 72  |ile$="" . .doc_r|
00000d60  65 63 65 69 76 65 64 0d  05 1e 05 cb 0d 05 28 05  |eceived.......(.|
00000d70  e1 0d 05 32 12 dd 20 f2  6d 6f 75 73 65 5f 63 6c  |...2.. .mouse_cl|
00000d80  69 63 6b 0d 05 3c 22 ea  20 6d 65 6e 75 70 74 72  |ick..<". menuptr|
00000d90  25 2c 6d 61 78 78 25 2c  69 25 2c 70 25 2c 69 78  |%,maxx%,i%,p%,ix|
00000da0  25 2c 69 79 25 0d 05 46  17 e7 20 74 61 73 6b 5f  |%,iy%..F.. task_|
00000db0  62 75 66 66 25 21 38 3c  3e 34 20 e1 0d 05 50 16  |buff%!8<>4 ...P.|
00000dc0  c8 8e 20 74 61 73 6b 5f  62 75 66 66 25 21 31 36  |.. task_buff%!16|
00000dd0  20 ca 0d 05 5a 16 20 20  c9 20 49 63 6f 6e 5f 48  | ...Z.  . Icon_H|
00000de0  65 61 64 69 6e 67 73 25  0d 05 64 19 20 20 20 20  |eadings%..d.    |
00000df0  e7 20 63 73 76 5f 66 69  6c 65 24 3c 3e 22 22 20  |. csv_file$<>"" |
00000e00  8c 0d 05 6e 2d 20 20 20  20 20 20 e7 20 a4 69 63  |...n-      . .ic|
00000e10  6f 6e 5f 73 65 74 28 6d  61 69 6e 25 2c 49 63 6f  |on_set(main%,Ico|
00000e20  6e 5f 48 65 61 64 69 6e  67 73 25 29 20 8c 0d 05  |n_Headings%) ...|
00000e30  78 20 20 20 20 20 20 20  20 20 f2 63 72 65 61 74  |x         .creat|
00000e40  65 5f 63 73 76 5f 68 65  61 64 69 6e 67 73 0d 05  |e_csv_headings..|
00000e50  82 1a 20 20 20 20 20 20  20 20 72 65 63 5f 74 6f  |..        rec_to|
00000e60  67 6f 25 20 2b 3d 20 31  0d 05 8c 0b 20 20 20 20  |go% += 1....    |
00000e70  20 20 cc 0d 05 96 1d 20  20 20 20 20 20 20 20 f2  |  .....        .|
00000e80  67 65 74 5f 63 73 76 5f  68 65 61 64 69 6e 67 73  |get_csv_headings|
00000e90  0d 05 a0 1a 20 20 20 20  20 20 20 20 72 65 63 5f  |....        rec_|
00000ea0  74 6f 67 6f 25 20 2d 3d  20 31 0d 05 aa 0b 20 20  |togo% -= 1....  |
00000eb0  20 20 20 20 cd 0d 05 b4  09 20 20 20 20 cd 0d 05  |    .....    ...|
00000ec0  be 16 20 20 c9 20 49 63  6f 6e 5f 44 69 73 70 48  |..  . Icon_DispH|
00000ed0  65 61 64 25 0d 05 c8 28  20 20 20 20 e7 20 6d 65  |ead%...(    . me|
00000ee0  6e 75 25 20 f2 68 65 61  70 5f 66 72 65 65 28 22  |nu% .heap_free("|
00000ef0  4d 45 4e 55 22 2c 6d 65  6e 75 25 29 0d 05 d2 32  |MENU",menu%)...2|
00000f00  20 20 20 20 6d 65 6e 75  25 3d a4 68 65 61 70 5f  |    menu%=.heap_|
00000f10  63 6c 61 69 6d 28 22 4d  45 4e 55 22 2c 32 38 2b  |claim("MENU",28+|
00000f20  63 73 76 5f 63 6f 75 6e  74 25 2a 32 34 29 0d 05  |csv_count%*24)..|
00000f30  dc 1b 20 20 20 20 24 6d  65 6e 75 25 3d a4 6d 73  |..    $menu%=.ms|
00000f40  67 5f 30 28 22 4d 54 22  29 0d 05 e6 12 20 20 20  |g_0("MT")....   |
00000f50  20 6d 65 6e 75 25 3f 31  32 3d 37 0d 05 f0 12 20  | menu%?12=7.... |
00000f60  20 20 20 6d 65 6e 75 25  3f 31 33 3d 32 0d 05 fa  |   menu%?13=2...|
00000f70  12 20 20 20 20 6d 65 6e  75 25 3f 31 34 3d 37 0d  |.    menu%?14=7.|
00000f80  06 04 12 20 20 20 20 6d  65 6e 75 25 3f 31 35 3d  |...    menu%?15=|
00000f90  30 0d 06 0e 13 20 20 20  20 6d 65 6e 75 25 21 32  |0....    menu%!2|
00000fa0  30 3d 34 34 0d 06 18 12  20 20 20 20 6d 65 6e 75  |0=44....    menu|
00000fb0  25 21 32 34 3d 30 0d 06  22 19 20 20 20 20 6d 65  |%!24=0..".    me|
00000fc0  6e 75 70 74 72 25 3d 6d  65 6e 75 25 2b 32 38 0d  |nuptr%=menu%+28.|
00000fd0  06 2c 1f 20 20 20 20 6d  61 78 78 25 3d a9 28 a4  |.,.    maxx%=.(.|
00000fe0  6d 73 67 5f 30 28 22 4d  54 22 29 29 2d 33 0d 06  |msg_0("MT"))-3..|
00000ff0  36 18 20 20 20 20 70 25  3d 63 73 76 5f 68 65 61  |6.    p%=csv_hea|
00001000  64 69 6e 67 73 25 0d 06  40 1a 20 20 20 20 e3 69  |dings%..@.    .i|
00001010  25 3d 31 20 b8 20 63 73  76 5f 63 6f 75 6e 74 25  |%=1 . csv_count%|
00001020  0d 06 4a 34 20 20 20 20  20 20 e7 69 25 3d 63 73  |..J4      .i%=cs|
00001030  76 5f 63 6f 75 6e 74 25  20 21 6d 65 6e 75 70 74  |v_count% !menupt|
00001040  72 25 3d 26 38 30 20 8b  20 21 6d 65 6e 75 70 74  |r%=&80 . !menupt|
00001050  72 25 3d 30 0d 06 54 17  20 20 20 20 20 20 6d 65  |r%=0..T.      me|
00001060  6e 75 70 74 72 25 21 34  3d 2d 31 0d 06 5e 1e 20  |nuptr%!4=-1..^. |
00001070  20 20 20 20 20 6d 65 6e  75 70 74 72 25 21 38 3d  |     menuptr%!8=|
00001080  26 30 37 30 30 30 31 32  31 0d 06 68 1a 20 20 20  |&07000121..h.   |
00001090  20 20 20 6d 65 6e 75 70  74 72 25 21 31 32 3d 70  |   menuptr%!12=p|
000010a0  25 2b 34 0d 06 72 18 20  20 20 20 20 20 6d 65 6e  |%+4..r.      men|
000010b0  75 70 74 72 25 21 31 36  3d 2d 31 0d 06 7c 22 20  |uptr%!16=-1..|" |
000010c0  20 20 20 20 20 6d 65 6e  75 70 74 72 25 21 32 30  |     menuptr%!20|
000010d0  3d a9 28 24 28 70 25 2b  34 29 29 2b 31 0d 06 86  |=.($(p%+4))+1...|
000010e0  16 20 20 20 20 20 20 6d  65 6e 75 70 74 72 25 2b  |.      menuptr%+|
000010f0  3d 32 34 0d 06 90 2c 20  20 20 20 20 20 e7 a9 28  |=24...,      ..(|
00001100  24 28 70 25 2b 34 29 29  3e 6d 61 78 78 25 20 6d  |$(p%+4))>maxx% m|
00001110  61 78 78 25 3d a9 28 24  28 70 25 2b 34 29 29 0d  |axx%=.($(p%+4)).|
00001120  06 9a 10 20 20 20 20 20  20 70 25 3d 21 70 25 0d  |...      p%=!p%.|
00001130  06 a4 09 20 20 20 20 ed  0d 06 ae 1e 20 20 20 20  |...    .....    |
00001140  6d 65 6e 75 25 21 31 36  3d 28 6d 61 78 78 25 2a  |menu%!16=(maxx%*|
00001150  38 2b 36 29 2a 32 0d 06  b8 35 20 20 20 20 21 74  |8+6)*2...5    !t|
00001160  61 73 6b 5f 62 75 66 66  25 3d 6d 61 69 6e 25 3a  |ask_buff%=main%:|
00001170  74 61 73 6b 5f 62 75 66  66 25 21 34 3d 49 63 6f  |task_buff%!4=Ico|
00001180  6e 5f 44 69 73 70 48 65  61 64 25 0d 06 c2 4d 20  |n_DispHead%...M |
00001190  20 20 20 c8 99 22 57 69  6d 70 5f 47 65 74 49 63  |   .."Wimp_GetIc|
000011a0  6f 6e 53 74 61 74 65 22  2c 2c 74 61 73 6b 5f 62  |onState",,task_b|
000011b0  75 66 66 25 3a 69 78 25  3d 74 61 73 6b 5f 62 75  |uff%:ix%=task_bu|
000011c0  66 66 25 21 31 36 3a 69  79 25 3d 74 61 73 6b 5f  |ff%!16:iy%=task_|
000011d0  62 75 66 66 25 21 32 30  0d 06 cc 2b 20 20 20 20  |buff%!20...+    |
000011e0  c8 99 22 57 69 6d 70 5f  47 65 74 57 69 6e 64 6f  |.."Wimp_GetWindo|
000011f0  77 53 74 61 74 65 22 2c  2c 74 61 73 6b 5f 62 75  |wState",,task_bu|
00001200  66 66 25 0d 06 d6 3a 20  20 20 20 64 69 73 70 6c  |ff%...:    displ|
00001210  61 79 5f 6d 65 6e 75 5f  78 25 20 3d 20 74 61 73  |ay_menu_x% = tas|
00001220  6b 5f 62 75 66 66 25 21  32 30 2b 74 61 73 6b 5f  |k_buff%!20+task_|
00001230  62 75 66 66 25 21 34 2b  69 78 25 2b 32 0d 06 e0  |buff%!4+ix%+2...|
00001240  3b 20 20 20 20 64 69 73  70 6c 61 79 5f 6d 65 6e  |;    display_men|
00001250  75 5f 79 25 20 3d 20 74  61 73 6b 5f 62 75 66 66  |u_y% = task_buff|
00001260  25 21 32 34 2b 74 61 73  6b 5f 62 75 66 66 25 21  |%!24+task_buff%!|
00001270  31 36 2b 69 79 25 2d 32  0d 06 ea 42 20 20 20 20  |16+iy%-2...B    |
00001280  c8 99 22 57 69 6d 70 5f  43 72 65 61 74 65 4d 65  |.."Wimp_CreateMe|
00001290  6e 75 22 2c 2c 6d 65 6e  75 25 2c 64 69 73 70 6c  |nu",,menu%,displ|
000012a0  61 79 5f 6d 65 6e 75 5f  78 25 2c 64 69 73 70 6c  |ay_menu_x%,displ|
000012b0  61 79 5f 6d 65 6e 75 5f  79 25 0d 06 f4 18 20 20  |ay_menu_y%....  |
000012c0  c9 20 49 63 6f 6e 5f 53  74 61 72 74 4d 65 72 67  |. Icon_StartMerg|
000012d0  65 25 0d 06 fe 15 20 20  20 20 f2 74 72 79 5f 6d  |e%....    .try_m|
000012e0  65 72 67 65 5f 6f 6e 0d  07 08 12 20 20 c9 20 49  |erge_on....  . I|
000012f0  63 6f 6e 5f 4e 65 78 74  25 0d 07 12 1a 20 20 20  |con_Next%....   |
00001300  20 f2 6d 65 72 67 65 5f  6e 65 78 74 5f 72 65 63  | .merge_next_rec|
00001310  6f 72 64 0d 07 1c 13 20  20 c9 20 49 63 6f 6e 5f  |ord....  . Icon_|
00001320  50 72 69 6e 74 25 0d 07  26 1f 20 20 20 20 f2 73  |Print%..&.    .s|
00001330  65 6e 64 28 22 50 72 69  6e 74 22 2c 54 5f 50 72  |end("Print",T_Pr|
00001340  69 6e 74 25 29 0d 07 30  13 20 20 20 20 70 72 69  |int%)..0.    pri|
00001350  6e 74 69 6e 67 25 3d b9  0d 07 3a 20 20 20 20 20  |nting%=...:     |
00001360  f2 64 69 73 61 62 6c 65  5f 6d 65 72 67 69 6e 67  |.disable_merging|
00001370  5f 62 75 74 74 6f 6e 73  0d 07 44 12 20 20 c9 20  |_buttons..D.  . |
00001380  49 63 6f 6e 5f 45 64 69  74 25 0d 07 4e 1e 20 20  |Icon_Edit%..N.  |
00001390  20 20 f2 73 65 6e 64 28  22 43 6c 65 61 72 4d 65  |  .send("ClearMe|
000013a0  72 67 65 22 2c 2d 31 29  0d 07 58 16 20 20 20 20  |rge",-1)..X.    |
000013b0  f2 68 6f 73 74 5f 73 68  75 74 64 6f 77 6e 0d 07  |.host_shutdown..|
000013c0  62 05 cb 0d 07 6c 05 e1  0d 07 76 10 dd f2 6d 65  |b....l....v...me|
000013d0  6e 75 5f 63 6c 69 63 6b  0d 07 80 0e ea 20 63 25  |nu_click..... c%|
000013e0  2c 6c 25 2c 66 25 0d 07  8a 12 66 25 3d 21 74 61  |,l%,f%....f%=!ta|
000013f0  73 6b 5f 62 75 66 66 25  0d 07 94 2c c8 99 22 57  |sk_buff%...,.."W|
00001400  69 6d 70 5f 47 65 74 43  61 72 65 74 50 6f 73 69  |imp_GetCaretPosi|
00001410  74 69 6f 6e 22 2c 2c 74  61 73 6b 5f 62 75 66 66  |tion",,task_buff|
00001420  25 2b 32 30 0d 07 9e 39  e7 74 61 73 6b 5f 62 75  |%+20...9.task_bu|
00001430  66 66 25 21 32 30 3c 3e  64 6f 63 5f 77 69 6e 64  |ff%!20<>doc_wind|
00001440  6f 77 25 20 85 20 74 61  73 6b 5f 6f 6b 25 2c 20  |ow% . task_ok%, |
00001450  a4 6d 73 67 5f 30 28 22  4f 4b 35 22 29 0d 07 a8  |.msg_0("OK5")...|
00001460  14 6c 25 3d 63 73 76 5f  68 65 61 64 69 6e 67 73  |.l%=csv_headings|
00001470  25 0d 07 b2 09 c8 95 20  66 25 0d 07 bc 0c 20 20  |%...... f%....  |
00001480  6c 25 3d 21 6c 25 0d 07  c6 0b 20 20 66 25 2d 3d  |l%=!l%....  f%-=|
00001490  31 0d 07 d0 05 ce 0d 07  da 16 63 25 3d ae 22 3c  |1.........c%=."<|
000014a0  57 69 6d 70 24 53 63 72  61 70 3e 22 0d 07 e4 58  |Wimp$Scrap>"...X|
000014b0  d5 23 63 25 2c 22 7b 20  6d 65 72 67 65 20 22 2b  |.#c%,"{ merge "+|
000014c0  bd 43 68 61 72 5f 51 75  6f 74 65 25 2b 22 3a 22  |.Char_Quote%+":"|
000014d0  2b a4 6d 73 67 5f 30 28  22 49 44 22 29 2b 22 20  |+.msg_0("ID")+" |
000014e0  47 65 74 46 69 65 6c 64  20 22 2b 24 28 6c 25 2b  |GetField "+$(l%+|
000014f0  34 29 2b bd 43 68 61 72  5f 51 75 6f 74 65 25 2b  |4)+.Char_Quote%+|
00001500  22 7d 22 3b 0d 07 ee 0b  6c 25 3d a2 23 63 25 0d  |"}";....l%=.#c%.|
00001510  07 f8 08 d9 23 63 25 0d  08 02 2b c8 99 22 4f 53  |....#c%...+.."OS|
00001520  5f 46 69 6c 65 22 2c 31  38 2c 22 3c 57 69 6d 70  |_File",18,"<Wimp|
00001530  24 53 63 72 61 70 3e 22  2c 44 44 46 5f 54 79 70  |$Scrap>",DDF_Typ|
00001540  65 25 0d 08 0c 12 21 74  61 73 6b 5f 62 75 66 66  |e%....!task_buff|
00001550  25 3d 36 30 0d 08 16 13  74 61 73 6b 5f 62 75 66  |%=60....task_buf|
00001560  66 25 21 31 32 3d 30 0d  08 20 13 74 61 73 6b 5f  |f%!12=0.. .task_|
00001570  62 75 66 66 25 21 31 36  3d 33 0d 08 2a 1b 74 61  |buff%!16=3..*.ta|
00001580  73 6b 5f 62 75 66 66 25  21 32 34 3d 26 34 42 35  |sk_buff%!24=&4B5|
00001590  33 35 35 35 34 0d 08 34  14 74 61 73 6b 5f 62 75  |35554..4.task_bu|
000015a0  66 66 25 21 33 36 3d 6c  25 0d 08 3e 1b 74 61 73  |ff%!36=l%..>.tas|
000015b0  6b 5f 62 75 66 66 25 21  34 30 3d 44 44 46 5f 54  |k_buff%!40=DDF_T|
000015c0  79 70 65 25 0d 08 48 26  24 28 74 61 73 6b 5f 62  |ype%..H&$(task_b|
000015d0  75 66 66 25 2b 34 34 29  3d 22 3c 57 69 6d 70 24  |uff%+44)="<Wimp$|
000015e0  53 63 72 61 70 3e 22 2b  bd 30 0d 08 52 30 c8 99  |Scrap>"+.0..R0..|
000015f0  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00001600  65 22 2c 31 37 2c 74 61  73 6b 5f 62 75 66 66 25  |e",17,task_buff%|
00001610  2c 64 6f 63 5f 74 61 73  6b 25 0d 08 5c 27 c8 99  |,doc_task%..\'..|
00001620  22 57 69 6d 70 5f 47 65  74 50 6f 69 6e 74 65 72  |"Wimp_GetPointer|
00001630  49 6e 66 6f 22 2c 2c 74  61 73 6b 5f 62 75 66 66  |Info",,task_buff|
00001640  25 0d 08 66 52 e7 28 74  61 73 6b 5f 62 75 66 66  |%..fR.(task_buff|
00001650  25 21 38 20 80 20 31 29  20 c8 99 22 57 69 6d 70  |%!8 . 1) .."Wimp|
00001660  5f 43 72 65 61 74 65 4d  65 6e 75 22 2c 2c 6d 65  |_CreateMenu",,me|
00001670  6e 75 25 2c 64 69 73 70  6c 61 79 5f 6d 65 6e 75  |nu%,display_menu|
00001680  5f 78 25 2c 64 69 73 70  6c 61 79 5f 6d 65 6e 75  |_x%,display_menu|
00001690  5f 79 25 0d 08 70 05 e1  0d 08 7a 0f dd 20 f2 64  |_y%..p....z.. .d|
000016a0  61 74 61 6c 6f 61 64 0d  08 84 2e e7 74 61 73 6b  |ataload.....task|
000016b0  5f 62 75 66 66 25 21 34  30 3c 3e 43 53 56 5f 54  |_buff%!40<>CSV_T|
000016c0  79 70 65 25 20 84 20 64  6f 63 5f 66 69 6c 65 24  |ype% . doc_file$|
000016d0  3d 22 22 20 e1 0d 08 8e  24 e7 6d 65 72 67 65 25  |="" ....$.merge%|
000016e0  20 85 20 74 61 73 6b 5f  6f 6b 25 2c a4 6d 73 67  | . task_ok%,.msg|
000016f0  5f 30 28 22 4f 4b 31 22  29 0d 08 98 27 63 73 76  |_0("OK1")...'csv|
00001700  5f 66 69 6c 65 24 3d a4  74 61 73 6b 5f 72 74 6f  |_file$=.task_rto|
00001710  7a 28 74 61 73 6b 5f 62  75 66 66 25 2b 34 34 29  |z(task_buff%+44)|
00001720  0d 08 a2 1e 74 61 73 6b  5f 62 75 66 66 25 21 31  |....task_buff%!1|
00001730  32 3d 74 61 73 6b 5f 62  75 66 66 25 21 38 0d 08  |2=task_buff%!8..|
00001740  ac 13 74 61 73 6b 5f 62  75 66 66 25 21 31 36 3d  |..task_buff%!16=|
00001750  34 0d 08 b6 33 c8 99 22  57 69 6d 70 5f 53 65 6e  |4...3.."Wimp_Sen|
00001760  64 4d 65 73 73 61 67 65  22 2c 31 37 2c 74 61 73  |dMessage",17,tas|
00001770  6b 5f 62 75 66 66 25 2c  74 61 73 6b 5f 62 75 66  |k_buff%,task_buf|
00001780  66 25 21 34 0d 08 c0 24  f2 69 63 6f 6e 5f 68 69  |f%!4...$.icon_hi|
00001790  64 65 28 6d 61 69 6e 25  2c 49 63 6f 6e 5f 44 72  |de(main%,Icon_Dr|
000017a0  6f 70 48 65 72 65 25 29  0d 08 ca 28 f2 69 63 6f  |opHere%)...(.ico|
000017b0  6e 5f 75 6e 68 69 64 65  28 6d 61 69 6e 25 2c 49  |n_unhide(main%,I|
000017c0  63 6f 6e 5f 53 74 61 72  74 4d 65 72 67 65 25 29  |con_StartMerge%)|
000017d0  0d 08 d4 27 f2 69 63 6f  6e 5f 75 6e 73 68 61 64  |...'.icon_unshad|
000017e0  65 28 6d 61 69 6e 25 2c  49 63 6f 6e 5f 44 69 73  |e(main%,Icon_Dis|
000017f0  70 48 65 61 64 25 29 0d  08 de 2a 63 73 76 5f 63  |pHead%)...*csv_c|
00001800  6f 75 6e 74 25 3d a4 64  65 74 65 72 6d 69 6e 65  |ount%=.determine|
00001810  5f 6e 75 6d 62 65 72 5f  6f 66 5f 66 69 65 6c 64  |_number_of_field|
00001820  73 0d 08 e8 50 e7 20 ac  20 a4 69 63 6f 6e 5f 73  |s...P. . .icon_s|
00001830  65 74 28 6d 61 69 6e 25  2c 49 63 6f 6e 5f 48 65  |et(main%,Icon_He|
00001840  61 64 69 6e 67 73 25 29  20 f2 67 65 74 5f 63 73  |adings%) .get_cs|
00001850  76 5f 68 65 61 64 69 6e  67 73 20 8b 20 f2 63 72  |v_headings . .cr|
00001860  65 61 74 65 5f 63 73 76  5f 68 65 61 64 69 6e 67  |eate_csv_heading|
00001870  73 0d 08 f2 2a 72 65 63  5f 74 6f 67 6f 25 3d a4  |s...*rec_togo%=.|
00001880  64 65 74 65 72 6d 69 6e  65 5f 6e 75 6d 62 65 72  |determine_number|
00001890  5f 6f 66 5f 72 65 63 6f  72 64 73 0d 08 fc 31 f2  |_of_records...1.|
000018a0  69 63 6f 6e 5f 77 72 69  74 65 28 6d 61 69 6e 25  |icon_write(main%|
000018b0  2c 49 63 6f 6e 5f 43 53  56 25 2c a4 6c 65 61 66  |,Icon_CSV%,.leaf|
000018c0  28 63 73 76 5f 66 69 6c  65 24 29 29 0d 09 06 05  |(csv_file$))....|
000018d0  e1 0d 09 10 45 dd 20 f2  63 6f 70 79 5f 66 69 65  |....E. .copy_fie|
000018e0  6c 64 28 74 6f 25 2c 20  f8 20 6c 61 73 74 5f 66  |ld(to%, . last_f|
000018f0  69 65 6c 64 25 2c 20 f8  20 66 69 65 6c 64 5f 6c  |ield%, . field_l|
00001900  65 6e 67 74 68 25 2c 20  66 75 64 67 65 5f 73 70  |ength%, fudge_sp|
00001910  61 63 65 73 25 29 0d 09  1a 2b ea 20 67 6f 74 5f  |aces%)...+. got_|
00001920  71 75 6f 74 65 25 2c 20  67 6f 74 5f 73 6c 61 73  |quote%, got_slas|
00001930  68 25 2c 20 62 25 2c 20  66 69 6e 69 73 68 65 64  |h%, b%, finished|
00001940  25 0d 09 24 10 67 6f 74  5f 71 75 6f 74 65 25 3d  |%..$.got_quote%=|
00001950  a3 0d 09 2e 10 67 6f 74  5f 73 6c 61 73 68 25 3d  |.....got_slash%=|
00001960  a3 0d 09 38 11 6c 61 73  74 5f 66 69 65 6c 64 25  |...8.last_field%|
00001970  3d a3 0d 09 42 13 66 69  65 6c 64 5f 6c 65 6e 67  |=...B.field_leng|
00001980  74 68 25 3d 30 0d 09 4c  0f 66 69 6e 69 73 68 65  |th%=0..L.finishe|
00001990  64 25 3d a3 0d 09 56 05  f5 0d 09 60 1a 20 62 25  |d%=...V....`. b%|
000019a0  3d 9a 23 63 73 76 5f 66  69 6c 65 5f 68 61 6e 64  |=.#csv_file_hand|
000019b0  6c 65 25 0d 09 6a 0b 20  c8 8e 20 b9 20 ca 0d 09  |le%..j. .. . ...|
000019c0  74 15 20 c9 20 62 25 3d  43 68 61 72 5f 51 75 6f  |t. . b%=Char_Quo|
000019d0  74 65 25 0d 09 7e 1d 20  20 67 6f 74 5f 71 75 6f  |te%..~.  got_quo|
000019e0  74 65 25 3d ac 20 67 6f  74 5f 71 75 6f 74 65 25  |te%=. got_quote%|
000019f0  0d 09 88 15 20 c9 20 62  25 3d 43 68 61 72 5f 53  |.... . b%=Char_S|
00001a00  6c 61 73 68 25 0d 09 92  14 20 20 e7 20 67 6f 74  |lash%....  . got|
00001a10  5f 73 6c 61 73 68 25 20  8c 0d 09 9c 35 20 20 20  |_slash% ....5   |
00001a20  f2 63 6f 70 79 5f 66 69  65 6c 64 5f 73 74 75 66  |.copy_field_stuf|
00001a30  66 5f 63 68 61 72 28 74  6f 25 2c 97 22 5c 22 2c  |f_char(to%,."\",|
00001a40  66 69 65 6c 64 5f 6c 65  6e 67 74 68 25 29 0d 09  |field_length%)..|
00001a50  a6 13 20 20 20 67 6f 74  5f 73 6c 61 73 68 25 3d  |..   got_slash%=|
00001a60  a3 0d 09 b0 07 20 20 cc  0d 09 ba 13 20 20 20 67  |.....  .....   g|
00001a70  6f 74 5f 73 6c 61 73 68  25 3d b9 0d 09 c4 07 20  |ot_slash%=..... |
00001a80  20 cd 0d 09 ce 15 20 c9  20 62 25 3d 43 68 61 72  | ..... . b%=Char|
00001a90  5f 53 70 61 63 65 25 0d  09 d8 17 20 20 e7 20 66  |_Space%....  . f|
00001aa0  75 64 67 65 5f 73 70 61  63 65 73 25 20 8c 0d 09  |udge_spaces% ...|
00001ab0  e2 40 20 20 20 f2 63 6f  70 79 5f 66 69 65 6c 64  |.@   .copy_field|
00001ac0  5f 73 74 75 66 66 5f 63  68 61 72 28 74 6f 25 2c  |_stuff_char(to%,|
00001ad0  43 68 61 72 5f 48 61 72  64 53 70 61 63 65 25 2c  |Char_HardSpace%,|
00001ae0  66 69 65 6c 64 5f 6c 65  6e 67 74 68 25 29 0d 09  |field_length%)..|
00001af0  ec 07 20 20 cc 0d 09 f6  3c 20 20 20 f2 63 6f 70  |..  ....<   .cop|
00001b00  79 5f 66 69 65 6c 64 5f  73 74 75 66 66 5f 63 68  |y_field_stuff_ch|
00001b10  61 72 28 74 6f 25 2c 43  68 61 72 5f 53 70 61 63  |ar(to%,Char_Spac|
00001b20  65 25 2c 66 69 65 6c 64  5f 6c 65 6e 67 74 68 25  |e%,field_length%|
00001b30  29 0d 0a 00 07 20 20 cd  0d 0a 0a 15 20 c9 20 62  |)....  ..... . b|
00001b40  25 3d 43 68 61 72 5f 43  6f 6d 6d 61 25 0d 0a 14  |%=Char_Comma%...|
00001b50  4d 20 20 e7 20 67 6f 74  5f 71 75 6f 74 65 25 20  |M  . got_quote% |
00001b60  f2 63 6f 70 79 5f 66 69  65 6c 64 5f 73 74 75 66  |.copy_field_stuf|
00001b70  66 5f 63 68 61 72 28 74  6f 25 2c 62 25 2c 66 69  |f_char(to%,b%,fi|
00001b80  65 6c 64 5f 6c 65 6e 67  74 68 25 29 20 8b 20 66  |eld_length%) . f|
00001b90  69 6e 69 73 68 65 64 25  3d b9 0d 0a 1e 35 20 c9  |inished%=....5 .|
00001ba0  20 62 25 3d 43 68 61 72  5f 4c 46 25 20 84 20 62  | b%=Char_LF% . b|
00001bb0  25 3d 43 68 61 72 5f 43  52 25 20 84 20 c5 23 63  |%=Char_CR% . .#c|
00001bc0  73 76 5f 66 69 6c 65 5f  68 61 6e 64 6c 65 25 0d  |sv_file_handle%.|
00001bd0  0a 28 13 20 20 6c 61 73  74 5f 66 69 65 6c 64 25  |.(.  last_field%|
00001be0  3d b9 0d 0a 32 11 20 20  66 69 6e 69 73 68 65 64  |=...2.  finished|
00001bf0  25 3d b9 0d 0a 3c 06 20  7f 0d 0a 46 14 20 20 e7  |%=...<. ...F.  .|
00001c00  20 67 6f 74 5f 73 6c 61  73 68 25 20 8c 0d 0a 50  | got_slash% ...P|
00001c10  0e 20 20 20 c8 8e 20 62  25 20 ca 0d 0a 5a 40 20  |.   .. b% ...Z@ |
00001c20  20 20 20 20 20 20 20 c9  20 97 22 6e 22 3a 20 f2  |       . ."n": .|
00001c30  63 6f 70 79 5f 66 69 65  6c 64 5f 73 74 75 66 66  |copy_field_stuff|
00001c40  5f 63 68 61 72 28 74 6f  25 2c 31 30 2c 66 69 65  |_char(to%,10,fie|
00001c50  6c 64 5f 6c 65 6e 67 74  68 25 29 0d 0a 64 08 20  |ld_length%)..d. |
00001c60  20 20 cb 0d 0a 6e 13 20  20 20 67 6f 74 5f 73 6c  |  ...n.   got_sl|
00001c70  61 73 68 25 3d a3 0d 0a  78 07 20 20 cc 0d 0a 82  |ash%=...x.  ....|
00001c80  33 20 20 20 f2 63 6f 70  79 5f 66 69 65 6c 64 5f  |3   .copy_field_|
00001c90  73 74 75 66 66 5f 63 68  61 72 28 74 6f 25 2c 62  |stuff_char(to%,b|
00001ca0  25 2c 66 69 65 6c 64 5f  6c 65 6e 67 74 68 25 29  |%,field_length%)|
00001cb0  0d 0a 8c 07 20 20 cd 0d  0a 96 06 20 cb 0d 0a a0  |....  ..... ....|
00001cc0  0f fd 20 66 69 6e 69 73  68 65 64 25 0d 0a aa 11  |.. finished%....|
00001cd0  e7 20 74 6f 25 20 3f 74  6f 25 3d 31 33 0d 0a b4  |. to% ?to%=13...|
00001ce0  05 e1 0d 0a be 34 dd f2  63 6f 70 79 5f 66 69 65  |.....4..copy_fie|
00001cf0  6c 64 5f 73 74 75 66 66  5f 63 68 61 72 28 f8 20  |ld_stuff_char(. |
00001d00  74 6f 25 2c 20 63 68 61  72 25 2c 20 f8 20 6c 65  |to%, char%, . le|
00001d10  6e 67 74 68 25 29 0d 0a  c8 0e 6c 65 6e 67 74 68  |ngth%)....length|
00001d20  25 2b 3d 31 0d 0a d2 1a  e7 74 6f 25 20 3f 74 6f  |%+=1.....to% ?to|
00001d30  25 3d 63 68 61 72 25 3a  74 6f 25 2b 3d 31 0d 0a  |%=char%:to%+=1..|
00001d40  dc 05 e1 0d 0a e6 21 dd  20 a4 64 65 74 65 72 6d  |......!. .determ|
00001d50  69 6e 65 5f 6e 75 6d 62  65 72 5f 6f 66 5f 66 69  |ine_number_of_fi|
00001d60  65 6c 64 73 0d 0a f0 22  ea 20 73 24 2c 63 6f 75  |elds...". s$,cou|
00001d70  6e 74 25 2c 6c 61 73 74  5f 66 69 65 6c 64 25 2c  |nt%,last_field%,|
00001d80  64 75 6d 6d 79 25 0d 0a  fa 12 f2 6f 70 65 6e 5f  |dummy%.....open_|
00001d90  63 73 76 5f 66 69 6c 65  0d 0b 04 4e e7 20 63 73  |csv_file...N. cs|
00001da0  76 5f 66 69 6c 65 5f 68  61 6e 64 6c 65 25 3d 30  |v_file_handle%=0|
00001db0  20 73 24 3d 63 73 76 5f  66 69 6c 65 24 3a 63 73  | s$=csv_file$:cs|
00001dc0  76 5f 66 69 6c 65 24 3d  22 22 3a 85 20 74 61 73  |v_file$="":. tas|
00001dd0  6b 5f 6f 6b 25 2c a4 6d  73 67 5f 31 28 22 4f 4b  |k_ok%,.msg_1("OK|
00001de0  32 22 2c 73 24 29 0d 0b  0e 05 f5 0d 0b 18 28 20  |2",s$)........( |
00001df0  f2 63 6f 70 79 5f 66 69  65 6c 64 28 30 2c 6c 61  |.copy_field(0,la|
00001e00  73 74 5f 66 69 65 6c 64  25 2c 64 75 6d 6d 79 25  |st_field%,dummy%|
00001e10  2c a3 29 0d 0b 22 0e 20  63 6f 75 6e 74 25 2b 3d  |,.)..". count%+=|
00001e20  31 0d 0b 2c 11 fd 20 6c  61 73 74 5f 66 69 65 6c  |1..,.. last_fiel|
00001e30  64 25 0d 0b 36 13 f2 63  6c 6f 73 65 5f 63 73 76  |d%..6..close_csv|
00001e40  5f 66 69 6c 65 0d 0b 40  0b 3d 63 6f 75 6e 74 25  |_file..@.=count%|
00001e50  0d 0b 4a 17 dd 20 f2 67  65 74 5f 63 73 76 5f 68  |..J.. .get_csv_h|
00001e60  65 61 64 69 6e 67 73 0d  0b 54 23 ea 20 73 24 2c  |eadings..T#. s$,|
00001e70  69 25 2c 6c 61 73 74 5f  6e 6f 64 65 25 2c 6e 6f  |i%,last_node%,no|
00001e80  64 65 25 2c 64 75 6d 6d  79 25 0d 0b 5e 14 c8 95  |de%,dummy%..^...|
00001e90  20 63 73 76 5f 68 65 61  64 69 6e 67 73 25 0d 0b  | csv_headings%..|
00001ea0  68 19 20 6e 65 78 74 25  3d 21 63 73 76 5f 68 65  |h. next%=!csv_he|
00001eb0  61 64 69 6e 67 73 25 0d  0b 72 25 20 f2 68 65 61  |adings%..r% .hea|
00001ec0  70 5f 66 72 65 65 28 22  43 53 56 48 22 2c 63 73  |p_free("CSVH",cs|
00001ed0  76 5f 68 65 61 64 69 6e  67 73 25 29 0d 0b 7c 18  |v_headings%)..|.|
00001ee0  20 63 73 76 5f 68 65 61  64 69 6e 67 73 25 3d 6e  | csv_headings%=n|
00001ef0  65 78 74 25 0d 0b 86 05  ce 0d 0b 90 12 f2 6f 70  |ext%..........op|
00001f00  65 6e 5f 63 73 76 5f 66  69 6c 65 0d 0b 9a 10 6c  |en_csv_file....l|
00001f10  61 73 74 5f 6e 6f 64 65  25 3d 30 0d 0b a4 17 e3  |ast_node%=0.....|
00001f20  20 69 25 3d 31 20 b8 20  63 73 76 5f 63 6f 75 6e  | i%=1 . csv_coun|
00001f30  74 25 0d 0b ae 2c 20 f2  63 6f 70 79 5f 66 69 65  |t%..., .copy_fie|
00001f40  6c 64 28 74 61 73 6b 5f  62 75 66 66 25 2c 64 75  |ld(task_buff%,du|
00001f50  6d 6d 79 25 2c 64 75 6d  6d 79 25 2c b9 29 0d 0b  |mmy%,dummy%,.)..|
00001f60  b8 13 20 73 24 3d 24 74  61 73 6b 5f 62 75 66 66  |.. s$=$task_buff|
00001f70  25 0d 0b c2 22 20 e7 20  73 24 3d 22 22 20 73 24  |%..." . s$="" s$|
00001f80  3d a4 6d 73 67 5f 31 28  22 46 49 22 2c c3 28 69  |=.msg_1("FI",.(i|
00001f90  25 29 29 0d 0b cc 26 20  6e 6f 64 65 25 3d a4 68  |%))...& node%=.h|
00001fa0  65 61 70 5f 63 6c 61 69  6d 28 22 43 53 56 48 22  |eap_claim("CSVH"|
00001fb0  2c a9 28 73 24 29 2b 35  29 0d 0b d6 0d 20 21 6e  |,.(s$)+5).... !n|
00001fc0  6f 64 65 25 3d 30 0d 0b  e0 12 20 24 28 6e 6f 64  |ode%=0.... $(nod|
00001fd0  65 25 2b 34 29 3d 73 24  0d 0b ea 39 20 e7 20 6c  |e%+4)=s$...9 . l|
00001fe0  61 73 74 5f 6e 6f 64 65  25 20 21 6c 61 73 74 5f  |ast_node% !last_|
00001ff0  6e 6f 64 65 25 3d 6e 6f  64 65 25 20 8b 20 63 73  |node%=node% . cs|
00002000  76 5f 68 65 61 64 69 6e  67 73 25 3d 6e 6f 64 65  |v_headings%=node|
00002010  25 0d 0b f4 15 20 6c 61  73 74 5f 6e 6f 64 65 25  |%.... last_node%|
00002020  3d 6e 6f 64 65 25 0d 0b  fe 05 ed 0d 0c 08 24 63  |=node%........$c|
00002030  73 76 5f 66 69 6c 65 5f  70 74 72 25 3d 8f 23 63  |sv_file_ptr%=.#c|
00002040  73 76 5f 66 69 6c 65 5f  68 61 6e 64 6c 65 25 0d  |sv_file_handle%.|
00002050  0c 12 13 f2 63 6c 6f 73  65 5f 63 73 76 5f 66 69  |....close_csv_fi|
00002060  6c 65 0d 0c 1c 05 e1 0d  0c 26 1a dd 20 f2 63 72  |le.......&.. .cr|
00002070  65 61 74 65 5f 63 73 76  5f 68 65 61 64 69 6e 67  |eate_csv_heading|
00002080  73 0d 0c 30 17 ea 20 73  24 2c 69 25 2c 6c 61 73  |s..0.. s$,i%,las|
00002090  74 25 2c 6e 6f 64 65 25  0d 0c 3a 14 c8 95 20 63  |t%,node%..:... c|
000020a0  73 76 5f 68 65 61 64 69  6e 67 73 25 0d 0c 44 19  |sv_headings%..D.|
000020b0  20 6e 6f 64 65 25 3d 21  63 73 76 5f 68 65 61 64  | node%=!csv_head|
000020c0  69 6e 67 73 25 0d 0c 4e  25 20 f2 68 65 61 70 5f  |ings%..N% .heap_|
000020d0  66 72 65 65 28 22 43 53  56 48 22 2c 63 73 76 5f  |free("CSVH",csv_|
000020e0  68 65 61 64 69 6e 67 73  25 29 0d 0c 58 18 20 63  |headings%)..X. c|
000020f0  73 76 5f 68 65 61 64 69  6e 67 73 25 3d 6e 6f 64  |sv_headings%=nod|
00002100  65 25 0d 0c 62 05 ce 0d  0c 6c 0b 6c 61 73 74 25  |e%..b....l.last%|
00002110  3d 30 0d 0c 76 17 e3 20  69 25 3d 31 20 b8 20 63  |=0..v.. i%=1 . c|
00002120  73 76 5f 63 6f 75 6e 74  25 0d 0c 80 1a 20 73 24  |sv_count%.... s$|
00002130  3d a4 6d 73 67 5f 31 28  22 46 49 22 2c c3 28 69  |=.msg_1("FI",.(i|
00002140  25 29 29 0d 0c 8a 26 20  6e 6f 64 65 25 3d a4 68  |%))...& node%=.h|
00002150  65 61 70 5f 63 6c 61 69  6d 28 22 43 53 56 48 22  |eap_claim("CSVH"|
00002160  2c a9 28 73 24 29 2b 35  29 0d 0c 94 0d 20 21 6e  |,.(s$)+5).... !n|
00002170  6f 64 65 25 3d 30 0d 0c  9e 12 20 24 28 6e 6f 64  |ode%=0.... $(nod|
00002180  65 25 2b 34 29 3d 73 24  0d 0c a8 2f 20 e7 20 6c  |e%+4)=s$.../ . l|
00002190  61 73 74 25 20 21 6c 61  73 74 25 3d 6e 6f 64 65  |ast% !last%=node|
000021a0  25 20 8b 20 63 73 76 5f  68 65 61 64 69 6e 67 73  |% . csv_headings|
000021b0  25 3d 6e 6f 64 65 25 0d  0c b2 10 20 6c 61 73 74  |%=node%.... last|
000021c0  25 3d 6e 6f 64 65 25 0d  0c bc 05 ed 0d 0c c6 13  |%=node%.........|
000021d0  63 73 76 5f 66 69 6c 65  5f 70 74 72 25 3d 30 0d  |csv_file_ptr%=0.|
000021e0  0c d0 05 e1 0d 0c da 22  dd 20 a4 64 65 74 65 72  |.......". .deter|
000021f0  6d 69 6e 65 5f 6e 75 6d  62 65 72 5f 6f 66 5f 72  |mine_number_of_r|
00002200  65 63 6f 72 64 73 0d 0c  e4 19 ea 20 63 6f 75 6e  |ecords..... coun|
00002210  74 25 2c 62 25 2c 6e 65  77 5f 6c 69 6e 65 25 0d  |t%,b%,new_line%.|
00002220  0c ee 0c 63 6f 75 6e 74  25 3d 30 0d 0c f8 11 f2  |...count%=0.....|
00002230  68 6f 75 72 67 6c 61 73  73 5f 6f 6e 0d 0d 02 12  |hourglass_on....|
00002240  f2 6f 70 65 6e 5f 63 73  76 5f 66 69 6c 65 0d 0d  |.open_csv_file..|
00002250  0c 25 cf 23 63 73 76 5f  66 69 6c 65 5f 68 61 6e  |.%.#csv_file_han|
00002260  64 6c 65 25 3d 63 73 76  5f 66 69 6c 65 5f 70 74  |dle%=csv_file_pt|
00002270  72 25 20 0d 0d 16 0f 6e  65 77 5f 6c 69 6e 65 25  |r% ....new_line%|
00002280  3d b9 0d 0d 20 05 f5 0d  0d 2a 1a 20 62 25 3d 9a  |=... ....*. b%=.|
00002290  23 63 73 76 5f 66 69 6c  65 5f 68 61 6e 64 6c 65  |#csv_file_handle|
000022a0  25 0d 0d 34 37 20 e7 20  62 25 3d 43 68 61 72 5f  |%..47 . b%=Char_|
000022b0  43 52 25 20 84 20 62 25  3d 43 68 61 72 5f 4c 46  |CR% . b%=Char_LF|
000022c0  25 20 84 20 c5 23 63 73  76 5f 66 69 6c 65 5f 68  |% . .#csv_file_h|
000022d0  61 6e 64 6c 65 25 20 8c  0d 0d 3e 1f 20 20 e7 20  |andle% ...>.  . |
000022e0  ac 20 6e 65 77 5f 6c 69  6e 65 25 20 8c 20 63 6f  |. new_line% . co|
000022f0  75 6e 74 25 2b 3d 31 0d  0d 48 11 20 20 6e 65 77  |unt%+=1..H.  new|
00002300  5f 6c 69 6e 65 25 3d b9  0d 0d 52 06 20 cc 0d 0d  |_line%=...R. ...|
00002310  5c 11 20 20 6e 65 77 5f  6c 69 6e 65 25 3d a3 0d  |\.  new_line%=..|
00002320  0d 66 06 20 cd 0d 0d 70  18 fd 20 c5 23 63 73 76  |.f. ...p.. .#csv|
00002330  5f 66 69 6c 65 5f 68 61  6e 64 6c 65 25 0d 0d 7a  |_file_handle%..z|
00002340  13 f2 63 6c 6f 73 65 5f  63 73 76 5f 66 69 6c 65  |..close_csv_file|
00002350  0d 0d 84 12 f2 68 6f 75  72 67 6c 61 73 73 5f 6f  |.....hourglass_o|
00002360  66 66 0d 0d 8e 0b 3d 63  6f 75 6e 74 25 0d 0d 98  |ff....=count%...|
00002370  13 dd 20 f2 64 6f 63 5f  72 65 63 65 69 76 65 64  |.. .doc_received|
00002380  0d 0d a2 12 ea 20 6c 6f  6f 70 25 2c 20 74 65 6d  |..... loop%, tem|
00002390  70 24 0d 0d ac 14 e7 20  64 6f 63 5f 66 69 6c 65  |p$..... doc_file|
000023a0  24 3d 22 22 20 8c 0d 0d  b6 1b 20 64 6f 63 5f 74  |$="" ..... doc_t|
000023b0  61 73 6b 25 3d 74 61 73  6b 5f 62 75 66 66 25 21  |ask%=task_buff%!|
000023c0  34 0d 0d c0 1e 20 64 6f  63 5f 77 69 6e 64 6f 77  |4.... doc_window|
000023d0  25 3d 74 61 73 6b 5f 62  75 66 66 25 21 32 30 0d  |%=task_buff%!20.|
000023e0  0d ca 2f 20 64 6f 63 5f  66 69 6c 65 24 3d a4 6c  |../ doc_file$=.l|
000023f0  65 61 66 28 a4 74 61 73  6b 5f 72 74 6f 7a 28 74  |eaf(.task_rtoz(t|
00002400  61 73 6b 5f 62 75 66 66  25 2b 32 34 29 29 0d 0d  |ask_buff%+24))..|
00002410  d4 05 cd 0d 0d de 66 e7  64 6f 63 5f 74 61 73 6b  |......f.doc_task|
00002420  25 3d 74 61 73 6b 5f 62  75 66 66 25 21 34 20 80  |%=task_buff%!4 .|
00002430  20 64 6f 63 5f 77 69 6e  64 6f 77 25 3d 74 61 73  | doc_window%=tas|
00002440  6b 5f 62 75 66 66 25 21  32 30 20 80 20 64 6f 63  |k_buff%!20 . doc|
00002450  5f 66 69 6c 65 24 3d a4  6c 65 61 66 28 a4 74 61  |_file$=.leaf(.ta|
00002460  73 6b 5f 72 74 6f 7a 28  74 61 73 6b 5f 62 75 66  |sk_rtoz(task_buf|
00002470  66 25 2b 32 34 29 29 20  8c 0d 0d e8 1f 20 74 61  |f%+24)) ..... ta|
00002480  73 6b 5f 62 75 66 66 25  21 31 32 3d 74 61 73 6b  |sk_buff%!12=task|
00002490  5f 62 75 66 66 25 21 38  0d 0d f2 34 20 c8 99 22  |_buff%!8...4 .."|
000024a0  57 69 6d 70 5f 53 65 6e  64 4d 65 73 73 61 67 65  |Wimp_SendMessage|
000024b0  22 2c 31 39 2c 74 61 73  6b 5f 62 75 66 66 25 2c  |",19,task_buff%,|
000024c0  74 61 73 6b 5f 62 75 66  66 25 21 34 0d 0d fc 38  |task_buff%!4...8|
000024d0  20 21 77 69 6e 5f 62 75  66 66 25 3d 6d 61 69 6e  | !win_buff%=main|
000024e0  25 3a c8 99 22 57 69 6d  70 5f 47 65 74 57 69 6e  |%:.."Wimp_GetWin|
000024f0  64 6f 77 53 74 61 74 65  22 2c 2c 77 69 6e 5f 62  |dowState",,win_b|
00002500  75 66 66 25 0d 0e 06 33  20 77 69 6e 5f 62 75 66  |uff%...3 win_buf|
00002510  66 25 21 32 38 3d 2d 31  3a c8 99 22 57 69 6d 70  |f%!28=-1:.."Wimp|
00002520  5f 4f 70 65 6e 57 69 6e  64 6f 77 22 2c 2c 77 69  |_OpenWindow",,wi|
00002530  6e 5f 62 75 66 66 25 0d  0e 10 30 20 f2 69 63 6f  |n_buff%...0 .ico|
00002540  6e 5f 77 72 69 74 65 28  6d 61 69 6e 25 2c 49 63  |n_write(main%,Ic|
00002550  6f 6e 5f 64 6f 63 75 6d  65 6e 74 25 2c 64 6f 63  |on_document%,doc|
00002560  5f 66 69 6c 65 24 29 0d  0e 1a 05 cd 0d 0e 24 0c  |_file$).......$.|
00002570  74 65 6d 70 24 3d 22 22  0d 0e 2e 1c e3 20 6c 6f  |temp$=""..... lo|
00002580  6f 70 25 3d 31 20 b8 20  a9 28 64 6f 63 5f 66 69  |op%=1 . .(doc_fi|
00002590  6c 65 24 29 0d 0e 38 3f  e7 20 97 28 c1 64 6f 63  |le$)..8?. .(.doc|
000025a0  5f 66 69 6c 65 24 2c 20  6c 6f 6f 70 25 2c 31 29  |_file$, loop%,1)|
000025b0  29 3e 33 32 20 8c 20 74  65 6d 70 24 2b 3d c1 64  |)>32 . temp$+=.d|
000025c0  6f 63 5f 66 69 6c 65 24  2c 20 6c 6f 6f 70 25 2c  |oc_file$, loop%,|
000025d0  20 31 29 0d 0e 42 0b ed  20 6c 6f 6f 70 25 0d 0e  | 1)..B.. loop%..|
000025e0  4c 13 64 6f 63 5f 66 69  6c 65 24 3d 74 65 6d 70  |L.doc_file$=temp|
000025f0  24 0d 0e 56 05 e1 0d 0e  60 0f dd 20 f2 64 61 74  |$..V....`.. .dat|
00002600  61 73 61 76 65 0d 0e 6a  12 ea 20 6c 6f 6f 70 25  |asave..j.. loop%|
00002610  2c 20 62 79 74 65 25 0d  0e 74 1f e7 20 74 61 73  |, byte%..t.. tas|
00002620  6b 5f 62 75 66 66 25 21  34 30 3d 43 53 56 5f 54  |k_buff%!40=CSV_T|
00002630  79 70 65 25 20 8c 0d 0e  7e 15 20 74 61 73 6b 5f  |ype% ...~. task_|
00002640  62 75 66 66 25 21 30 3d  32 35 36 0d 0e 88 1f 20  |buff%!0=256.... |
00002650  74 61 73 6b 5f 62 75 66  66 25 21 31 32 3d 74 61  |task_buff%!12=ta|
00002660  73 6b 5f 62 75 66 66 25  21 38 0d 0e 92 14 20 74  |sk_buff%!8.... t|
00002670  61 73 6b 5f 62 75 66 66  25 21 31 36 3d 32 0d 0e  |ask_buff%!16=2..|
00002680  9c 15 20 74 61 73 6b 5f  62 75 66 66 25 21 33 36  |.. task_buff%!36|
00002690  3d 2d 31 0d 0e a6 0c 6c  6f 6f 70 25 3d 34 34 0d  |=-1....loop%=44.|
000026a0  0e b0 1c c8 95 20 28 74  61 73 6b 5f 62 75 66 66  |..... (task_buff|
000026b0  25 3f 6c 6f 6f 70 25 29  3e 33 31 0d 0e ba 12 20  |%?loop%)>31.... |
000026c0  20 20 20 20 20 6c 6f 6f  70 25 2b 3d 31 0d 0e c4  |     loop%+=1...|
000026d0  05 ce 0d 0e ce 17 74 61  73 6b 5f 62 75 66 66 25  |......task_buff%|
000026e0  3f 6c 6f 6f 70 25 3d 31  33 0d 0e d8 38 24 28 74  |?loop%=13...8$(t|
000026f0  61 73 6b 5f 62 75 66 66  25 2b 34 34 29 3d 22 3c  |ask_buff%+44)="<|
00002700  57 69 6d 70 24 53 63 72  61 70 44 69 72 3e 2e 22  |Wimp$ScrapDir>."|
00002710  2b 24 28 74 61 73 6b 5f  62 75 66 66 25 2b 34 34  |+$(task_buff%+44|
00002720  29 0d 0e e2 33 c8 99 22  57 69 6d 70 5f 53 65 6e  |)...3.."Wimp_Sen|
00002730  64 4d 65 73 73 61 67 65  22 2c 31 37 2c 74 61 73  |dMessage",17,tas|
00002740  6b 5f 62 75 66 66 25 2c  74 61 73 6b 5f 62 75 66  |k_buff%,task_buf|
00002750  66 25 21 34 0d 0e ec 05  cd 0d 0e f6 05 e1 0d 0f  |f%!4............|
00002760  00 0f dd 20 a4 6c 65 61  66 28 73 24 29 0d 0f 0a  |... .leaf(s$)...|
00002770  0f ea 20 64 6f 74 69 6e  64 65 78 25 0d 0f 14 0f  |.. dotindex%....|
00002780  64 6f 74 69 6e 64 65 78  25 3d 30 0d 0f 1e 1b c8  |dotindex%=0.....|
00002790  95 20 a7 73 24 2c 22 2e  22 2c 64 6f 74 69 6e 64  |. .s$,".",dotind|
000027a0  65 78 25 2b 31 29 0d 0f  28 24 20 20 64 6f 74 69  |ex%+1)..($  doti|
000027b0  6e 64 65 78 25 3d a7 73  24 2c 22 2e 22 2c 64 6f  |ndex%=.s$,".",do|
000027c0  74 69 6e 64 65 78 25 2b  31 29 0d 0f 32 05 ce 0d  |tindex%+1)..2...|
000027d0  0f 3c 15 3d c1 73 24 2c  64 6f 74 69 6e 64 65 78  |.<.=.s$,dotindex|
000027e0  25 2b 31 29 0d 0f 46 0e  dd 20 f2 70 72 65 71 75  |%+1)..F.. .prequ|
000027f0  69 74 0d 0f 50 0d e7 6d  65 72 67 65 25 20 8c 0d  |it..P..merge% ..|
00002800  0f 5a 05 20 0d 0f 64 05  cd 0d 0f 6e 05 e1 0d 0f  |.Z. ..d....n....|
00002810  78 13 dd 20 f2 74 72 79  5f 6d 65 72 67 65 5f 6f  |x.. .try_merge_o|
00002820  6e 0d 0f 82 0c 6d 65 72  67 65 25 3d b9 0d 0f 8c  |n....merge%=....|
00002830  2e 70 72 65 73 65 72 76  65 64 5f 73 74 61 72 74  |.preserved_start|
00002840  5f 6f 66 5f 64 61 74 61  5f 70 74 72 25 3d 63 73  |_of_data_ptr%=cs|
00002850  76 5f 66 69 6c 65 5f 70  74 72 25 0d 0f 96 18 f2  |v_file_ptr%.....|
00002860  73 65 6e 64 28 22 45 64  69 74 20 4f 66 66 22 2c  |send("Edit Off",|
00002870  2d 31 29 0d 0f a0 16 f2  6d 65 72 67 65 5f 6e 65  |-1).....merge_ne|
00002880  78 74 5f 72 65 63 6f 72  64 0d 0f aa 05 e1 0d 0f  |xt_record.......|
00002890  b4 10 dd 20 f2 6d 65 72  67 65 5f 6f 66 66 0d 0f  |... .merge_off..|
000028a0  be 0b ea 20 6e 65 78 74  25 0d 0f c8 20 e7 20 6d  |... next%... . m|
000028b0  65 72 67 65 25 20 f2 73  65 6e 64 28 22 45 64 69  |erge% .send("Edi|
000028c0  74 20 4f 6e 22 2c 2d 31  29 0d 0f d2 0c 6d 65 72  |t On",-1)....mer|
000028d0  67 65 25 3d a3 0d 0f dc  10 63 73 76 5f 66 69 6c  |ge%=.....csv_fil|
000028e0  65 24 3d 22 22 0d 0f e6  16 63 73 76 5f 66 69 6c  |e$=""....csv_fil|
000028f0  65 5f 68 61 6e 64 6c 65  25 3d 30 0d 0f f0 10 63  |e_handle%=0....c|
00002900  73 76 5f 63 6f 75 6e 74  25 3d 30 0d 0f fa 13 63  |sv_count%=0....c|
00002910  73 76 5f 68 65 61 64 69  6e 67 73 25 3d 30 0d 10  |sv_headings%=0..|
00002920  04 15 63 73 76 5f 66 69  65 6c 64 5f 70 74 72 73  |..csv_field_ptrs|
00002930  25 3d 30 0d 10 0e 15 63  73 76 5f 66 69 65 6c 64  |%=0....csv_field|
00002940  5f 6c 65 6e 73 25 3d 30  0d 10 18 13 63 73 76 5f  |_lens%=0....csv_|
00002950  66 69 6c 65 5f 70 74 72  25 3d 30 0d 10 22 10 64  |file_ptr%=0..".d|
00002960  6f 63 5f 66 69 6c 65 24  3d 22 22 0d 10 2c 0f 64  |oc_file$=""..,.d|
00002970  6f 63 5f 74 61 73 6b 25  3d 30 0d 10 36 11 64 6f  |oc_task%=0..6.do|
00002980  63 5f 77 69 6e 64 6f 77  25 3d 30 0d 10 40 12 66  |c_window%=0..@.f|
00002990  69 65 6c 64 5f 63 6f 75  6e 74 25 3d 30 0d 10 4a  |ield_count%=0..J|
000029a0  0f 72 65 63 5f 74 6f 67  6f 25 3d 30 0d 10 54 0f  |.rec_togo%=0..T.|
000029b0  72 65 63 5f 64 6f 6e 65  25 3d 30 0d 10 5e 05 e1  |rec_done%=0..^..|
000029c0  0d 10 68 18 dd 20 f2 6d  65 72 67 65 5f 6e 65 78  |..h.. .merge_nex|
000029d0  74 5f 72 65 63 6f 72 64  0d 10 72 14 e7 20 72 65  |t_record..r.. re|
000029e0  63 5f 74 6f 67 6f 25 3c  3e 30 20 8c 0d 10 7c 12  |c_togo%<>0 ...|.|
000029f0  20 f2 68 6f 75 72 67 6c  61 73 73 5f 6f 6e 0d 10  | .hourglass_on..|
00002a00  86 11 20 f2 6e 65 78 74  5f 72 65 63 6f 72 64 0d  |.. .next_record.|
00002a10  10 90 1c 20 f2 73 65 6e  64 28 22 4d 65 72 67 65  |... .send("Merge|
00002a20  22 2c 54 5f 4d 65 72 67  65 25 29 0d 10 9a 1d 20  |",T_Merge%).... |
00002a30  f2 64 69 73 61 62 6c 65  5f 6d 65 72 67 69 6e 67  |.disable_merging|
00002a40  5f 62 75 74 74 6f 6e 73  0d 10 a4 05 cc 0d 10 ae  |_buttons........|
00002a50  26 20 24 28 65 72 72 6f  72 5f 62 75 66 66 25 2b  |& $(error_buff%+|
00002a60  34 29 3d a4 6d 73 67 5f  30 28 22 4f 4b 36 22 29  |4)=.msg_0("OK6")|
00002a70  2b bd 30 0d 10 b8 46 20  c8 99 22 57 69 6d 70 5f  |+.0...F .."Wimp_|
00002a80  52 65 70 6f 72 74 45 72  72 6f 72 22 2c 65 72 72  |ReportError",err|
00002a90  6f 72 5f 62 75 66 66 25  2c 25 31 30 30 30 31 2c  |or_buff%,%10001,|
00002aa0  a4 6d 73 67 5f 31 28 22  4d 53 22 2c a4 6d 73 67  |.msg_1("MS",.msg|
00002ab0  5f 30 28 22 49 44 22 29  29 0d 10 c2 13 20 f2 68  |_0("ID")).... .h|
00002ac0  6f 73 74 5f 73 68 75 74  64 6f 77 6e 0d 10 cc 05  |ost_shutdown....|
00002ad0  cd 0d 10 d6 05 e1 0d 10  e0 12 dd 20 f2 6e 65 78  |........... .nex|
00002ae0  74 5f 72 65 63 6f 72 64  0d 10 ea 28 ea 20 6c 65  |t_record...(. le|
00002af0  6e 25 2c 69 25 2c 64 75  6d 6d 79 25 2c 66 69 6e  |n%,i%,dummy%,fin|
00002b00  69 73 68 65 64 25 2c 74  68 69 73 5f 70 74 72 25  |ished%,this_ptr%|
00002b10  0d 10 f4 10 ea 20 6e 75  6d 66 69 65 6c 64 73 25  |..... numfields%|
00002b20  0d 10 fe 10 6e 75 6d 66  69 65 6c 64 73 25 3d 30  |....numfields%=0|
00002b30  0d 11 08 12 f2 6f 70 65  6e 5f 63 73 76 5f 66 69  |.....open_csv_fi|
00002b40  6c 65 0d 11 12 3b e7 20  63 73 76 5f 66 69 6c 65  |le...;. csv_file|
00002b50  5f 68 61 6e 64 6c 65 25  3d 30 20 85 20 74 61 73  |_handle%=0 . tas|
00002b60  6b 5f 6f 6b 25 2c a4 6d  73 67 5f 31 28 22 4f 4b  |k_ok%,.msg_1("OK|
00002b70  32 22 2c 63 73 76 5f 66  69 6c 65 24 29 0d 11 1c  |2",csv_file$)...|
00002b80  16 c8 95 20 63 73 76 5f  66 69 65 6c 64 5f 70 74  |... csv_field_pt|
00002b90  72 73 25 0d 11 26 1b 20  6e 65 78 74 25 3d 21 63  |rs%..&. next%=!c|
00002ba0  73 76 5f 66 69 65 6c 64  5f 70 74 72 73 25 0d 11  |sv_field_ptrs%..|
00002bb0  30 27 20 f2 68 65 61 70  5f 66 72 65 65 28 22 43  |0' .heap_free("C|
00002bc0  53 56 50 22 2c 63 73 76  5f 66 69 65 6c 64 5f 70  |SVP",csv_field_p|
00002bd0  74 72 73 25 29 0d 11 3a  1a 20 63 73 76 5f 66 69  |trs%)..:. csv_fi|
00002be0  65 6c 64 5f 70 74 72 73  25 3d 6e 65 78 74 25 0d  |eld_ptrs%=next%.|
00002bf0  11 44 05 ce 0d 11 4e 16  c8 95 20 63 73 76 5f 66  |.D....N... csv_f|
00002c00  69 65 6c 64 5f 6c 65 6e  73 25 0d 11 58 1b 20 6e  |ield_lens%..X. n|
00002c10  65 78 74 25 3d 21 63 73  76 5f 66 69 65 6c 64 5f  |ext%=!csv_field_|
00002c20  6c 65 6e 73 25 0d 11 62  27 20 f2 68 65 61 70 5f  |lens%..b' .heap_|
00002c30  66 72 65 65 28 22 43 53  56 4c 22 2c 63 73 76 5f  |free("CSVL",csv_|
00002c40  66 69 65 6c 64 5f 6c 65  6e 73 25 29 0d 11 6c 1a  |field_lens%)..l.|
00002c50  20 63 73 76 5f 66 69 65  6c 64 5f 6c 65 6e 73 25  | csv_field_lens%|
00002c60  3d 6e 65 78 74 25 0d 11  76 05 ce 0d 11 80 24 cf  |=next%..v.....$.|
00002c70  23 63 73 76 5f 66 69 6c  65 5f 68 61 6e 64 6c 65  |#csv_file_handle|
00002c80  25 3d 63 73 76 5f 66 69  6c 65 5f 70 74 72 25 0d  |%=csv_file_ptr%.|
00002c90  11 8a 08 69 25 3d 30 0d  11 94 05 f5 0d 11 9e 0b  |...i%=0.........|
00002ca0  20 20 69 25 2b 3d 31 0d  11 a8 07 20 20 f5 0d 11  |  i%+=1....  ...|
00002cb0  b2 28 20 20 20 20 74 68  69 73 5f 70 74 72 25 3d  |.(    this_ptr%=|
00002cc0  8f 23 63 73 76 5f 66 69  6c 65 5f 68 61 6e 64 6c  |.#csv_file_handl|
00002cd0  65 25 20 20 20 20 0d 11  bc 24 20 20 20 20 f2 63  |e%    ...$    .c|
00002ce0  6f 70 79 5f 66 69 65 6c  64 28 30 2c 64 75 6d 6d  |opy_field(0,dumm|
00002cf0  79 25 2c 6c 65 6e 25 2c  a3 29 0d 11 c6 13 20 20  |y%,len%,.)....  |
00002d00  20 20 66 69 6e 69 73 68  65 64 25 3d b9 0d 11 d0  |  finished%=....|
00002d10  45 20 20 20 20 e7 20 ac  20 c5 23 63 73 76 5f 66  |E    . . .#csv_f|
00002d20  69 6c 65 5f 68 61 6e 64  6c 65 25 20 80 20 69 25  |ile_handle% . i%|
00002d30  3d 31 20 80 20 6c 65 6e  25 3d 30 20 80 20 64 75  |=1 . len%=0 . du|
00002d40  6d 6d 79 25 20 8c 20 66  69 6e 69 73 68 65 64 25  |mmy% . finished%|
00002d50  3d a3 0d 11 da 11 20 20  fd 20 66 69 6e 69 73 68  |=.....  . finish|
00002d60  65 64 25 0d 11 e4 1f 20  20 f2 61 64 64 5f 66 69  |ed%....  .add_fi|
00002d70  65 6c 64 5f 70 74 72 28  74 68 69 73 5f 70 74 72  |eld_ptr(this_ptr|
00002d80  25 29 0d 11 ee 1a 20 20  f2 61 64 64 5f 66 69 65  |%)....  .add_fie|
00002d90  6c 64 5f 6c 65 6e 28 6c  65 6e 25 29 0d 11 f8 31  |ld_len(len%)...1|
00002da0  fd 20 69 25 3d 63 73 76  5f 63 6f 75 6e 74 25 20  |. i%=csv_count% |
00002db0  84 20 64 75 6d 6d 79 25  20 84 20 c5 23 63 73 76  |. dummy% . .#csv|
00002dc0  5f 66 69 6c 65 5f 68 61  6e 64 6c 65 25 0d 12 02  |_file_handle%...|
00002dd0  13 e7 20 ac 20 64 75 6d  6d 79 25 20 f2 65 6f 6c  |.. . dummy% .eol|
00002de0  0d 12 0c 15 e7 20 69 25  3c 63 73 76 5f 63 6f 75  |..... i%<csv_cou|
00002df0  6e 74 25 20 8c 0d 12 16  16 20 20 c8 95 20 69 25  |nt% .....  .. i%|
00002e00  3c 63 73 76 5f 63 6f 75  6e 74 25 0d 12 20 0c 20  |<csv_count%.. . |
00002e10  20 20 69 25 2b 3d 31 0d  12 2a 18 20 20 20 f2 61  |  i%+=1..*.   .a|
00002e20  64 64 5f 66 69 65 6c 64  5f 70 74 72 28 30 29 0d  |dd_field_ptr(0).|
00002e30  12 34 18 20 20 20 f2 61  64 64 5f 66 69 65 6c 64  |.4.   .add_field|
00002e40  5f 6c 65 6e 28 30 29 0d  12 3e 07 20 20 ce 0d 12  |_len(0)..>.  ...|
00002e50  48 05 cd 0d 12 52 24 63  73 76 5f 66 69 6c 65 5f  |H....R$csv_file_|
00002e60  70 74 72 25 3d 8f 23 63  73 76 5f 66 69 6c 65 5f  |ptr%=.#csv_file_|
00002e70  68 61 6e 64 6c 65 25 0d  12 5c 13 f2 63 6c 6f 73  |handle%..\..clos|
00002e80  65 5f 63 73 76 5f 66 69  6c 65 0d 12 66 05 e1 0d  |e_csv_file..f...|
00002e90  12 70 0a dd 20 f2 65 6f  6c 0d 12 7a 07 ea 20 78  |.p.. .eol..z.. x|
00002ea0  0d 12 84 07 78 3d 30 0d  12 8e 05 f5 0d 12 98 32  |....x=0........2|
00002eb0  20 e7 20 ac 20 c5 23 63  73 76 5f 66 69 6c 65 5f  | . . .#csv_file_|
00002ec0  68 61 6e 64 6c 65 25 20  8c 20 78 3d 9a 23 63 73  |handle% . x=.#cs|
00002ed0  76 5f 66 69 6c 65 5f 68  61 6e 64 6c 65 25 0d 12  |v_file_handle%..|
00002ee0  a2 32 fd 20 78 3d 43 68  61 72 5f 43 52 25 20 84  |.2. x=Char_CR% .|
00002ef0  20 78 3d 43 68 61 72 5f  4c 46 25 20 84 20 c5 23  | x=Char_LF% . .#|
00002f00  63 73 76 5f 66 69 6c 65  5f 68 61 6e 64 6c 65 25  |csv_file_handle%|
00002f10  0d 12 ac 05 e1 0d 12 b6  1c dd 20 f2 61 64 64 5f  |.......... .add_|
00002f20  66 69 65 6c 64 5f 70 74  72 28 69 6e 64 65 78 25  |field_ptr(index%|
00002f30  29 0d 12 c0 11 ea 20 6e  6f 64 65 25 2c 6c 61 73  |)..... node%,las|
00002f40  74 25 0d 12 ca 1f 6e 6f  64 65 25 3d a4 68 65 61  |t%....node%=.hea|
00002f50  70 5f 63 6c 61 69 6d 28  22 43 53 56 50 22 2c 38  |p_claim("CSVP",8|
00002f60  29 0d 12 d4 0d 6e 6f 64  65 25 21 30 3d 30 0d 12  |)....node%!0=0..|
00002f70  de 12 6e 6f 64 65 25 21  34 3d 69 6e 64 65 78 25  |..node%!4=index%|
00002f80  0d 12 e8 19 e7 20 63 73  76 5f 66 69 65 6c 64 5f  |..... csv_field_|
00002f90  70 74 72 73 25 3d 30 20  8c 0d 12 f2 1a 20 63 73  |ptrs%=0 ..... cs|
00002fa0  76 5f 66 69 65 6c 64 5f  70 74 72 73 25 3d 6e 6f  |v_field_ptrs%=no|
00002fb0  64 65 25 0d 12 fc 05 cc  0d 13 06 1a 20 6c 61 73  |de%......... las|
00002fc0  74 25 3d 63 73 76 5f 66  69 65 6c 64 5f 70 74 72  |t%=csv_field_ptr|
00002fd0  73 25 0d 13 10 0e 20 c8  95 20 21 6c 61 73 74 25  |s%.... .. !last%|
00002fe0  0d 13 1a 12 20 20 6c 61  73 74 25 3d 21 6c 61 73  |....  last%=!las|
00002ff0  74 25 0d 13 24 06 20 ce  0d 13 2e 11 20 21 6c 61  |t%..$. ..... !la|
00003000  73 74 25 3d 6e 6f 64 65  25 0d 13 38 05 cd 0d 13  |st%=node%..8....|
00003010  42 05 e1 0d 13 4c 1b dd  f2 61 64 64 5f 66 69 65  |B....L...add_fie|
00003020  6c 64 5f 6c 65 6e 28 69  6e 64 65 78 25 29 0d 13  |ld_len(index%)..|
00003030  56 11 ea 20 6e 6f 64 65  25 2c 6c 61 73 74 25 0d  |V.. node%,last%.|
00003040  13 60 1f 6e 6f 64 65 25  3d a4 68 65 61 70 5f 63  |.`.node%=.heap_c|
00003050  6c 61 69 6d 28 22 43 53  56 4c 22 2c 38 29 0d 13  |laim("CSVL",8)..|
00003060  6a 0d 6e 6f 64 65 25 21  30 3d 30 0d 13 74 12 6e  |j.node%!0=0..t.n|
00003070  6f 64 65 25 21 34 3d 69  6e 64 65 78 25 0d 13 7e  |ode%!4=index%..~|
00003080  19 e7 20 63 73 76 5f 66  69 65 6c 64 5f 6c 65 6e  |.. csv_field_len|
00003090  73 25 3d 30 20 8c 0d 13  88 1a 20 63 73 76 5f 66  |s%=0 ..... csv_f|
000030a0  69 65 6c 64 5f 6c 65 6e  73 25 3d 6e 6f 64 65 25  |ield_lens%=node%|
000030b0  0d 13 92 05 cc 0d 13 9c  1a 20 6c 61 73 74 25 3d  |......... last%=|
000030c0  63 73 76 5f 66 69 65 6c  64 5f 6c 65 6e 73 25 0d  |csv_field_lens%.|
000030d0  13 a6 0e 20 c8 95 20 21  6c 61 73 74 25 0d 13 b0  |... .. !last%...|
000030e0  12 20 20 6c 61 73 74 25  3d 21 6c 61 73 74 25 0d  |.  last%=!last%.|
000030f0  13 ba 06 20 ce 0d 13 c4  11 20 21 6c 61 73 74 25  |... ..... !last%|
00003100  3d 6e 6f 64 65 25 0d 13  ce 05 cd 0d 13 d8 05 e1  |=node%..........|
00003110  0d 13 e2 18 dd 20 a4 66  69 65 6c 64 5f 70 74 72  |..... .field_ptr|
00003120  28 69 6e 64 65 78 25 29  0d 13 ec 0b ea 20 6e 6f  |(index%)..... no|
00003130  64 65 25 0d 13 f6 19 6e  6f 64 65 25 3d 63 73 76  |de%....node%=csv|
00003140  5f 66 69 65 6c 64 5f 70  74 72 73 25 0d 14 00 0d  |_field_ptrs%....|
00003150  c8 95 20 69 6e 64 65 78  25 0d 14 0a 05 20 0d 14  |.. index%.... ..|
00003160  14 42 20 6e 6f 64 65 25  3d 21 6e 6f 64 65 25 3a  |.B node%=!node%:|
00003170  e7 6e 6f 64 65 25 3d 30  20 85 20 74 61 73 6b 5f  |.node%=0 . task_|
00003180  66 61 74 61 6c 25 2c 22  42 61 64 20 66 69 65 6c  |fatal%,"Bad fiel|
00003190  64 20 70 74 72 20 72 65  71 75 65 73 74 65 64 22  |d ptr requested"|
000031a0  0d 14 1e 0e 20 69 6e 64  65 78 25 2d 3d 31 0d 14  |.... index%-=1..|
000031b0  28 05 ce 0d 14 32 0c 3d  6e 6f 64 65 25 21 34 0d  |(....2.=node%!4.|
000031c0  14 3c 18 dd 20 a4 66 69  65 6c 64 5f 6c 65 6e 28  |.<.. .field_len(|
000031d0  69 6e 64 65 78 25 29 0d  14 46 0b ea 20 6e 6f 64  |index%)..F.. nod|
000031e0  65 25 0d 14 50 19 6e 6f  64 65 25 3d 63 73 76 5f  |e%..P.node%=csv_|
000031f0  66 69 65 6c 64 5f 6c 65  6e 73 25 0d 14 5a 0d c8  |field_lens%..Z..|
00003200  95 20 69 6e 64 65 78 25  0d 14 64 05 20 0d 14 6e  |. index%..d. ..n|
00003210  42 20 6e 6f 64 65 25 3d  21 6e 6f 64 65 25 3a e7  |B node%=!node%:.|
00003220  6e 6f 64 65 25 3d 30 20  85 20 74 61 73 6b 5f 66  |node%=0 . task_f|
00003230  61 74 61 6c 25 2c 22 42  61 64 20 66 69 65 6c 64  |atal%,"Bad field|
00003240  20 6c 65 6e 20 72 65 71  75 65 73 74 65 64 22 0d  | len requested".|
00003250  14 78 0e 20 69 6e 64 65  78 25 2d 3d 31 0d 14 82  |.x. index%-=1...|
00003260  05 ce 0d 14 8c 0c 3d 6e  6f 64 65 25 21 34 0d 14  |......=node%!4..|
00003270  96 21 dd 20 f2 73 65 6e  64 28 63 6f 6d 6d 61 6e  |.!. .send(comman|
00003280  64 24 2c 72 65 70 6c 79  74 6f 6b 65 6e 25 29 0d  |d$,replytoken%).|
00003290  14 a0 0b ea 20 69 25 2c  6d 24 0d 14 aa 16 e7 20  |.... i%,m$..... |
000032a0  64 6f 63 5f 66 69 6c 65  24 3d 22 22 20 8c 20 e1  |doc_file$="" . .|
000032b0  0d 14 b4 3f e7 20 72 65  70 6c 79 74 6f 6b 65 6e  |...?. replytoken|
000032c0  25 3c 3e 2d 31 20 69 25  3d 49 6d 70 75 6c 73 65  |%<>-1 i%=Impulse|
000032d0  5f 52 65 71 75 65 73 74  25 20 8b 20 69 25 3d 49  |_Request% . i%=I|
000032e0  6d 70 75 6c 73 65 5f 43  6f 6d 6d 61 6e 64 25 0d  |mpulse_Command%.|
000032f0  14 be 32 6d 24 3d 22 3a  22 2b a4 6d 73 67 5f 30  |..2m$=":"+.msg_0|
00003300  28 22 53 56 22 29 2b 22  2e 22 2b 64 6f 63 5f 66  |("SV")+"."+doc_f|
00003310  69 6c 65 24 2b 22 20 22  2b 63 6f 6d 6d 61 6e 64  |ile$+" "+command|
00003320  24 0d 14 c8 42 c8 99 22  49 6d 70 75 6c 73 65 5f  |$...B.."Impulse_|
00003330  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 69 25 2c  |SendMessage",i%,|
00003340  6d 24 2c 30 2c 30 2c 30  2c 72 65 70 6c 79 74 6f  |m$,0,0,0,replyto|
00003350  6b 65 6e 25 2c 74 61 73  6b 5f 68 61 6e 64 6c 65  |ken%,task_handle|
00003360  25 2c 30 0d 14 d2 05 e1  0d 14 dc 1d dd f2 64 69  |%,0...........di|
00003370  73 61 62 6c 65 5f 6d 65  72 67 69 6e 67 5f 62 75  |sable_merging_bu|
00003380  74 74 6f 6e 73 0d 14 e6  25 f2 69 63 6f 6e 5f 73  |ttons...%.icon_s|
00003390  68 61 64 65 28 6d 61 69  6e 25 2c 49 63 6f 6e 5f  |hade(main%,Icon_|
000033a0  50 72 69 6e 74 41 6c 6c  25 29 0d 14 f0 22 f2 69  |PrintAll%)...".i|
000033b0  63 6f 6e 5f 73 68 61 64  65 28 6d 61 69 6e 25 2c  |con_shade(main%,|
000033c0  49 63 6f 6e 5f 50 72 69  6e 74 25 29 0d 14 fa 21  |Icon_Print%)...!|
000033d0  f2 69 63 6f 6e 5f 73 68  61 64 65 28 6d 61 69 6e  |.icon_shade(main|
000033e0  25 2c 49 63 6f 6e 5f 4e  65 78 74 25 29 0d 15 04  |%,Icon_Next%)...|
000033f0  21 f2 69 63 6f 6e 5f 73  68 61 64 65 28 6d 61 69  |!.icon_shade(mai|
00003400  6e 25 2c 49 63 6f 6e 5f  45 64 69 74 25 29 0d 15  |n%,Icon_Edit%)..|
00003410  0e 05 e1 0d 15 18 1c dd  f2 65 6e 61 62 6c 65 5f  |.........enable_|
00003420  6d 65 72 67 69 6e 67 5f  62 75 74 74 6f 6e 73 0d  |merging_buttons.|
00003430  15 22 27 f2 69 63 6f 6e  5f 75 6e 73 68 61 64 65  |."'.icon_unshade|
00003440  28 6d 61 69 6e 25 2c 49  63 6f 6e 5f 50 72 69 6e  |(main%,Icon_Prin|
00003450  74 41 6c 6c 25 29 0d 15  2c 24 f2 69 63 6f 6e 5f  |tAll%)..,$.icon_|
00003460  75 6e 73 68 61 64 65 28  6d 61 69 6e 25 2c 49 63  |unshade(main%,Ic|
00003470  6f 6e 5f 50 72 69 6e 74  25 29 0d 15 36 23 f2 69  |on_Print%)..6#.i|
00003480  63 6f 6e 5f 75 6e 73 68  61 64 65 28 6d 61 69 6e  |con_unshade(main|
00003490  25 2c 49 63 6f 6e 5f 4e  65 78 74 25 29 0d 15 40  |%,Icon_Next%)..@|
000034a0  23 f2 69 63 6f 6e 5f 75  6e 73 68 61 64 65 28 6d  |#.icon_unshade(m|
000034b0  61 69 6e 25 2c 49 63 6f  6e 5f 45 64 69 74 25 29  |ain%,Icon_Edit%)|
000034c0  0d 15 4a 05 e1 0d 15 54  26 dd 20 f2 63 6f 6d 6d  |..J....T&. .comm|
000034d0  61 6e 64 28 74 6f 6b 65  6e 25 2c 70 61 72 61 6d  |and(token%,param|
000034e0  73 25 2c 6f 62 6a 65 63  74 25 29 0d 15 5e 0f c8  |s%,object%)..^..|
000034f0  8e 20 74 6f 6b 65 6e 25  20 ca 0d 15 68 13 20 20  |. token% ...h.  |
00003500  c9 20 54 5f 47 65 74 46  69 65 6c 64 25 0d 15 72  |. T_GetField%..r|
00003510  25 20 20 20 20 20 20 f2  67 65 74 5f 66 69 65 6c  |%      .get_fiel|
00003520  64 28 70 61 72 61 6d 73  25 2c 6f 62 6a 65 63 74  |d(params%,object|
00003530  25 29 0d 15 7c 19 20 20  20 20 20 20 66 69 65 6c  |%)..|.      fiel|
00003540  64 5f 63 6f 75 6e 74 25  2b 3d 31 0d 15 86 14 20  |d_count%+=1.... |
00003550  20 c9 20 54 5f 43 6c 6f  73 65 44 6f 77 6e 25 0d  | . T_CloseDown%.|
00003560  15 90 18 20 20 20 20 20  20 64 69 65 70 6c 65 61  |...      dieplea|
00003570  73 65 25 20 3d 20 b9 0d  15 9a 18 20 20 20 20 20  |se% = .....     |
00003580  20 f2 68 6f 73 74 5f 73  68 75 74 64 6f 77 6e 0d  | .host_shutdown.|
00003590  15 a4 05 cb 0d 15 ae 05  e1 0d 15 b8 21 dd 20 f2  |............!. .|
000035a0  67 65 74 5f 66 69 65 6c  64 28 70 61 72 61 6d 73  |get_field(params|
000035b0  25 2c 6f 62 6a 65 63 74  25 29 0d 15 c2 30 ea 20  |%,object%)...0. |
000035c0  66 69 65 6c 64 5f 69 6e  64 65 78 25 2c 20 66 69  |field_index%, fi|
000035d0  65 6c 64 5f 6e 61 6d 65  24 2c 20 70 74 72 25 2c  |eld_name$, ptr%,|
000035e0  20 66 69 6e 69 73 68 65  64 25 0d 15 cc 12 e7 20  | finished%..... |
000035f0  70 61 72 61 6d 73 25 3d  2d 31 20 e1 0d 15 d6 23  |params%=-1 ....#|
00003600  66 69 65 6c 64 5f 6e 61  6d 65 24 3d a4 74 61 73  |field_name$=.tas|
00003610  6b 5f 72 74 6f 7a 28 70  61 72 61 6d 73 25 29 0d  |k_rtoz(params%).|
00003620  15 e0 12 66 69 65 6c 64  5f 69 6e 64 65 78 25 3d  |...field_index%=|
00003630  30 0d 15 ea 16 70 74 72  25 3d 63 73 76 5f 68 65  |0....ptr%=csv_he|
00003640  61 64 69 6e 67 73 25 0d  15 f4 0f 66 69 6e 69 73  |adings%....finis|
00003650  68 65 64 25 3d a3 0d 15  fe 05 f5 0d 16 08 14 20  |hed%=.......... |
00003660  66 69 65 6c 64 5f 69 6e  64 65 78 25 2b 3d 31 0d  |field_index%+=1.|
00003670  16 12 1e 20 e7 20 24 28  70 74 72 25 2b 34 29 3d  |... . $(ptr%+4)=|
00003680  66 69 65 6c 64 5f 6e 61  6d 65 24 20 8c 0d 16 1c  |field_name$ ....|
00003690  11 20 20 66 69 6e 69 73  68 65 64 25 3d b9 0d 16  |.  finished%=...|
000036a0  26 06 20 cc 0d 16 30 10  20 20 70 74 72 25 3d 21  |&. ...0.  ptr%=!|
000036b0  70 74 72 25 0d 16 3a 2c  20 20 e7 20 70 74 72 25  |ptr%..:,  . ptr%|
000036c0  3d 30 20 8c 20 66 69 6e  69 73 68 65 64 25 3d b9  |=0 . finished%=.|
000036d0  3a 66 69 65 6c 64 5f 69  6e 64 65 78 25 3d 2d 31  |:field_index%=-1|
000036e0  0d 16 44 06 20 cd 0d 16  4e 10 20 20 e7 20 70 74  |..D. ...N.  . pt|
000036f0  72 25 3d 30 20 8c 0d 16  58 33 20 20 20 20 24 28  |r%=0 ...X3    $(|
00003700  65 72 72 6f 72 5f 62 75  66 66 25 2b 34 29 3d a4  |error_buff%+4)=.|
00003710  6d 73 67 5f 31 28 22 4f  4b 34 22 2c 20 66 69 65  |msg_1("OK4", fie|
00003720  6c 64 5f 6e 61 6d 65 24  29 0d 16 62 4a 20 20 20  |ld_name$)..bJ   |
00003730  20 c8 99 20 22 57 69 6d  70 5f 52 65 70 6f 72 74  | .. "Wimp_Report|
00003740  45 72 72 6f 72 22 2c 65  72 72 6f 72 5f 62 75 66  |Error",error_buf|
00003750  66 25 2c 25 31 30 30 30  31 2c a4 6d 73 67 5f 31  |f%,%10001,.msg_1|
00003760  28 22 4d 53 22 2c a4 6d  73 67 5f 30 28 22 49 44  |("MS",.msg_0("ID|
00003770  22 29 29 0d 16 6c 07 20  20 cd 0d 16 76 0f fd 20  |"))..l.  ...v.. |
00003780  66 69 6e 69 73 68 65 64  25 0d 16 80 30 e7 20 66  |finished%...0. f|
00003790  69 65 6c 64 5f 69 6e 64  65 78 25 3c 31 20 84 20  |ield_index%<1 . |
000037a0  66 69 65 6c 64 5f 69 6e  64 65 78 25 3e 63 73 76  |field_index%>csv|
000037b0  5f 63 6f 75 6e 74 25 20  8c 0d 16 8a 1d 20 20 f2  |_count% .....  .|
000037c0  74 72 61 6e 73 5f 72 65  70 6c 79 5f 62 6c 6f 63  |trans_reply_bloc|
000037d0  6b 28 30 2c 30 29 0d 16  94 05 cc 0d 16 9e 4f 20  |k(0,0)........O |
000037e0  20 f2 74 72 61 6e 73 5f  72 65 70 6c 79 5f 62 6c  | .trans_reply_bl|
000037f0  6f 63 6b 28 a4 66 69 65  6c 64 5f 70 74 72 28 66  |ock(.field_ptr(f|
00003800  69 65 6c 64 5f 69 6e 64  65 78 25 2d 31 29 2c a4  |ield_index%-1),.|
00003810  66 69 65 6c 64 5f 6c 65  6e 28 66 69 65 6c 64 5f  |field_len(field_|
00003820  69 6e 64 65 78 25 2d 31  29 29 0d 16 a8 05 cd 0d  |index%-1))......|
00003830  16 b2 05 e1 0d 16 bc 22  dd f2 74 72 61 6e 73 5f  |......."..trans_|
00003840  72 65 70 6c 79 5f 62 6c  6f 63 6b 28 70 74 72 25  |reply_block(ptr%|
00003850  2c 6c 65 6e 25 29 0d 16  c6 0c ea 20 64 75 6d 6d  |,len%)..... dumm|
00003860  79 25 0d 16 d0 0f 74 72  61 6e 73 6d 69 74 25 3d  |y%....transmit%=|
00003870  b9 0d 16 da 13 74 72 61  6e 73 6d 69 74 5f 70 74  |.....transmit_pt|
00003880  72 25 3d 30 0d 16 e4 38  e7 20 74 72 61 6e 73 6d  |r%=0...8. transm|
00003890  69 74 5f 62 6c 6f 63 6b  25 20 f2 68 65 61 70 5f  |it_block% .heap_|
000038a0  66 72 65 65 28 22 42 4c  43 4b 22 2c 74 72 61 6e  |free("BLCK",tran|
000038b0  73 6d 69 74 5f 62 6c 6f  63 6b 25 29 0d 16 ee 2e  |smit_block%)....|
000038c0  74 72 61 6e 73 6d 69 74  5f 62 6c 6f 63 6b 25 3d  |transmit_block%=|
000038d0  a4 68 65 61 70 5f 63 6c  61 69 6d 28 22 42 4c 43  |.heap_claim("BLC|
000038e0  4b 22 2c 6c 65 6e 25 2b  31 29 0d 16 f8 0e e7 20  |K",len%+1)..... |
000038f0  6c 65 6e 25 3e 30 20 8c  0d 17 02 14 20 20 f2 6f  |len%>0 .....  .o|
00003900  70 65 6e 5f 63 73 76 5f  66 69 6c 65 0d 17 0c 49  |pen_csv_file...I|
00003910  20 20 e7 20 63 73 76 5f  66 69 6c 65 5f 68 61 6e  |  . csv_file_han|
00003920  64 6c 65 25 3d 30 20 74  72 61 6e 73 6d 69 74 25  |dle%=0 transmit%|
00003930  3d a3 3a 85 20 74 61 73  6b 5f 6f 6b 25 2c a4 6d  |=.:. task_ok%,.m|
00003940  73 67 5f 32 28 22 4f 4b  32 22 2c 63 73 76 5f 66  |sg_2("OK2",csv_f|
00003950  69 6c 65 24 29 0d 17 16  1d 20 20 cf 23 63 73 76  |ile$)....  .#csv|
00003960  5f 66 69 6c 65 5f 68 61  6e 64 6c 65 25 3d 70 74  |_file_handle%=pt|
00003970  72 25 0d 17 20 30 20 20  f2 63 6f 70 79 5f 66 69  |r%.. 0  .copy_fi|
00003980  65 6c 64 28 74 72 61 6e  73 6d 69 74 5f 62 6c 6f  |eld(transmit_blo|
00003990  63 6b 25 2c 64 75 6d 6d  79 25 2c 6c 65 6e 25 2c  |ck%,dummy%,len%,|
000039a0  a3 29 0d 17 2a 15 20 20  f2 63 6c 6f 73 65 5f 63  |.)..*.  .close_c|
000039b0  73 76 5f 66 69 6c 65 0d  17 34 05 cc 0d 17 3e 19  |sv_file..4....>.|
000039c0  20 20 24 74 72 61 6e 73  6d 69 74 5f 62 6c 6f 63  |  $transmit_bloc|
000039d0  6b 25 3d 22 22 0d 17 48  05 cd 0d 17 52 1f 74 72  |k%=""..H....R.tr|
000039e0  61 6e 73 6d 69 74 5f 74  6f 70 25 3d 28 6c 65 6e  |ansmit_top%=(len|
000039f0  25 2b 31 2b 33 29 80 ac  33 0d 17 5c 17 74 72 61  |%+1+3)..3..\.tra|
00003a00  6e 73 6d 69 74 5f 73 69  7a 65 25 3d 6c 65 6e 25  |nsmit_size%=len%|
00003a10  0d 17 66 24 74 72 61 6e  73 6d 69 74 5f 74 61 67  |..f$transmit_tag|
00003a20  25 3d a4 6e 65 78 74 5f  74 72 61 6e 73 6d 69 74  |%=.next_transmit|
00003a30  5f 74 61 67 0d 17 70 73  c8 99 22 49 6d 70 75 6c  |_tag..ps.."Impul|
00003a40  73 65 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 2c  |se_SendMessage",|
00003a50  49 6d 70 75 6c 73 65 5f  52 65 70 6c 79 25 2c 22  |Impulse_Reply%,"|
00003a60  44 75 6d 6d 79 20 74 65  78 74 22 2c 2d 31 2c 2c  |Dummy text",-1,,|
00003a70  2c 74 72 61 6e 73 6d 69  74 5f 74 61 67 25 2c 74  |,transmit_tag%,t|
00003a80  61 73 6b 5f 68 61 6e 64  6c 65 25 2c 74 72 61 6e  |ask_handle%,tran|
00003a90  73 6d 69 74 5f 74 6f 70  25 2d 74 72 61 6e 73 6d  |smit_top%-transm|
00003aa0  69 74 5f 70 74 72 25 0d  17 7a 05 e1 0d 17 84 17  |it_ptr%..z......|
00003ab0  dd a4 6e 65 78 74 5f 74  72 61 6e 73 6d 69 74 5f  |..next_transmit_|
00003ac0  74 61 67 0d 17 8e 16 74  72 61 6e 73 6d 69 74 5f  |tag....transmit_|
00003ad0  63 6f 75 6e 74 25 2b 3d  31 0d 17 98 14 3d 74 72  |count%+=1....=tr|
00003ae0  61 6e 73 6d 69 74 5f 63  6f 75 6e 74 25 0d 17 a2  |ansmit_count%...|
00003af0  2b dd f2 73 65 6e 64 5f  64 61 74 61 28 74 6f 6b  |+..send_data(tok|
00003b00  65 6e 25 2c 62 75 66 66  65 72 25 2c 62 75 66 66  |en%,buffer%,buff|
00003b10  65 72 73 69 7a 65 25 29  0d 17 ac 0e ea 20 73 69  |ersize%)..... si|
00003b20  7a 65 25 2c 69 25 0d 17  b6 43 e7 ac 74 72 61 6e  |ze%,i%...C..tran|
00003b30  73 6d 69 74 25 20 84 20  28 74 6f 6b 65 6e 25 3c  |smit% . (token%<|
00003b40  3e 74 72 61 6e 73 6d 69  74 5f 74 61 67 25 29 20  |>transmit_tag%) |
00003b50  85 20 74 61 73 6b 5f 6f  6b 25 2c 20 a4 6d 73 67  |. task_ok%, .msg|
00003b60  5f 30 28 22 4f 4b 33 22  29 0d 17 c0 25 73 69 7a  |_0("OK3")...%siz|
00003b70  65 25 3d 74 72 61 6e 73  6d 69 74 5f 74 6f 70 25  |e%=transmit_top%|
00003b80  2d 74 72 61 6e 73 6d 69  74 5f 70 74 72 25 0d 17  |-transmit_ptr%..|
00003b90  ca 2d e7 20 73 69 7a 65  25 3c 62 75 66 66 65 72  |.-. size%<buffer|
00003ba0  73 69 7a 65 25 20 84 20  73 69 7a 65 25 3d 30 20  |size% . size%=0 |
00003bb0  74 72 61 6e 73 6d 69 74  25 3d a3 0d 17 d4 28 e7  |transmit%=....(.|
00003bc0  20 73 69 7a 65 25 3e 62  75 66 66 65 72 73 69 7a  | size%>buffersiz|
00003bd0  65 25 20 73 69 7a 65 3d  62 75 66 66 65 72 73 69  |e% size=buffersi|
00003be0  7a 65 25 0d 17 de 35 3f  28 74 72 61 6e 73 6d 69  |ze%...5?(transmi|
00003bf0  74 5f 70 74 72 25 2b 74  72 61 6e 73 6d 69 74 5f  |t_ptr%+transmit_|
00003c00  62 6c 6f 63 6b 25 2b 74  72 61 6e 73 6d 69 74 5f  |block%+transmit_|
00003c10  73 69 7a 65 25 29 3d 30  0d 17 e8 51 c8 99 22 49  |size%)=0...Q.."I|
00003c20  6d 70 75 6c 73 65 5f 54  72 61 6e 73 6d 69 74 44  |mpulse_TransmitD|
00003c30  61 74 61 22 2c 74 72 61  6e 73 6d 69 74 5f 70 74  |ata",transmit_pt|
00003c40  72 25 2b 74 72 61 6e 73  6d 69 74 5f 62 6c 6f 63  |r%+transmit_bloc|
00003c50  6b 25 2c 73 69 7a 65 25  2c 2c 2c 2c 2c 74 61 73  |k%,size%,,,,,tas|
00003c60  6b 5f 68 61 6e 64 6c 65  25 0d 17 f2 18 74 72 61  |k_handle%....tra|
00003c70  6e 73 6d 69 74 5f 70 74  72 25 2b 3d 73 69 7a 65  |nsmit_ptr%+=size|
00003c80  25 0d 17 fc 05 e1 0d 18  06 14 dd 20 f2 72 65 70  |%.......... .rep|
00003c90  6c 79 28 74 6f 6b 65 6e  25 29 0d 18 10 0f c8 8e  |ly(token%)......|
00003ca0  20 74 6f 6b 65 6e 25 20  ca 0d 18 1a 1e 20 20 c9  | token% .....  .|
00003cb0  20 54 5f 50 72 69 6e 74  25 3a 20 f2 72 65 70 6c  | T_Print%: .repl|
00003cc0  79 5f 70 72 69 6e 74 0d  18 24 1d 20 20 c9 20 54  |y_print..$.  . T|
00003cd0  5f 4d 65 72 67 65 25 3a  20 f2 6d 65 72 67 65 5f  |_Merge%: .merge_|
00003ce0  64 6f 6e 65 0d 18 2e 05  cb 0d 18 38 05 e1 0d 18  |done.......8....|
00003cf0  42 11 dd 20 f2 6d 65 72  67 65 5f 64 6f 6e 65 0d  |B.. .merge_done.|
00003d00  18 4c 12 e7 72 65 63 5f  64 6f 6e 65 25 3d 30 20  |.L..rec_done%=0 |
00003d10  8c 0d 18 56 17 20 20 e7  66 69 65 6c 64 5f 63 6f  |...V.  .field_co|
00003d20  75 6e 74 25 3d 30 20 8c  0d 18 60 1b 20 20 20 20  |unt%=0 ...`.    |
00003d30  f2 73 65 6e 64 28 22 45  64 69 74 20 4f 6e 22 2c  |.send("Edit On",|
00003d40  2d 31 29 0d 18 6a 32 20  20 20 20 63 73 76 5f 66  |-1)..j2    csv_f|
00003d50  69 6c 65 5f 70 74 72 25  3d 70 72 65 73 65 72 76  |ile_ptr%=preserv|
00003d60  65 64 5f 73 74 61 72 74  5f 6f 66 5f 64 61 74 61  |ed_start_of_data|
00003d70  5f 70 74 72 25 0d 18 74  10 20 20 20 20 6d 65 72  |_ptr%..t.    mer|
00003d80  67 65 25 3d a3 0d 18 7e  21 20 20 20 20 85 20 74  |ge%=...~!    . t|
00003d90  61 73 6b 5f 6f 6b 25 2c  20 a4 6d 73 67 5f 30 28  |ask_ok%, .msg_0(|
00003da0  22 4f 4b 37 22 29 0d 18  88 07 20 20 cd 0d 18 92  |"OK7")....  ....|
00003db0  30 20 20 f2 69 63 6f 6e  5f 77 72 69 74 65 28 6d  |0  .icon_write(m|
00003dc0  61 69 6e 25 2c 49 63 6f  6e 5f 54 6f 47 6f 25 2c  |ain%,Icon_ToGo%,|
00003dd0  c3 28 72 65 63 5f 74 6f  67 6f 25 29 29 0d 18 9c  |.(rec_togo%))...|
00003de0  27 20 20 f2 69 63 6f 6e  5f 77 72 69 74 65 28 6d  |'  .icon_write(m|
00003df0  61 69 6e 25 2c 49 63 6f  6e 5f 44 6f 6e 65 25 2c  |ain%,Icon_Done%,|
00003e00  22 31 22 29 0d 18 a6 26  20 20 f2 69 63 6f 6e 5f  |"1")...&  .icon_|
00003e10  75 6e 68 69 64 65 28 6d  61 69 6e 25 2c 49 63 6f  |unhide(main%,Ico|
00003e20  6e 5f 54 6f 50 72 6f 63  25 29 0d 18 b0 28 20 20  |n_ToProc%)...(  |
00003e30  f2 69 63 6f 6e 5f 75 6e  68 69 64 65 28 6d 61 69  |.icon_unhide(mai|
00003e40  6e 25 2c 49 63 6f 6e 5f  52 65 63 73 50 72 6f 63  |n%,Icon_RecsProc|
00003e50  25 29 0d 18 ba 28 20 20  f2 69 63 6f 6e 5f 75 6e  |%)...(  .icon_un|
00003e60  68 69 64 65 28 6d 61 69  6e 25 2c 49 63 6f 6e 5f  |hide(main%,Icon_|
00003e70  50 72 69 6e 74 41 6c 6c  25 29 0d 18 c4 24 20 20  |PrintAll%)...$  |
00003e80  f2 69 63 6f 6e 5f 75 6e  68 69 64 65 28 6d 61 69  |.icon_unhide(mai|
00003e90  6e 25 2c 49 63 6f 6e 5f  54 6f 47 6f 25 29 0d 18  |n%,Icon_ToGo%)..|
00003ea0  ce 24 20 20 f2 69 63 6f  6e 5f 75 6e 68 69 64 65  |.$  .icon_unhide|
00003eb0  28 6d 61 69 6e 25 2c 49  63 6f 6e 5f 44 6f 6e 65  |(main%,Icon_Done|
00003ec0  25 29 0d 18 d8 25 20 20  f2 69 63 6f 6e 5f 75 6e  |%)...%  .icon_un|
00003ed0  68 69 64 65 28 6d 61 69  6e 25 2c 49 63 6f 6e 5f  |hide(main%,Icon_|
00003ee0  50 72 69 6e 74 25 29 0d  18 e2 24 20 20 f2 69 63  |Print%)...$  .ic|
00003ef0  6f 6e 5f 75 6e 68 69 64  65 28 6d 61 69 6e 25 2c  |on_unhide(main%,|
00003f00  49 63 6f 6e 5f 4e 65 78  74 25 29 0d 18 ec 24 20  |Icon_Next%)...$ |
00003f10  20 f2 69 63 6f 6e 5f 75  6e 68 69 64 65 28 6d 61  | .icon_unhide(ma|
00003f20  69 6e 25 2c 49 63 6f 6e  5f 45 64 69 74 25 29 0d  |in%,Icon_Edit%).|
00003f30  18 f6 26 20 20 f2 69 63  6f 6e 5f 68 69 64 65 28  |..&  .icon_hide(|
00003f40  6d 61 69 6e 25 2c 49 63  6f 6e 5f 48 65 61 64 69  |main%,Icon_Headi|
00003f50  6e 67 73 25 29 0d 19 00  26 20 20 f2 69 63 6f 6e  |ngs%)...&  .icon|
00003f60  5f 68 69 64 65 28 6d 61  69 6e 25 2c 49 63 6f 6e  |_hide(main%,Icon|
00003f70  5f 44 69 73 70 48 65 61  64 25 29 0d 19 0a 28 20  |_DispHead%)...( |
00003f80  20 f2 69 63 6f 6e 5f 68  69 64 65 28 6d 61 69 6e  | .icon_hide(main|
00003f90  25 2c 49 63 6f 6e 5f 53  74 61 72 74 4d 65 72 67  |%,Icon_StartMerg|
00003fa0  65 25 29 0d 19 14 39 20  20 21 77 69 6e 5f 62 75  |e%)...9  !win_bu|
00003fb0  66 66 25 3d 6d 61 69 6e  25 3a c8 99 22 57 69 6d  |ff%=main%:.."Wim|
00003fc0  70 5f 47 65 74 57 69 6e  64 6f 77 53 74 61 74 65  |p_GetWindowState|
00003fd0  22 2c 2c 77 69 6e 5f 62  75 66 66 25 0d 19 1e 2c  |",,win_buff%...,|
00003fe0  20 20 77 69 6e 5f 62 75  66 66 25 21 38 3d 77 69  |  win_buff%!8=wi|
00003ff0  6e 5f 62 75 66 66 25 21  31 36 20 2d 20 57 69 6e  |n_buff%!16 - Win|
00004000  64 6f 77 5f 42 69 67 25  0d 19 28 24 20 20 c8 99  |dow_Big%..($  ..|
00004010  22 57 69 6d 70 5f 4f 70  65 6e 57 69 6e 64 6f 77  |"Wimp_OpenWindow|
00004020  22 2c 2c 77 69 6e 5f 62  75 66 66 25 0d 19 32 05  |",,win_buff%..2.|
00004030  cd 0d 19 3c 10 f2 64 6f  6e 65 5f 72 65 63 6f 72  |...<..done_recor|
00004040  64 0d 19 46 1b f2 65 6e  61 62 6c 65 5f 6d 65 72  |d..F..enable_mer|
00004050  67 69 6e 67 5f 62 75 74  74 6f 6e 73 0d 19 50 12  |ging_buttons..P.|
00004060  f2 68 6f 75 72 67 6c 61  73 73 5f 6f 66 66 0d 19  |.hourglass_off..|
00004070  5a 05 e1 0d 19 64 11 dd  f2 64 6f 6e 65 5f 72 65  |Z....d...done_re|
00004080  63 6f 72 64 0d 19 6e 10  72 65 63 5f 74 6f 67 6f  |cord..n.rec_togo|
00004090  25 2d 3d 31 0d 19 78 10  72 65 63 5f 64 6f 6e 65  |%-=1..x.rec_done|
000040a0  25 2b 3d 31 0d 19 82 2e  f2 69 63 6f 6e 5f 77 72  |%+=1.....icon_wr|
000040b0  69 74 65 28 6d 61 69 6e  25 2c 49 63 6f 6e 5f 54  |ite(main%,Icon_T|
000040c0  6f 47 6f 25 2c c3 28 72  65 63 5f 74 6f 67 6f 25  |oGo%,.(rec_togo%|
000040d0  29 29 0d 19 8c 2e f2 69  63 6f 6e 5f 77 72 69 74  |)).....icon_writ|
000040e0  65 28 6d 61 69 6e 25 2c  49 63 6f 6e 5f 44 6f 6e  |e(main%,Icon_Don|
000040f0  65 25 2c c3 28 72 65 63  5f 64 6f 6e 65 25 29 29  |e%,.(rec_done%))|
00004100  0d 19 96 05 e1 0d 19 a0  11 dd f2 72 65 70 6c 79  |...........reply|
00004110  5f 70 72 69 6e 74 0d 19  aa 0e ea 20 63 6f 6d 6d  |_print..... comm|
00004120  61 6e 64 24 0d 19 b4 28  20 20 63 6f 6d 6d 61 6e  |and$...(  comman|
00004130  64 24 3d a4 74 61 73 6b  5f 72 74 6f 7a 28 74 61  |d$=.task_rtoz(ta|
00004140  73 6b 5f 62 75 66 66 25  2b 33 36 29 0d 19 be 13  |sk_buff%+36)....|
00004150  20 20 c8 8e 20 63 6f 6d  6d 61 6e 64 24 20 ca 0d  |  .. command$ ..|
00004160  19 c8 23 20 20 20 20 c9  20 22 50 72 69 6e 74 44  |..#    . "PrintD|
00004170  6f 6e 65 22 20 3a 20 f2  70 72 69 6e 74 5f 64 6f  |one" : .print_do|
00004180  6e 65 0d 19 d2 24 20 20  20 20 c9 20 22 50 72 69  |ne...$    . "Pri|
00004190  6e 74 45 72 72 6f 72 22  3a 20 f2 70 72 69 6e 74  |ntError": .print|
000041a0  5f 65 72 72 6f 72 0d 19  dc 07 20 20 cb 0d 19 e6  |_error....  ....|
000041b0  05 e1 0d 19 f0 11 dd f2  70 72 69 6e 74 5f 65 72  |........print_er|
000041c0  72 6f 72 0d 19 fa 11 20  20 70 72 69 6e 74 69 6e  |ror....  printin|
000041d0  67 25 3d a3 0d 1a 04 16  20 20 67 6f 74 70 72 69  |g%=.....  gotpri|
000041e0  6e 74 72 65 70 6c 79 25  3d a3 0d 1a 0e 24 20 20  |ntreply%=....$  |
000041f0  24 28 65 72 72 6f 72 5f  62 75 66 66 25 2b 34 29  |$(error_buff%+4)|
00004200  3d a4 6d 73 67 5f 30 28  22 4f 4b 39 22 29 0d 1a  |=.msg_0("OK9")..|
00004210  18 4b 20 20 c8 99 20 22  57 69 6d 70 5f 52 65 70  |.K  .. "Wimp_Rep|
00004220  6f 72 74 45 72 72 6f 72  22 2c 20 65 72 72 6f 72  |ortError", error|
00004230  5f 62 75 66 66 25 2c 20  25 31 30 30 30 31 2c 20  |_buff%, %10001, |
00004240  a4 6d 73 67 5f 31 28 22  4d 53 22 2c a4 6d 73 67  |.msg_1("MS",.msg|
00004250  5f 30 28 22 49 44 22 29  29 0d 1a 22 26 20 20 e7  |_0("ID")).."&  .|
00004260  70 65 6e 64 69 6e 67 5f  63 6c 6f 73 65 25 20 8c  |pending_close% .|
00004270  20 f2 68 6f 73 74 5f 73  68 75 74 64 6f 77 6e 0d  | .host_shutdown.|
00004280  1a 2c 1d 20 20 f2 65 6e  61 62 6c 65 5f 6d 65 72  |.,.  .enable_mer|
00004290  67 69 6e 67 5f 62 75 74  74 6f 6e 73 0d 1a 36 29  |ging_buttons..6)|
000042a0  20 20 f2 69 63 6f 6e 5f  75 6e 68 69 64 65 28 6d  |  .icon_unhide(m|
000042b0  61 69 6e 25 2c 20 49 63  6f 6e 5f 50 72 69 6e 74  |ain%, Icon_Print|
000042c0  41 6c 6c 25 29 0d 1a 40  05 e1 0d 1a 4a 10 dd f2  |All%)..@....J...|
000042d0  70 72 69 6e 74 5f 64 6f  6e 65 0d 1a 54 0f 70 72  |print_done..T.pr|
000042e0  69 6e 74 69 6e 67 25 3d  a3 0d 1a 5e 15 e7 70 65  |inting%=...^..pe|
000042f0  6e 64 69 6e 67 5f 63 6c  6f 73 65 25 20 8c 0d 1a  |nding_close% ...|
00004300  68 1a 20 20 20 20 20 20  20 20 f2 68 6f 73 74 5f  |h.        .host_|
00004310  73 68 75 74 64 6f 77 6e  0d 1a 72 05 cc 0d 1a 7c  |shutdown..r....||
00004320  2e 20 20 20 20 20 20 20  20 e7 a4 69 63 6f 6e 5f  |.        ..icon_|
00004330  73 65 74 28 6d 61 69 6e  25 2c 49 63 6f 6e 5f 50  |set(main%,Icon_P|
00004340  72 69 6e 74 41 6c 6c 25  29 20 8c 0d 1a 86 14 20  |rintAll%) ..... |
00004350  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 0d  |               .|
00004360  1a 90 26 20 20 20 20 20  20 20 20 20 20 20 20 20  |..&             |
00004370  20 20 20 f2 6d 65 72 67  65 5f 6e 65 78 74 5f 72  |   .merge_next_r|
00004380  65 63 6f 72 64 0d 1a 9a  14 20 20 20 20 20 20 20  |ecord....       |
00004390  20 20 20 20 20 20 20 20  20 0d 1a a4 14 20 20 20  |         ....   |
000043a0  20 20 20 20 20 20 20 20  20 20 20 20 20 0d 1a ae  |             ...|
000043b0  14 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000043c0  20 0d 1a b8 0c 20 20 20  20 20 20 20 20 0d 1a c2  | ....        ...|
000043d0  14 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000043e0  20 0d 1a cc 24 20 20 20  20 20 20 20 20 20 20 20  | ...$           |
000043f0  20 20 20 20 20 67 6f 74  70 72 69 6e 74 72 65 70  |     gotprintrep|
00004400  6c 79 25 3d b9 0d 1a d6  14 20 20 20 20 20 20 20  |ly%=.....       |
00004410  20 20 20 20 20 20 20 20  20 0d 1a e0 1f 20 20 20  |         ....   |
00004420  20 20 20 20 20 20 20 20  20 20 20 20 20 70 72 69  |             pri|
00004430  6e 74 69 6e 67 25 3d b9  0d 1a ea 0d 20 20 20 20  |nting%=.....    |
00004440  20 20 20 20 cc 0d 1a f4  2b 20 20 20 20 20 20 20  |    ....+       |
00004450  20 20 20 20 20 20 20 20  20 f2 65 6e 61 62 6c 65  |         .enable|
00004460  5f 6d 65 72 67 69 6e 67  5f 62 75 74 74 6f 6e 73  |_merging_buttons|
00004470  0d 1a fe 0d 20 20 20 20  20 20 20 20 cd 0d 1b 08  |....        ....|
00004480  05 cd 0d 1b 12 05 e1 0d  1b 1c 16 dd f2 65 72 72  |.............err|
00004490  6f 72 5f 69 6e 69 74 69  61 6c 69 73 65 0d 1b 26  |or_initialise..&|
000044a0  15 de 20 65 72 72 6f 72  5f 62 75 66 66 25 20 32  |.. error_buff% 2|
000044b0  35 36 0d 1b 30 05 e1 0d  1b 3a 0b dd f2 65 72 72  |56..0....:...err|
000044c0  6f 72 0d 1b 44 0b ea 20  72 24 2c 72 25 0d 1b 4e  |or..D.. r$,r%..N|
000044d0  09 72 24 3d f6 24 0d 1b  58 21 e7 9f 3d 74 61 73  |.r$=.$..X!..=tas|
000044e0  6b 5f 6f 6b 25 20 84 20  9f 3d 74 61 73 6b 5f 66  |k_ok% . .=task_f|
000044f0  61 74 61 6c 25 20 8c 0d  1b 62 1f 20 72 25 3d a7  |atal% ...b. r%=.|
00004500  72 24 2c 22 69 6e 20 22  2b bd 43 68 61 72 5f 51  |r$,"in "+.Char_Q|
00004510  75 6f 74 65 25 29 0d 1b  6c 18 20 e7 72 25 3c 3e  |uote%)..l. .r%<>|
00004520  30 20 72 24 3d c0 72 24  2c 72 25 2d 31 29 0d 1b  |0 r$=.r$,r%-1)..|
00004530  76 05 cd 0d 1b 80 0a c8  8e 20 9f 20 ca 0d 1b 8a  |v........ . ....|
00004540  23 c9 20 20 20 20 74 61  73 6b 5f 6f 6b 25 3a 20  |#.    task_ok%: |
00004550  f2 65 72 72 6f 72 5f 62  6f 78 28 72 24 2c 31 29  |.error_box(r$,1)|
00004560  0d 1b 94 23 c9 20 74 61  73 6b 5f 66 61 74 61 6c  |...#. task_fatal|
00004570  25 3a 20 f2 65 72 72 6f  72 5f 62 6f 78 28 72 24  |%: .error_box(r$|
00004580  2c 32 29 0d 1b 9e 4c 20  20 20 20 20 20 20 7f 3a  |,2)...L       .:|
00004590  20 f2 65 72 72 6f 72 5f  62 6f 78 28 22 55 6e 65  | .error_box("Une|
000045a0  78 70 65 63 74 65 64 20  65 72 72 6f 72 20 3a 2d  |xpected error :-|
000045b0  20 22 2b 72 24 2b 22 20  28 22 2b c3 28 9f 29 2b  | "+r$+" ("+.(.)+|
000045c0  22 2f 22 2b c3 28 9e 29  2b 22 29 22 2c 33 29 0d  |"/"+.(.)+")",3).|
000045d0  1b a8 05 cb 0d 1b b2 05  e1 0d 1b bc 1f dd f2 65  |...............e|
000045e0  72 72 6f 72 5f 62 6f 78  28 72 24 2c 65 72 72 6f  |rror_box(r$,erro|
000045f0  72 5f 66 6c 61 67 25 29  0d 1b c6 08 ea 20 72 25  |r_flag%)..... r%|
00004600  0d 1b d0 1b c8 99 22 57  69 6d 70 5f 43 72 65 61  |......"Wimp_Crea|
00004610  74 65 4d 65 6e 75 22 2c  2c 2d 31 0d 1b da 29 21  |teMenu",,-1...)!|
00004620  65 72 72 6f 72 5f 62 75  66 66 25 3d 9f 3a 24 28  |error_buff%=.:$(|
00004630  65 72 72 6f 72 5f 62 75  66 66 25 2b 34 29 3d 72  |error_buff%+4)=r|
00004640  24 2b bd 30 0d 1b e4 3f  c8 99 22 57 69 6d 70 5f  |$+.0...?.."Wimp_|
00004650  52 65 70 6f 72 74 45 72  72 6f 72 22 2c 65 72 72  |ReportError",err|
00004660  6f 72 5f 62 75 66 66 25  2c 65 72 72 6f 72 5f 66  |or_buff%,error_f|
00004670  6c 61 67 25 2c 74 61 73  6b 5f 69 64 24 20 b8 20  |lag%,task_id$ . |
00004680  2c 72 25 0d 1b ee 20 e7  72 25 3d 32 20 ee 20 85  |,r%... .r%=2 . .|
00004690  20 87 3a f2 68 6f 73 74  5f 73 68 75 74 64 6f 77  | .:.host_shutdow|
000046a0  6e 3a e0 0d 1b f8 05 e1  0d 1c 02 1e dd f2 68 65  |n:............he|
000046b0  61 70 5f 66 72 65 65 28  69 64 65 6e 74 24 2c 62  |ap_free(ident$,b|
000046c0  6c 6f 63 6b 25 29 0d 1c  0c 0c ea 20 72 30 25 2c  |lock%)..... r0%,|
000046d0  66 25 0d 1c 16 10 e7 62  6c 6f 63 6b 25 3c 3e 30  |f%.....block%<>0|
000046e0  20 8c 0d 1c 20 0e 20 62  6c 6f 63 6b 25 2d 3d 34  | ... . block%-=4|
000046f0  0d 1c 2a 05 20 0d 1c 34  56 20 e7 21 62 6c 6f 63  |..*. ..4V .!bloc|
00004700  6b 25 3c 3e a4 68 65 61  70 5f 69 64 65 6e 74 5f  |k%<>.heap_ident_|
00004710  6e 75 6d 28 69 64 65 6e  74 24 29 20 85 20 74 61  |num(ident$) . ta|
00004720  73 6b 5f 6f 6b 25 2c 22  43 6f 72 72 75 70 74 20  |sk_ok%,"Corrupt |
00004730  22 2b 69 64 65 6e 74 24  2b 22 20 62 6c 6f 63 6b  |"+ident$+" block|
00004740  20 6e 6f 74 20 66 72 65  65 64 22 0d 1c 3e 2f 20  | not freed"..>/ |
00004750  c8 99 22 58 4f 53 5f 48  65 61 70 22 2c 33 2c 68  |.."XOS_Heap",3,h|
00004760  65 61 70 5f 73 74 61 72  74 25 2c 62 6c 6f 63 6b  |eap_start%,block|
00004770  25 20 b8 20 72 30 25 3b  66 25 0d 1c 48 43 20 e7  |% . r0%;f%..HC .|
00004780  28 66 25 20 80 20 31 29  20 85 20 74 61 73 6b 5f  |(f% . 1) . task_|
00004790  66 61 74 61 6c 25 2c 22  42 6c 6f 63 6b 20 22 2b  |fatal%,"Block "+|
000047a0  69 64 65 6e 74 24 2b 22  3a 20 22 2b a4 74 61 73  |ident$+": "+.tas|
000047b0  6b 5f 72 74 6f 7a 28 72  30 25 2b 34 29 0d 1c 52  |k_rtoz(r0%+4)..R|
000047c0  05 cd 0d 1c 5c 05 e1 0d  1c 66 1e dd a4 68 65 61  |....\....f...hea|
000047d0  70 5f 63 6c 61 69 6d 28  69 64 65 6e 74 24 2c 73  |p_claim(ident$,s|
000047e0  69 7a 65 25 29 0d 1c 70  08 ea 20 70 25 0d 1c 7a  |ize%)..p.. p%..z|
000047f0  0c 73 69 7a 65 25 2b 3d  34 0d 1c 84 2e c8 95 20  |.size%+=4...... |
00004800  73 69 7a 65 25 3e 3d a4  68 65 61 70 5f 66 72 65  |size%>=.heap_fre|
00004810  65 73 70 61 63 65 20 f2  68 65 61 70 5f 69 6e 63  |espace .heap_inc|
00004820  72 65 61 73 65 3a ce 0d  1c 8e 2b c8 99 22 4f 53  |rease:....+.."OS|
00004830  5f 48 65 61 70 22 2c 32  2c 68 65 61 70 5f 73 74  |_Heap",2,heap_st|
00004840  61 72 74 25 2c 2c 73 69  7a 65 25 20 b8 20 2c 2c  |art%,,size% . ,,|
00004850  70 25 0d 1c 98 1f 21 70  25 3d a4 68 65 61 70 5f  |p%....!p%=.heap_|
00004860  69 64 65 6e 74 5f 6e 75  6d 28 69 64 65 6e 74 24  |ident_num(ident$|
00004870  29 0d 1c a2 09 70 25 2b  3d 34 0d 1c ac 07 3d 70  |)....p%+=4....=p|
00004880  25 0d 1c b6 13 dd f2 68  65 61 70 5f 69 6e 63 72  |%......heap_incr|
00004890  65 61 73 65 0d 1c c0 0b  ea 20 73 6c 6f 74 25 0d  |ease..... slot%.|
000048a0  1c ca 23 c8 99 22 57 69  6d 70 5f 53 6c 6f 74 53  |..#.."Wimp_SlotS|
000048b0  69 7a 65 22 2c 2d 31 2c  2d 31 20 b8 20 73 6c 6f  |ize",-1,-1 . slo|
000048c0  74 25 0d 1c d4 2a c8 99  22 57 69 6d 70 5f 53 6c  |t%...*.."Wimp_Sl|
000048d0  6f 74 53 69 7a 65 22 2c  73 6c 6f 74 25 2b 68 65  |otSize",slot%+he|
000048e0  61 70 5f 70 73 69 7a 65  25 2c 2d 31 0d 1c de 13  |ap_psize%,-1....|
000048f0  e7 68 65 61 70 5f 73 69  7a 65 25 3d 30 20 8c 0d  |.heap_size%=0 ..|
00004900  1c e8 2b 20 c8 99 22 4f  53 5f 48 65 61 70 22 2c  |..+ .."OS_Heap",|
00004910  30 2c 68 65 61 70 5f 73  74 61 72 74 25 2c 2c 68  |0,heap_start%,,h|
00004920  65 61 70 5f 70 73 69 7a  65 25 0d 1c f2 05 cc 0d  |eap_psize%......|
00004930  1c fc 2b 20 c8 99 22 4f  53 5f 48 65 61 70 22 2c  |..+ .."OS_Heap",|
00004940  35 2c 68 65 61 70 5f 73  74 61 72 74 25 2c 2c 68  |5,heap_start%,,h|
00004950  65 61 70 5f 70 73 69 7a  65 25 0d 1d 06 05 cd 0d  |eap_psize%......|
00004960  1d 10 1b 68 65 61 70 5f  73 69 7a 65 25 2b 3d 68  |...heap_size%+=h|
00004970  65 61 70 5f 70 73 69 7a  65 25 0d 1d 1a 05 e1 0d  |eap_psize%......|
00004980  1d 24 18 dd a4 68 65 61  70 5f 69 64 65 6e 74 5f  |.$...heap_ident_|
00004990  6e 75 6d 28 76 24 29 0d  1d 2e 0b ea 20 69 25 2c  |num(v$)..... i%,|
000049a0  6a 25 0d 1d 38 0d e3 69  25 3d 30 20 b8 20 33 0d  |j%..8..i%=0 . 3.|
000049b0  1d 42 23 20 6a 25 3d 6a  25 20 84 20 97 28 c1 76  |.B# j%=j% . .(.v|
000049c0  24 2c 69 25 2b 31 2c 31  29 29 3c 3c 28 69 25 2a  |$,i%+1,1))<<(i%*|
000049d0  38 29 0d 1d 4c 05 ed 0d  1d 56 07 3d 6a 25 0d 1d  |8)..L....V.=j%..|
000049e0  60 14 dd a4 68 65 61 70  5f 66 72 65 65 73 70 61  |`...heap_freespa|
000049f0  63 65 0d 1d 6a 08 ea 20  66 25 0d 1d 74 16 e7 68  |ce..j.. f%..t..h|
00004a00  65 61 70 5f 73 69 7a 65  25 3d 30 20 8c 20 3d 30  |eap_size%=0 . =0|
00004a10  0d 1d 7e 24 c8 99 22 4f  53 5f 48 65 61 70 22 2c  |..~$.."OS_Heap",|
00004a20  31 2c 68 65 61 70 5f 73  74 61 72 74 25 20 b8 20  |1,heap_start% . |
00004a30  2c 2c 66 25 0d 1d 88 07  3d 66 25 0d 1d 92 14 dd  |,,f%....=f%.....|
00004a40  f2 77 69 6e 5f 69 6e 69  74 69 61 6c 69 73 65 0d  |.win_initialise.|
00004a50  1d 9c 14 de 20 77 69 6e  5f 62 75 66 66 25 20 32  |.... win_buff% 2|
00004a60  30 34 38 0d 1d a6 14 77  69 6e 5f 74 65 6d 70 6c  |048....win_templ|
00004a70  61 74 65 24 3d 22 22 0d  1d b0 05 e1 0d 1d ba 33  |ate$=""........3|
00004a80  dd f2 77 69 6e 5f 6c 6f  61 64 5f 63 72 65 61 74  |..win_load_creat|
00004a90  65 28 66 24 2c 6e 24 2c  73 70 72 69 74 65 5f 70  |e(f$,n$,sprite_p|
00004aa0  6f 6f 6c 25 2c f8 20 68  61 6e 64 6c 65 25 29 0d  |ool%,. handle%).|
00004ab0  1d c4 23 f2 77 69 6e 5f  6c 6f 61 64 28 66 24 2c  |..#.win_load(f$,|
00004ac0  6e 24 2c 77 69 6e 5f 62  75 66 66 25 2c 32 30 34  |n$,win_buff%,204|
00004ad0  38 29 0d 1d ce 1d 77 69  6e 5f 62 75 66 66 25 21  |8)....win_buff%!|
00004ae0  36 34 3d 73 70 72 69 74  65 5f 70 6f 6f 6c 25 0d  |64=sprite_pool%.|
00004af0  1d d8 22 f2 77 69 6e 5f  63 72 65 61 74 65 28 77  |..".win_create(w|
00004b00  69 6e 5f 62 75 66 66 25  2c 68 61 6e 64 6c 65 25  |in_buff%,handle%|
00004b10  29 0d 1d e2 05 e1 0d 1d  ec 21 dd f2 77 69 6e 5f  |)........!..win_|
00004b20  6c 6f 61 64 28 66 24 2c  6e 24 2c 62 75 66 25 2c  |load(f$,n$,buf%,|
00004b30  6c 69 6d 69 74 25 29 0d  1d f6 0d ea 20 77 73 5f  |limit%)..... ws_|
00004b40  62 75 66 25 0d 1e 00 0b  ea 20 73 69 7a 65 25 0d  |buf%..... size%.|
00004b50  1e 0a 0b ea 20 64 61 74  61 25 0d 1e 14 0c ea 20  |.... data%..... |
00004b60  66 6f 75 6e 64 25 0d 1e  1e 0b ea 20 73 25 2c 66  |found%..... s%,f|
00004b70  25 0d 1e 28 0d e7 66 24  3c 3e 22 22 20 8c 0d 1e  |%..(..f$<>"" ...|
00004b80  32 22 20 f2 77 69 6e 5f  73 69 7a 65 73 28 66 24  |2" .win_sizes(f$|
00004b90  2c 6e 24 2c 73 69 7a 65  25 2c 64 61 74 61 25 29  |,n$,size%,data%)|
00004ba0  0d 1e 3c 05 cc 0d 1e 46  2d 20 f2 77 69 6e 5f 73  |..<....F- .win_s|
00004bb0  69 7a 65 73 28 77 69 6e  5f 74 65 6d 70 6c 61 74  |izes(win_templat|
00004bc0  65 24 2c 6e 24 2c 73 69  7a 65 25 2c 64 61 74 61  |e$,n$,size%,data|
00004bd0  25 29 0d 1e 50 05 cd 0d  1e 5a 76 e7 6c 69 6d 69  |%)..P....Zv.limi|
00004be0  74 25 3c 28 73 69 7a 65  25 2b 64 61 74 61 25 29  |t%<(size%+data%)|
00004bf0  20 85 20 74 61 73 6b 5f  6f 6b 25 2c 22 42 75 66  | . task_ok%,"Buf|
00004c00  66 65 72 20 6e 6f 74 20  62 69 67 20 65 6e 6f 75  |fer not big enou|
00004c10  67 68 20 66 6f 72 20 27  22 2b 6e 24 2b 22 27 20  |gh for '"+n$+"' |
00004c20  2d 20 22 2b c3 28 73 69  7a 65 25 29 2b 22 20 2b  |- "+.(size%)+" +|
00004c30  20 22 2b c3 28 64 61 74  61 25 29 2b 22 20 62 79  | "+.(data%)+" by|
00004c40  74 65 73 20 72 65 71 75  69 72 65 64 22 0d 1e 64  |tes required"..d|
00004c50  25 e7 66 24 3c 3e 22 22  20 c8 99 22 57 69 6d 70  |%.f$<>"" .."Wimp|
00004c60  5f 4f 70 65 6e 54 65 6d  70 6c 61 74 65 22 2c 2c  |_OpenTemplate",,|
00004c70  66 24 0d 1e 6e 10 e7 20  64 61 74 61 25 3c 3e 30  |f$..n.. data%<>0|
00004c80  20 8c 0d 1e 78 14 20 de  20 77 73 5f 62 75 66 25  | ...x. . ws_buf%|
00004c90  20 64 61 74 61 25 0d 1e  82 53 20 c8 99 22 58 57  | data%...S .."XW|
00004ca0  69 6d 70 5f 4c 6f 61 64  54 65 6d 70 6c 61 74 65  |imp_LoadTemplate|
00004cb0  22 2c 2c 62 75 66 25 2c  77 73 5f 62 75 66 25 2c  |",,buf%,ws_buf%,|
00004cc0  77 73 5f 62 75 66 25 2b  64 61 74 61 25 2c 2d 31  |ws_buf%+data%,-1|
00004cd0  2c 6e 24 2c 30 20 b8 20  73 25 2c 2c 2c 2c 2c 2c  |,n$,0 . s%,,,,,,|
00004ce0  66 6f 75 6e 64 25 3b 66  25 0d 1e 8c 05 cc 0d 1e  |found%;f%.......|
00004cf0  96 41 20 c8 99 22 58 57  69 6d 70 5f 4c 6f 61 64  |.A .."XWimp_Load|
00004d00  54 65 6d 70 6c 61 74 65  22 2c 2c 62 75 66 25 2c  |Template",,buf%,|
00004d10  30 2c 30 2c 2d 31 2c 6e  24 2c 30 20 b8 20 73 25  |0,0,-1,n$,0 . s%|
00004d20  2c 2c 2c 2c 2c 2c 66 6f  75 6e 64 25 3b 66 25 0d  |,,,,,,found%;f%.|
00004d30  1e a0 05 cd 0d 1e aa 22  e7 66 24 3c 3e 22 22 20  |.......".f$<>"" |
00004d40  c8 99 22 57 69 6d 70 5f  43 6c 6f 73 65 54 65 6d  |.."Wimp_CloseTem|
00004d50  70 6c 61 74 65 22 0d 1e  b4 2f e7 28 66 25 80 31  |plate".../.(f%.1|
00004d60  29 20 85 20 74 61 73 6b  5f 6f 6b 25 2c 6e 24 2b  |) . task_ok%,n$+|
00004d70  22 3a 20 22 2b a4 74 61  73 6b 5f 72 74 6f 7a 28  |": "+.task_rtoz(|
00004d80  73 25 2b 34 29 0d 1e be  36 e7 66 6f 75 6e 64 25  |s%+4)...6.found%|
00004d90  3d 30 20 85 20 74 61 73  6b 5f 6f 6b 25 2c 22 54  |=0 . task_ok%,"T|
00004da0  65 6d 70 6c 61 74 65 20  27 22 2b 6e 24 2b 22 27  |emplate '"+n$+"'|
00004db0  20 6e 6f 74 20 66 6f 75  6e 64 22 0d 1e c8 05 e1  | not found".....|
00004dc0  0d 1e d2 20 dd f2 77 69  6e 5f 63 72 65 61 74 65  |... ..win_create|
00004dd0  28 62 75 66 25 2c f8 20  68 61 6e 64 6c 65 25 29  |(buf%,. handle%)|
00004de0  0d 1e dc 29 c8 99 22 57  69 6d 70 5f 43 72 65 61  |...).."Wimp_Crea|
00004df0  74 65 57 69 6e 64 6f 77  22 2c 2c 62 75 66 25 20  |teWindow",,buf% |
00004e00  b8 20 68 61 6e 64 6c 65  25 0d 1e e6 05 e1 0d 1e  |. handle%.......|
00004e10  f0 26 dd f2 77 69 6e 5f  73 69 7a 65 73 28 66 24  |.&..win_sizes(f$|
00004e20  2c 6e 24 2c f8 20 73 69  7a 65 25 2c f8 20 64 61  |,n$,. size%,. da|
00004e30  74 61 25 29 0d 1e fa 08  ea 20 69 25 0d 1f 04 0b  |ta%)..... i%....|
00004e40  ea 20 66 69 6c 65 25 0d  1f 0e 0a ea 20 70 74 72  |. file%..... ptr|
00004e50  25 0d 1f 18 0d ea 20 6f  66 66 73 65 74 25 0d 1f  |%..... offset%..|
00004e60  22 0b ea 20 74 79 70 65  25 0d 1f 2c 0c ea 20 69  |".. type%..,.. i|
00004e70  64 65 6e 74 24 0d 1f 36  10 ea 20 6e 75 6d 5f 69  |dent$..6.. num_i|
00004e80  63 6f 6e 73 25 0d 1f 40  0f 66 69 6c 65 25 3d 8e  |cons%..@.file%=.|
00004e90  28 66 24 29 0d 1f 4a 0b  73 69 7a 65 25 3d 30 0d  |(f$)..J.size%=0.|
00004ea0  1f 54 0b 64 61 74 61 25  3d 30 0d 1f 5e 0b 70 74  |.T.data%=0..^.pt|
00004eb0  72 25 3d 31 36 0d 1f 68  05 f5 0d 1f 72 11 20 cf  |r%=16..h....r. .|
00004ec0  23 66 69 6c 65 25 3d 70  74 72 25 0d 1f 7c 1d 20  |#file%=ptr%..|. |
00004ed0  6f 66 66 73 65 74 25 3d  a4 77 69 6e 5f 77 6f 72  |offset%=.win_wor|
00004ee0  64 28 66 69 6c 65 25 29  0d 1f 86 13 20 e7 20 6f  |d(file%).... . o|
00004ef0  66 66 73 65 74 25 3c 3e  30 20 8c 0d 1f 90 14 20  |ffset%<>0 ..... |
00004f00  20 cf 23 66 69 6c 65 25  3d 70 74 72 25 2b 38 0d  | .#file%=ptr%+8.|
00004f10  1f 9a 1c 20 20 74 79 70  65 25 3d a4 77 69 6e 5f  |...  type%=.win_|
00004f20  77 6f 72 64 28 66 69 6c  65 25 29 0d 1f a4 1f 20  |word(file%).... |
00004f30  20 69 64 65 6e 74 24 3d  a4 77 69 6e 5f 73 74 72  | ident$=.win_str|
00004f40  69 6e 67 28 66 69 6c 65  25 29 0d 1f ae 0e 20 20  |ing(file%)....  |
00004f50  70 74 72 25 2b 3d 32 34  0d 1f b8 10 20 20 e7 74  |ptr%+=24....  .t|
00004f60  79 70 65 25 3d 31 20 8c  0d 1f c2 13 20 20 20 e7  |ype%=1 .....   .|
00004f70  69 64 65 6e 74 24 3d 6e  24 20 8c 0d 1f cc 1a 20  |ident$=n$ ..... |
00004f80  20 20 20 cf 23 66 69 6c  65 25 3d 6f 66 66 73 65  |   .#file%=offse|
00004f90  74 25 2b 38 34 0d 1f d6  23 20 20 20 20 6e 75 6d  |t%+84...#    num|
00004fa0  5f 69 63 6f 6e 73 25 3d  a4 77 69 6e 5f 77 6f 72  |_icons%=.win_wor|
00004fb0  64 28 66 69 6c 65 25 29  0d 1f e0 27 20 20 20 20  |d(file%)...'    |
00004fc0  64 61 74 61 25 3d a4 77  69 6e 5f 74 69 74 6c 65  |data%=.win_title|
00004fd0  28 66 69 6c 65 25 2c 6f  66 66 73 65 74 25 29 0d  |(file%,offset%).|
00004fe0  1f ea 41 20 20 20 20 e7  6e 75 6d 5f 69 63 6f 6e  |..A    .num_icon|
00004ff0  73 25 3c 3e 30 20 64 61  74 61 25 2b 3d a4 77 69  |s%<>0 data%+=.wi|
00005000  6e 5f 69 63 6f 6e 28 66  69 6c 65 25 2c 6e 75 6d  |n_icon(file%,num|
00005010  5f 69 63 6f 6e 73 25 2c  6f 66 66 73 65 74 25 29  |_icons%,offset%)|
00005020  0d 1f f4 20 20 20 20 20  73 69 7a 65 25 3d 38 38  |...     size%=88|
00005030  2b 28 6e 75 6d 5f 69 63  6f 6e 73 25 2a 33 32 29  |+(num_icons%*32)|
00005040  0d 1f fe 11 20 20 20 20  6f 66 66 73 65 74 25 3d  |....    offset%=|
00005050  30 0d 20 08 08 20 20 20  cd 0d 20 12 07 20 20 cd  |0. ..   .. ..  .|
00005060  0d 20 1c 06 20 cd 0d 20  26 0f fd 20 6f 66 66 73  |. .. .. &.. offs|
00005070  65 74 25 3d 30 0d 20 30  0b d9 23 66 69 6c 65 25  |et%=0. 0..#file%|
00005080  0d 20 3a 05 e1 0d 20 44  12 dd a4 77 69 6e 5f 77  |. :... D...win_w|
00005090  6f 72 64 28 68 25 29 0d  20 4e 2f 3d 9a 23 68 25  |ord(h%). N/=.#h%|
000050a0  2b 28 9a 23 68 25 20 3c  3c 20 38 29 2b 28 9a 23  |+(.#h% << 8)+(.#|
000050b0  68 25 20 3c 3c 20 31 36  29 2b 28 9a 23 68 25 20  |h% << 16)+(.#h% |
000050c0  3c 3c 20 32 34 29 0d 20  58 14 dd a4 77 69 6e 5f  |<< 24). X...win_|
000050d0  73 74 72 69 6e 67 28 68  25 29 0d 20 62 0b ea 20  |string(h%). b.. |
000050e0  73 24 2c 63 25 0d 20 6c  05 f5 0d 20 76 0c 20 63  |s$,c%. l... v. c|
000050f0  25 3d 9a 23 68 25 0d 20  80 15 20 e7 63 25 3e 33  |%=.#h%. .. .c%>3|
00005100  31 20 73 24 2b 3d bd 28  63 25 29 0d 20 8a 0b fd  |1 s$+=.(c%). ...|
00005110  20 63 25 3c 33 32 0d 20  94 07 3d 73 24 0d 20 9e  | c%<32. ..=s$. .|
00005120  1e dd a4 77 69 6e 5f 74  69 74 6c 65 28 66 69 6c  |...win_title(fil|
00005130  65 25 2c 6f 66 66 73 65  74 25 29 0d 20 a8 08 ea  |e%,offset%). ...|
00005140  20 76 25 0d 20 b2 16 cf  23 66 69 6c 65 25 3d 6f  | v%. ...#file%=o|
00005150  66 66 73 65 74 25 2b 32  38 0d 20 bc 17 76 25 3d  |ffset%+28. ..v%=|
00005160  a4 77 69 6e 5f 77 6f 72  64 28 66 69 6c 65 25 29  |.win_word(file%)|
00005170  0d 20 c6 14 e7 20 28 76  25 20 80 20 31 3c 3c 33  |. ... (v% . 1<<3|
00005180  31 29 20 8c 0d 20 d0 15  20 e7 20 28 76 25 20 80  |1) .. .. . (v% .|
00005190  20 31 3c 3c 32 36 29 20  8c 0d 20 da 34 20 20 3d  | 1<<26) .. .4  =|
000051a0  a4 77 69 6e 5f 69 73 64  28 66 69 6c 65 25 2c 6f  |.win_isd(file%,o|
000051b0  66 66 73 65 74 25 2b 35  36 2c 6f 66 66 73 65 74  |ffset%+56,offset|
000051c0  25 2b 37 32 2c 6f 66 66  73 65 74 25 29 0d 20 e4  |%+72,offset%). .|
000051d0  06 20 cd 0d 20 ee 05 cc  0d 20 f8 11 20 e7 20 28  |. .. .... .. . (|
000051e0  76 25 20 80 20 31 29 20  8c 0d 21 02 34 20 20 3d  |v% . 1) ..!.4  =|
000051f0  a4 77 69 6e 5f 69 73 64  28 66 69 6c 65 25 2c 6f  |.win_isd(file%,o|
00005200  66 66 73 65 74 25 2b 35  36 2c 6f 66 66 73 65 74  |ffset%+56,offset|
00005210  25 2b 37 32 2c 6f 66 66  73 65 74 25 29 0d 21 0c  |%+72,offset%).!.|
00005220  06 20 cd 0d 21 16 05 cd  0d 21 20 06 3d 30 0d 21  |. ..!....! .=0.!|
00005230  2a 22 dd a4 77 69 6e 5f  69 63 6f 6e 28 66 69 6c  |*"..win_icon(fil|
00005240  65 25 2c 6e 75 6d 25 2c  6f 66 66 73 65 74 25 29  |e%,num%,offset%)|
00005250  0d 21 34 0b ea 20 69 25  2c 6a 25 0d 21 3e 08 6a  |.!4.. i%,j%.!>.j|
00005260  25 3d 30 0d 21 48 12 e3  69 25 3d 30 20 b8 20 6e  |%=0.!H..i%=0 . n|
00005270  75 6d 25 2d 31 0d 21 52  48 20 6a 25 2b 3d a4 77  |um%-1.!RH j%+=.w|
00005280  69 6e 5f 69 73 64 28 66  69 6c 65 25 2c 6f 66 66  |in_isd(file%,off|
00005290  73 65 74 25 2b 38 38 2b  69 25 2a 33 32 2b 31 36  |set%+88+i%*32+16|
000052a0  2c 6f 66 66 73 65 74 25  2b 38 38 2b 69 25 2a 33  |,offset%+88+i%*3|
000052b0  32 2b 32 30 2c 6f 66 66  73 65 74 25 29 0d 21 5c  |2+20,offset%).!\|
000052c0  05 ed 0d 21 66 07 3d 6a  25 0d 21 70 24 dd a4 77  |...!f.=j%.!p$..w|
000052d0  69 6e 5f 69 73 64 28 66  69 6c 65 25 2c 6f 31 25  |in_isd(file%,o1%|
000052e0  2c 6f 32 25 2c 6f 66 66  73 65 74 25 29 0d 21 7a  |,o2%,offset%).!z|
000052f0  16 ea 20 76 25 2c 69 73  74 25 2c 73 69 7a 65 25  |.. v%,ist%,size%|
00005300  2c 69 25 0d 21 84 0f cf  23 66 69 6c 65 25 3d 6f  |,i%.!...#file%=o|
00005310  31 25 0d 21 8e 17 76 25  3d a4 77 69 6e 5f 77 6f  |1%.!..v%=.win_wo|
00005320  72 64 28 66 69 6c 65 25  29 0d 21 98 18 69 25 3d  |rd(file%).!..i%=|
00005330  28 76 25 20 80 20 25 31  30 30 30 30 30 30 30 30  |(v% . %100000000|
00005340  29 0d 21 a2 1d 69 73 74  25 3d 28 76 25 20 80 20  |).!..ist%=(v% . |
00005350  33 29 20 2b 20 28 69 25  20 3e 3e 20 36 29 0d 21  |3) + (i% >> 6).!|
00005360  ac 0d c8 8e 20 69 73 74  25 20 ca 0d 21 b6 12 c9  |.... ist% ..!...|
00005370  20 20 20 30 3a 20 73 69  7a 65 25 3d 30 0d 21 c0  |   0: size%=0.!.|
00005380  12 c9 20 20 20 31 3a 20  73 69 7a 65 25 3d 30 0d  |..   1: size%=0.|
00005390  21 ca 12 c9 20 20 20 32  3a 20 73 69 7a 65 25 3d  |!...   2: size%=|
000053a0  30 0d 21 d4 12 c9 20 20  20 33 3a 20 73 69 7a 65  |0.!...   3: size|
000053b0  25 3d 30 0d 21 de 12 c9  20 20 20 34 3a 20 73 69  |%=0.!...   4: si|
000053c0  7a 65 25 3d 30 0d 21 e8  18 c9 20 35 2c 37 3a 20  |ze%=0.!... 5,7: |
000053d0  cf 23 66 69 6c 65 25 3d  6f 32 25 2b 34 0d 21 f2  |.#file%=o2%+4.!.|
000053e0  21 20 20 20 20 20 20 20  20 20 20 76 25 3d a4 77  |!          v%=.w|
000053f0  69 6e 5f 77 6f 72 64 28  66 69 6c 65 25 29 0d 21  |in_word(file%).!|
00005400  fc 16 20 20 20 20 20 20  20 20 20 20 e7 76 25 3d  |..          .v%=|
00005410  2d 31 20 8c 0d 22 06 16  20 20 20 20 20 20 20 20  |-1 .."..        |
00005420  20 20 20 73 69 7a 65 25  3d 30 0d 22 10 0f 20 20  |   size%=0."..  |
00005430  20 20 20 20 20 20 20 20  cc 0d 22 1a 21 20 20 20  |        ..".!   |
00005440  20 20 20 20 20 20 20 20  cf 23 66 69 6c 65 25 3d  |        .#file%=|
00005450  6f 66 66 73 65 74 25 2b  76 25 0d 22 24 2c 20 20  |offset%+v%."$,  |
00005460  20 20 20 20 20 20 20 20  20 73 69 7a 65 25 3d a9  |         size%=.|
00005470  28 a4 77 69 6e 5f 73 74  72 69 6e 67 28 66 69 6c  |(.win_string(fil|
00005480  65 25 29 29 2b 31 0d 22  2e 0f 20 20 20 20 20 20  |e%))+1."..      |
00005490  20 20 20 20 cd 0d 22 38  1b 20 20 20 20 20 20 20  |    .."8.       |
000054a0  20 20 20 cf 23 66 69 6c  65 25 3d 6f 32 25 2b 38  |   .#file%=o2%+8|
000054b0  0d 22 42 25 20 20 20 20  20 20 20 20 20 20 73 69  |."B%          si|
000054c0  7a 65 25 2b 3d a4 77 69  6e 5f 77 6f 72 64 28 66  |ze%+=.win_word(f|
000054d0  69 6c 65 25 29 0d 22 4c  18 c9 20 20 20 36 3a 20  |ile%)."L..   6: |
000054e0  cf 23 66 69 6c 65 25 3d  6f 32 25 2b 38 0d 22 56  |.#file%=o2%+8."V|
000054f0  24 20 20 20 20 20 20 20  20 20 20 73 69 7a 65 25  |$          size%|
00005500  3d a4 77 69 6e 5f 77 6f  72 64 28 66 69 6c 65 25  |=.win_word(file%|
00005510  29 0d 22 60 05 cb 0d 22  6a 0a 3d 73 69 7a 65 25  |)."`..."j.=size%|
00005520  0d 22 74 15 dd f2 69 63  6f 6e 5f 69 6e 69 74 69  |."t...icon_initi|
00005530  61 6c 69 73 65 0d 22 7e  16 de 20 69 63 6f 6e 5f  |alise."~.. icon_|
00005540  62 75 66 66 65 72 25 20  32 35 36 0d 22 88 05 e1  |buffer% 256."...|
00005550  0d 22 92 16 dd f2 69 63  6f 6e 5f 68 69 64 65 28  |."....icon_hide(|
00005560  61 25 2c 62 25 29 0d 22  9c 14 21 69 63 6f 6e 5f  |a%,b%)."..!icon_|
00005570  62 75 66 66 65 72 25 3d  61 25 0d 22 a6 15 69 63  |buffer%=a%."..ic|
00005580  6f 6e 5f 62 75 66 66 65  72 25 21 34 3d 62 25 0d  |on_buffer%!4=b%.|
00005590  22 b0 21 69 63 6f 6e 5f  62 75 66 66 65 72 25 21  |".!icon_buffer%!|
000055a0  38 3d 28 31 3c 3c 37 29  2b 28 31 3c 3c 32 33 29  |8=(1<<7)+(1<<23)|
000055b0  0d 22 ba 22 69 63 6f 6e  5f 62 75 66 66 65 72 25  |."."icon_buffer%|
000055c0  21 31 32 3d 28 31 3c 3c  37 29 2b 28 31 3c 3c 32  |!12=(1<<7)+(1<<2|
000055d0  33 29 0d 22 c4 27 c8 99  22 57 69 6d 70 5f 53 65  |3).".'.."Wimp_Se|
000055e0  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 69 63 6f  |tIconState",,ico|
000055f0  6e 5f 62 75 66 66 65 72  25 0d 22 ce 05 e1 0d 22  |n_buffer%."...."|
00005600  d8 1a dd f2 69 63 6f 6e  5f 77 72 69 74 65 28 61  |....icon_write(a|
00005610  25 2c 62 25 2c 73 24 29  0d 22 e2 14 21 69 63 6f  |%,b%,s$)."..!ico|
00005620  6e 5f 62 75 66 66 65 72  25 3d 61 25 0d 22 ec 15  |n_buffer%=a%."..|
00005630  69 63 6f 6e 5f 62 75 66  66 65 72 25 21 34 3d 62  |icon_buffer%!4=b|
00005640  25 0d 22 f6 27 c8 99 22  57 69 6d 70 5f 47 65 74  |%.".'.."Wimp_Get|
00005650  49 63 6f 6e 53 74 61 74  65 22 2c 2c 69 63 6f 6e  |IconState",,icon|
00005660  5f 62 75 66 66 65 72 25  0d 23 00 20 e7 28 a9 28  |_buffer%.#. .(.(|
00005670  73 24 29 2b 31 29 3e 69  63 6f 6e 5f 62 75 66 66  |s$)+1)>icon_buff|
00005680  65 72 25 21 33 36 20 8c  0d 23 0a 33 20 85 20 74  |er%!36 ..#.3 . t|
00005690  61 73 6b 5f 66 61 74 61  6c 25 2c 22 27 22 2b 73  |ask_fatal%,"'"+s|
000056a0  24 2b 22 27 20 77 6f 6e  27 74 20 66 69 74 20 69  |$+"' won't fit i|
000056b0  63 6f 6e 20 22 2b c3 28  62 25 29 0d 23 14 05 cd  |con "+.(b%).#...|
000056c0  0d 23 1e 19 24 28 69 63  6f 6e 5f 62 75 66 66 65  |.#..$(icon_buffe|
000056d0  72 25 21 32 38 29 3d 73  24 0d 23 28 26 69 63 6f  |r%!28)=s$.#(&ico|
000056e0  6e 5f 62 75 66 66 65 72  25 21 38 3d 30 3a 69 63  |n_buffer%!8=0:ic|
000056f0  6f 6e 5f 62 75 66 66 65  72 25 21 31 32 3d 30 0d  |on_buffer%!12=0.|
00005700  23 32 27 c8 99 22 57 69  6d 70 5f 53 65 74 49 63  |#2'.."Wimp_SetIc|
00005710  6f 6e 53 74 61 74 65 22  2c 2c 69 63 6f 6e 5f 62  |onState",,icon_b|
00005720  75 66 66 65 72 25 0d 23  3c 05 e1 0d 23 46 17 dd  |uffer%.#<...#F..|
00005730  f2 69 63 6f 6e 5f 73 68  61 64 65 28 61 25 2c 62  |.icon_shade(a%,b|
00005740  25 29 0d 23 50 14 21 69  63 6f 6e 5f 62 75 66 66  |%).#P.!icon_buff|
00005750  65 72 25 3d 61 25 0d 23  5a 15 69 63 6f 6e 5f 62  |er%=a%.#Z.icon_b|
00005760  75 66 66 65 72 25 21 34  3d 62 25 0d 23 64 18 69  |uffer%!4=b%.#d.i|
00005770  63 6f 6e 5f 62 75 66 66  65 72 25 21 38 3d 31 3c  |con_buffer%!8=1<|
00005780  3c 32 32 0d 23 6e 19 69  63 6f 6e 5f 62 75 66 66  |<22.#n.icon_buff|
00005790  65 72 25 21 31 32 3d 31  3c 3c 32 32 0d 23 78 27  |er%!12=1<<22.#x'|
000057a0  c8 99 22 57 69 6d 70 5f  53 65 74 49 63 6f 6e 53  |.."Wimp_SetIconS|
000057b0  74 61 74 65 22 2c 2c 69  63 6f 6e 5f 62 75 66 66  |tate",,icon_buff|
000057c0  65 72 25 0d 23 82 05 e1  0d 23 8c 15 dd a4 69 63  |er%.#....#....ic|
000057d0  6f 6e 5f 73 65 74 28 61  25 2c 62 25 29 0d 23 96  |on_set(a%,b%).#.|
000057e0  14 21 69 63 6f 6e 5f 62  75 66 66 65 72 25 3d 61  |.!icon_buffer%=a|
000057f0  25 0d 23 a0 15 69 63 6f  6e 5f 62 75 66 66 65 72  |%.#..icon_buffer|
00005800  25 21 34 3d 62 25 0d 23  aa 27 c8 99 22 57 69 6d  |%!4=b%.#.'.."Wim|
00005810  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
00005820  2c 69 63 6f 6e 5f 62 75  66 66 65 72 25 0d 23 b4  |,icon_buffer%.#.|
00005830  25 3d 28 28 69 63 6f 6e  5f 62 75 66 66 65 72 25  |%=((icon_buffer%|
00005840  21 32 34 20 80 20 28 31  3c 3c 32 31 29 29 3c 3e  |!24 . (1<<21))<>|
00005850  30 29 0d 23 be 18 dd f2  69 63 6f 6e 5f 75 6e 68  |0).#....icon_unh|
00005860  69 64 65 28 61 25 2c 62  25 29 0d 23 c8 14 21 69  |ide(a%,b%).#..!i|
00005870  63 6f 6e 5f 62 75 66 66  65 72 25 3d 61 25 0d 23  |con_buffer%=a%.#|
00005880  d2 15 69 63 6f 6e 5f 62  75 66 66 65 72 25 21 34  |..icon_buffer%!4|
00005890  3d 62 25 0d 23 dc 14 69  63 6f 6e 5f 62 75 66 66  |=b%.#..icon_buff|
000058a0  65 72 25 21 38 3d 30 0d  23 e6 19 69 63 6f 6e 5f  |er%!8=0.#..icon_|
000058b0  62 75 66 66 65 72 25 21  31 32 3d 31 3c 3c 32 33  |buffer%!12=1<<23|
000058c0  0d 23 f0 27 c8 99 22 57  69 6d 70 5f 53 65 74 49  |.#.'.."Wimp_SetI|
000058d0  63 6f 6e 53 74 61 74 65  22 2c 2c 69 63 6f 6e 5f  |conState",,icon_|
000058e0  62 75 66 66 65 72 25 0d  23 fa 05 e1 0d 24 04 19  |buffer%.#....$..|
000058f0  dd f2 69 63 6f 6e 5f 75  6e 73 68 61 64 65 28 61  |..icon_unshade(a|
00005900  25 2c 62 25 29 0d 24 0e  14 21 69 63 6f 6e 5f 62  |%,b%).$..!icon_b|
00005910  75 66 66 65 72 25 3d 61  25 0d 24 18 15 69 63 6f  |uffer%=a%.$..ico|
00005920  6e 5f 62 75 66 66 65 72  25 21 34 3d 62 25 0d 24  |n_buffer%!4=b%.$|
00005930  22 14 69 63 6f 6e 5f 62  75 66 66 65 72 25 21 38  |".icon_buffer%!8|
00005940  3d 30 0d 24 2c 19 69 63  6f 6e 5f 62 75 66 66 65  |=0.$,.icon_buffe|
00005950  72 25 21 31 32 3d 31 3c  3c 32 32 0d 24 36 27 c8  |r%!12=1<<22.$6'.|
00005960  99 22 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  |."Wimp_SetIconSt|
00005970  61 74 65 22 2c 2c 69 63  6f 6e 5f 62 75 66 66 65  |ate",,icon_buffe|
00005980  72 25 0d 24 40 05 e1 0d  24 4a 1a dd 20 f2 74 61  |r%.$@...$J.. .ta|
00005990  73 6b 5f 69 6e 69 74 69  61 6c 69 73 65 28 6e 24  |sk_initialise(n$|
000059a0  29 0d 24 54 0f 74 61 73  6b 5f 69 64 24 3d 6e 24  |).$T.task_id$=n$|
000059b0  0d 24 5e 14 de 20 74 61  73 6b 5f 62 75 66 66 25  |.$^.. task_buff%|
000059c0  20 32 35 36 0d 24 68 14  e7 20 52 69 73 63 4f 53  | 256.$h.. RiscOS|
000059d0  25 3e 3d 33 30 30 20 8c  0d 24 72 27 20 20 74 61  |%>=300 ..$r'  ta|
000059e0  73 6b 5f 62 75 66 66 25  21 30 3d 4d 65 73 73 61  |sk_buff%!0=Messa|
000059f0  67 65 5f 4d 4d 5f 44 6f  63 75 6d 65 6e 74 25 0d  |ge_MM_Document%.|
00005a00  24 7c 28 20 20 74 61 73  6b 5f 62 75 66 66 25 21  |$|(  task_buff%!|
00005a10  34 3d 4d 65 73 73 61 67  65 5f 57 69 6e 64 6f 77  |4=Message_Window|
00005a20  43 6c 6f 73 65 64 25 0d  24 86 29 20 20 74 61 73  |Closed%.$.)  tas|
00005a30  6b 5f 62 75 66 66 25 21  38 3d 4d 65 73 73 61 67  |k_buff%!8=Messag|
00005a40  65 5f 54 61 73 6b 43 6c  6f 73 65 44 6f 77 6e 25  |e_TaskCloseDown%|
00005a50  0d 24 90 24 20 20 74 61  73 6b 5f 62 75 66 66 25  |.$.$  task_buff%|
00005a60  21 31 32 3d 4d 65 73 73  61 67 65 5f 50 72 65 51  |!12=Message_PreQ|
00005a70  75 69 74 25 0d 24 9a 25  20 20 74 61 73 6b 5f 62  |uit%.$.%  task_b|
00005a80  75 66 66 25 21 31 36 3d  4d 65 73 73 61 67 65 5f  |uff%!16=Message_|
00005a90  52 41 4d 46 65 74 63 68  25 0d 24 a4 25 20 20 74  |RAMFetch%.$.%  t|
00005aa0  61 73 6b 5f 62 75 66 66  25 21 32 30 3d 4d 65 73  |ask_buff%!20=Mes|
00005ab0  73 61 67 65 5f 44 61 74  61 4c 6f 61 64 25 0d 24  |sage_DataLoad%.$|
00005ac0  ae 25 20 20 74 61 73 6b  5f 62 75 66 66 25 21 32  |.%  task_buff%!2|
00005ad0  34 3d 4d 65 73 73 61 67  65 5f 44 61 74 61 53 61  |4=Message_DataSa|
00005ae0  76 65 25 0d 24 b8 26 20  20 74 61 73 6b 5f 62 75  |ve%.$.&  task_bu|
00005af0  66 66 25 21 32 38 3d 4d  65 73 73 61 67 65 5f 49  |ff%!28=Message_I|
00005b00  6d 70 75 6c 73 65 5f 31  25 0d 24 c2 26 20 20 74  |mpulse_1%.$.&  t|
00005b10  61 73 6b 5f 62 75 66 66  25 21 33 32 3d 4d 65 73  |ask_buff%!32=Mes|
00005b20  73 61 67 65 5f 49 6d 70  75 6c 73 65 5f 32 25 0d  |sage_Impulse_2%.|
00005b30  24 cc 21 20 20 74 61 73  6b 5f 62 75 66 66 25 21  |$.!  task_buff%!|
00005b40  33 36 3d 4d 65 73 73 61  67 65 5f 51 75 69 74 25  |36=Message_Quit%|
00005b50  0d 24 d6 55 20 20 c8 99  22 57 69 6d 70 5f 49 6e  |.$.U  .."Wimp_In|
00005b60  69 74 69 61 6c 69 73 65  22 2c 33 31 30 2c 26 34  |itialise",310,&4|
00005b70  42 35 33 34 31 35 34 2c  6e 24 2c 74 61 73 6b 5f  |B534154,n$,task_|
00005b80  62 75 66 66 25 2b 33 36  20 b8 20 77 69 6d 70 5f  |buff%+36 . wimp_|
00005b90  76 65 72 73 69 6f 6e 25  2c 74 61 73 6b 5f 68 61  |version%,task_ha|
00005ba0  6e 64 6c 65 25 0d 24 e0  05 cc 0d 24 ea 48 20 20  |ndle%.$....$.H  |
00005bb0  c8 99 20 22 57 69 6d 70  5f 49 6e 69 74 69 61 6c  |.. "Wimp_Initial|
00005bc0  69 73 65 22 2c 32 30 30  2c 26 34 42 35 33 34 31  |ise",200,&4B5341|
00005bd0  35 34 2c 6e 24 20 b8 20  77 69 6d 70 5f 76 65 72  |54,n$ . wimp_ver|
00005be0  73 69 6f 6e 25 2c 74 61  73 6b 5f 68 61 6e 64 6c  |sion%,task_handl|
00005bf0  65 25 0d 24 f4 05 cd 0d  24 fe 23 ff 28 22 53 65  |e%.$....$.#.("Se|
00005c00  74 20 4d 61 69 6c 4d 65  72 67 65 24 52 75 6e 6e  |t MailMerge$Runn|
00005c10  69 6e 67 20 54 52 55 45  22 29 0d 25 08 12 74 61  |ing TRUE").%..ta|
00005c20  73 6b 5f 61 63 74 69 6f  6e 25 3d 30 0d 25 12 1d  |sk_action%=0.%..|
00005c30  74 61 73 6b 5f 6d 61 73  6b 25 3d 30 20 20 20 20  |task_mask%=0    |
00005c40  20 20 20 20 20 20 20 3a  20 0d 25 1c 10 74 61 73  |       : .%..tas|
00005c50  6b 5f 6f 6b 25 3d 32 35  34 0d 25 26 13 74 61 73  |k_ok%=254.%&.tas|
00005c60  6b 5f 66 61 74 61 6c 25  3d 32 35 33 0d 25 30 05  |k_fatal%=253.%0.|
00005c70  e1 0d 25 3a 13 dd f2 74  61 73 6b 5f 73 68 75 74  |..%:...task_shut|
00005c80  64 6f 77 6e 0d 25 44 16  c8 99 22 57 69 6d 70 5f  |down.%D..."Wimp_|
00005c90  43 6c 6f 73 65 44 6f 77  6e 22 0d 25 4e 20 ff 28  |CloseDown".%N .(|
00005ca0  22 55 6e 53 65 74 20 4d  61 69 6c 4d 65 72 67 65  |"UnSet MailMerge|
00005cb0  24 52 75 6e 6e 69 6e 67  22 29 0d 25 58 05 e0 0d  |$Running").%X...|
00005cc0  25 62 05 e1 0d 25 6c 13  dd a4 74 61 73 6b 5f 72  |%b...%l...task_r|
00005cd0  74 6f 7a 28 70 25 29 0d  25 76 08 ea 20 70 24 0d  |toz(p%).%v.. p$.|
00005ce0  25 80 0d c8 95 20 3f 70  25 3c 3e 30 0d 25 8a 0f  |%.... ?p%<>0.%..|
00005cf0  20 70 24 2b 3d bd 28 3f  70 25 29 0d 25 94 0a 20  | p$+=.(?p%).%.. |
00005d00  70 25 2b 3d 31 0d 25 9e  05 ce 0d 25 a8 07 3d 70  |p%+=1.%....%..=p|
00005d10  24 0d 25 b2 18 dd f2 6d  73 67 5f 69 6e 69 74 69  |$.%....msg_initi|
00005d20  61 6c 69 73 65 28 4e 24  29 0d 25 bc 0e ea 20 63  |alise(N$).%... c|
00005d30  25 2c 63 24 2c 69 25 0d  25 c6 0c 63 25 3d 8e 28  |%,c$,i%.%..c%=.(|
00005d40  4e 24 29 0d 25 d0 2a e7  63 25 3d 30 20 85 20 30  |N$).%.*.c%=0 . 0|
00005d50  2c 20 22 43 61 6e 6e 6f  74 20 66 69 6e 64 20 6d  |, "Cannot find m|
00005d60  65 73 73 61 67 65 73 20  66 69 6c 65 22 0d 25 da  |essages file".%.|
00005d70  0e 6d 73 5f 74 61 67 73  25 3d 30 0d 25 e4 11 f2  |.ms_tags%=0.%...|
00005d80  68 6f 75 72 67 6c 61 73  73 5f 6f 6e 0d 25 ee 0e  |hourglass_on.%..|
00005d90  c8 95 20 ac 28 c5 23 63  25 29 0d 25 f8 0c 20 63  |.. .(.#c%).%.. c|
00005da0  24 3d be 23 63 25 0d 26  02 0e 20 e7 63 24 3c 3e  |$=.#c%.&.. .c$<>|
00005db0  22 22 20 8c 0d 26 0c 14  20 20 e7 c0 63 24 2c 31  |"" ..&..  ..c$,1|
00005dc0  29 3c 3e 22 23 22 20 8c  0d 26 16 1f 20 20 20 e7  |)<>"#" ..&..   .|
00005dd0  a7 63 24 2c 22 3a 22 29  3c 3e 30 20 6d 73 5f 74  |.c$,":")<>0 ms_t|
00005de0  61 67 73 25 2b 3d 31 0d  26 20 07 20 20 cd 0d 26  |ags%+=1.& .  ..&|
00005df0  2a 06 20 cd 0d 26 34 05  ce 0d 26 3e 12 e7 6d 73  |*. ..&4...&>..ms|
00005e00  5f 74 61 67 73 25 3c 3e  30 20 8c 0d 26 48 30 20  |_tags%<>0 ..&H0 |
00005e10  de 20 6d 73 5f 74 65 78  74 24 28 6d 73 5f 74 61  |. ms_text$(ms_ta|
00005e20  67 73 25 2d 31 29 2c 6d  73 5f 74 61 67 73 24 28  |gs%-1),ms_tags$(|
00005e30  6d 73 5f 74 61 67 73 25  2d 31 29 0d 26 52 0b 20  |ms_tags%-1).&R. |
00005e40  cf 23 63 25 3d 30 0d 26  5c 09 20 69 25 3d 30 0d  |.#c%=0.&\. i%=0.|
00005e50  26 66 0d 20 c8 95 20 ac  c5 23 63 25 0d 26 70 0d  |&f. .. ..#c%.&p.|
00005e60  20 20 63 24 3d be 23 63  25 0d 26 7a 0f 20 20 e7  |  c$=.#c%.&z.  .|
00005e70  63 24 3c 3e 22 22 20 8c  0d 26 84 15 20 20 20 e7  |c$<>"" ..&..   .|
00005e80  c0 63 24 2c 31 29 3c 3e  22 23 22 20 8c 0d 26 8e  |.c$,1)<>"#" ..&.|
00005e90  24 20 20 20 20 6d 73 5f  74 61 67 73 24 28 69 25  |$    ms_tags$(i%|
00005ea0  29 3d c0 63 24 2c a7 63  24 2c 22 3a 22 29 2d 31  |)=.c$,.c$,":")-1|
00005eb0  29 0d 26 98 24 20 20 20  20 6d 73 5f 74 65 78 74  |).&.$    ms_text|
00005ec0  24 28 69 25 29 3d c1 63  24 2c a7 63 24 2c 22 3a  |$(i%)=.c$,.c$,":|
00005ed0  22 29 2b 31 29 0d 26 a2  0d 20 20 20 20 69 25 2b  |")+1).&..    i%+|
00005ee0  3d 31 0d 26 ac 08 20 20  20 cd 0d 26 b6 07 20 20  |=1.&..   ..&..  |
00005ef0  cd 0d 26 c0 06 20 ce 0d  26 ca 05 cd 0d 26 d4 08  |..&.. ..&....&..|
00005f00  d9 23 63 25 0d 26 de 12  f2 68 6f 75 72 67 6c 61  |.#c%.&...hourgla|
00005f10  73 73 5f 6f 66 66 0d 26  e8 05 e1 0d 26 f2 0f dd  |ss_off.&....&...|
00005f20  a4 6d 73 67 5f 30 28 54  24 29 0d 26 fc 1b 3d a4  |.msg_0(T$).&..=.|
00005f30  6d 73 67 5f 34 28 54 24  2c 22 22 2c 22 22 2c 22  |msg_4(T$,"","","|
00005f40  22 2c 22 22 29 0d 27 06  12 dd a4 6d 73 67 5f 31  |","").'....msg_1|
00005f50  28 54 24 2c 53 24 29 0d  27 10 1b 3d a4 6d 73 67  |(T$,S$).'..=.msg|
00005f60  5f 34 28 54 24 2c 53 24  2c 22 22 2c 22 22 2c 22  |_4(T$,S$,"","","|
00005f70  22 29 0d 27 1a 05 3b 0d  27 24 17 dd a4 6d 73 67  |").'..;.'$...msg|
00005f80  5f 32 28 54 24 2c 53 30  24 2c 53 31 24 29 0d 27  |_2(T$,S0$,S1$).'|
00005f90  2e 1d 3d a4 6d 73 67 5f  34 28 54 24 2c 53 30 24  |..=.msg_4(T$,S0$|
00005fa0  2c 53 31 24 2c 22 22 2c  22 22 29 0d 27 38 1f dd  |,S1$,"","").'8..|
00005fb0  a4 6d 73 67 5f 34 28 54  24 2c 53 30 24 2c 53 31  |.msg_4(T$,S0$,S1|
00005fc0  24 2c 53 32 24 2c 53 33  24 29 0d 27 42 0b ea 20  |$,S2$,S3$).'B.. |
00005fd0  69 25 2c 66 25 0d 27 4c  11 e7 6d 73 5f 74 61 67  |i%,f%.'L..ms_tag|
00005fe0  73 25 3d 30 20 8c 0d 27  56 08 20 3d 54 24 0d 27  |s%=0 ..'V. =T$.'|
00005ff0  60 05 cc 0d 27 6a 17 20  e3 69 25 3d 30 20 b8 20  |`...'j. .i%=0 . |
00006000  6d 73 5f 74 61 67 73 25  2d 31 0d 27 74 18 20 20  |ms_tags%-1.'t.  |
00006010  e7 54 24 3d 6d 73 5f 74  61 67 73 24 28 69 25 29  |.T$=ms_tags$(i%)|
00006020  20 8c 0d 27 7e 16 20 20  20 54 24 3d 6d 73 5f 74  | ..'~.   T$=ms_t|
00006030  65 78 74 24 28 69 25 29  0d 27 88 13 20 20 20 66  |ext$(i%).'..   f|
00006040  25 3d a7 54 24 2c 22 25  30 22 29 0d 27 92 28 20  |%=.T$,"%0").'.( |
00006050  20 20 e7 66 25 3c 3e 30  20 54 24 3d c0 54 24 2c  |  .f%<>0 T$=.T$,|
00006060  66 25 2d 31 29 2b 53 30  24 2b c1 54 24 2c 66 25  |f%-1)+S0$+.T$,f%|
00006070  2b 32 29 0d 27 9c 13 20  20 20 66 25 3d a7 54 24  |+2).'..   f%=.T$|
00006080  2c 22 25 31 22 29 0d 27  a6 28 20 20 20 e7 66 25  |,"%1").'.(   .f%|
00006090  3c 3e 30 20 54 24 3d c0  54 24 2c 66 25 2d 31 29  |<>0 T$=.T$,f%-1)|
000060a0  2b 53 31 24 2b c1 54 24  2c 66 25 2b 32 29 0d 27  |+S1$+.T$,f%+2).'|
000060b0  b0 13 20 20 20 66 25 3d  a7 54 24 2c 22 25 32 22  |..   f%=.T$,"%2"|
000060c0  29 0d 27 ba 28 20 20 20  e7 66 25 3c 3e 30 20 54  |).'.(   .f%<>0 T|
000060d0  24 3d c0 54 24 2c 66 25  2d 31 29 2b 53 32 24 2b  |$=.T$,f%-1)+S2$+|
000060e0  c1 54 24 2c 66 25 2b 32  29 0d 27 c4 13 20 20 20  |.T$,f%+2).'..   |
000060f0  66 25 3d a7 54 24 2c 22  25 33 22 29 0d 27 ce 28  |f%=.T$,"%3").'.(|
00006100  20 20 20 e7 66 25 3c 3e  30 20 54 24 3d c0 54 24  |   .f%<>0 T$=.T$|
00006110  2c 66 25 2d 31 29 2b 53  33 24 2b c1 54 24 2c 66  |,f%-1)+S3$+.T$,f|
00006120  25 2b 32 29 0d 27 d8 12  20 20 20 69 25 3d 6d 73  |%+2).'..   i%=ms|
00006130  5f 74 61 67 73 25 0d 27  e2 07 20 20 cd 0d 27 ec  |_tags%.'..  ..'.|
00006140  06 20 ed 0d 27 f6 05 cd  0d 28 00 07 3d 54 24 0d  |. ..'....(..=T$.|
00006150  28 0a 12 dd f2 68 6f 75  72 67 6c 61 73 73 5f 6f  |(....hourglass_o|
00006160  6e 0d 28 14 14 c8 99 22  48 6f 75 72 67 6c 61 73  |n.(...."Hourglas|
00006170  73 5f 4f 6e 22 0d 28 1e  17 68 6f 75 72 67 6c 61  |s_On".(..hourgla|
00006180  73 73 5f 63 6f 75 6e 74  25 2b 3d 31 0d 28 28 05  |ss_count%+=1.((.|
00006190  e1 0d 28 32 13 dd f2 68  6f 75 72 67 6c 61 73 73  |..(2...hourglass|
000061a0  5f 6f 66 66 0d 28 3c 15  c8 99 22 48 6f 75 72 67  |_off.(<..."Hourg|
000061b0  6c 61 73 73 5f 4f 66 66  22 0d 28 46 17 68 6f 75  |lass_Off".(F.hou|
000061c0  72 67 6c 61 73 73 5f 63  6f 75 6e 74 25 2d 3d 31  |rglass_count%-=1|
000061d0  0d 28 50 05 e1 0d 28 5a  13 dd f2 6f 70 65 6e 5f  |.(P...(Z...open_|
000061e0  63 73 76 5f 66 69 6c 65  0d 28 64 14 e7 20 63 73  |csv_file.(d.. cs|
000061f0  76 5f 66 69 6c 65 24 3d  22 22 20 e1 0d 28 6e 21  |v_file$="" ..(n!|
00006200  63 73 76 5f 66 69 6c 65  5f 68 61 6e 64 6c 65 25  |csv_file_handle%|
00006210  3d 8e 28 63 73 76 5f 66  69 6c 65 24 29 0d 28 78  |=.(csv_file$).(x|
00006220  05 e1 0d 28 82 14 dd f2  63 6c 6f 73 65 5f 63 73  |...(....close_cs|
00006230  76 5f 66 69 6c 65 0d 28  8c 19 e7 63 73 76 5f 66  |v_file.(...csv_f|
00006240  69 6c 65 5f 68 61 6e 64  6c 65 25 3d 30 20 e1 0d  |ile_handle%=0 ..|
00006250  28 96 16 d9 23 63 73 76  5f 66 69 6c 65 5f 68 61  |(...#csv_file_ha|
00006260  6e 64 6c 65 25 0d 28 a0  16 63 73 76 5f 66 69 6c  |ndle%.(..csv_fil|
00006270  65 5f 68 61 6e 64 6c 65  25 3d 30 0d 28 aa 05 e1  |e_handle%=0.(...|
00006280  0d 28 b4 0d dd 20 f2 63  6f 6e 73 74 73 0d 28 be  |.(... .consts.(.|
00006290  1d 61 70 70 64 69 72 24  3d 22 3c 4d 61 69 6c 4d  |.appdir$="<MailM|
000062a0  65 72 67 65 24 44 69 72  3e 22 0d 28 c8 12 49 63  |erge$Dir>".(..Ic|
000062b0  6f 6e 5f 54 6f 50 72 6f  63 25 3d 31 0d 28 d2 14  |on_ToProc%=1.(..|
000062c0  49 63 6f 6e 5f 52 65 63  73 50 72 6f 63 25 3d 32  |Icon_RecsProc%=2|
000062d0  0d 28 dc 14 49 63 6f 6e  5f 48 65 61 64 69 6e 67  |.(..Icon_Heading|
000062e0  73 25 3d 33 0d 28 e6 14  49 63 6f 6e 5f 50 72 69  |s%=3.(..Icon_Pri|
000062f0  6e 74 41 6c 6c 25 3d 34  0d 28 f0 0f 49 63 6f 6e  |ntAll%=4.(..Icon|
00006300  5f 43 53 56 25 3d 35 0d  28 fa 10 49 63 6f 6e 5f  |_CSV%=5.(..Icon_|
00006310  54 6f 47 6f 25 3d 36 0d  29 04 10 49 63 6f 6e 5f  |ToGo%=6.)..Icon_|
00006320  44 6f 6e 65 25 3d 37 0d  29 0e 11 49 63 6f 6e 5f  |Done%=7.)..Icon_|
00006330  50 72 69 6e 74 25 3d 38  0d 29 18 15 49 63 6f 6e  |Print%=8.)..Icon|
00006340  5f 64 6f 63 75 6d 65 6e  74 25 3d 31 30 0d 29 22  |_document%=10.)"|
00006350  11 49 63 6f 6e 5f 4e 65  78 74 25 3d 31 31 0d 29  |.Icon_Next%=11.)|
00006360  2c 11 49 63 6f 6e 5f 45  64 69 74 25 3d 31 32 0d  |,.Icon_Edit%=12.|
00006370  29 36 15 49 63 6f 6e 5f  44 69 73 70 48 65 61 64  |)6.Icon_DispHead|
00006380  25 3d 31 33 0d 29 40 17  49 63 6f 6e 5f 53 74 61  |%=13.)@.Icon_Sta|
00006390  72 74 4d 65 72 67 65 25  3d 31 34 0d 29 4a 15 49  |rtMerge%=14.)J.I|
000063a0  63 6f 6e 5f 44 72 6f 70  48 65 72 65 25 3d 31 35  |con_DropHere%=15|
000063b0  0d 29 54 15 57 69 6e 64  6f 77 5f 53 6d 61 6c 6c  |.)T.Window_Small|
000063c0  25 3d 32 33 36 0d 29 5e  13 57 69 6e 64 6f 77 5f  |%=236.)^.Window_|
000063d0  42 69 67 25 3d 33 36 30  0d 29 68 11 54 5f 47 65  |Big%=360.)h.T_Ge|
000063e0  74 46 69 65 6c 64 25 3d  30 0d 29 72 10 54 5f 47  |tField%=0.)r.T_G|
000063f0  65 74 44 61 74 61 25 3d  31 0d 29 7c 14 54 5f 47  |etData%=1.)|.T_G|
00006400  65 74 54 69 6d 65 44 61  74 65 25 3d 32 0d 29 86  |etTimeDate%=2.).|
00006410  0e 54 5f 50 72 69 6e 74  25 3d 33 0d 29 90 0e 54  |.T_Print%=3.)..T|
00006420  5f 4d 65 72 67 65 25 3d  34 0d 29 9a 12 54 5f 43  |_Merge%=4.)..T_C|
00006430  6c 6f 73 65 44 6f 77 6e  25 3d 37 0d 29 a4 19 49  |loseDown%=7.)..I|
00006440  6d 70 75 6c 73 65 5f 43  6f 6d 6d 61 6e 64 25 3d  |mpulse_Command%=|
00006450  26 32 30 30 0d 29 ae 19  49 6d 70 75 6c 73 65 5f  |&200.)..Impulse_|
00006460  52 65 71 75 65 73 74 25  3d 26 32 30 31 0d 29 b8  |Request%=&201.).|
00006470  17 49 6d 70 75 6c 73 65  5f 52 65 70 6c 79 25 3d  |.Impulse_Reply%=|
00006480  26 32 30 32 0d 29 c2 1a  49 6d 70 75 6c 73 65 5f  |&202.)..Impulse_|
00006490  53 65 6e 64 44 61 74 61  25 3d 26 32 30 33 0d 29  |SendData%=&203.)|
000064a0  cc 1d 49 6d 70 75 6c 73  65 5f 52 65 63 65 69 76  |..Impulse_Receiv|
000064b0  65 44 61 74 61 25 3d 26  32 30 34 0d 29 d6 1f 49  |eData%=&204.)..I|
000064c0  6d 70 75 6c 73 65 5f 44  65 66 65 72 72 65 64 52  |mpulse_DeferredR|
000064d0  65 70 6c 79 25 3d 26 32  30 35 0d 29 e0 12 44 44  |eply%=&205.)..DD|
000064e0  46 5f 54 79 70 65 25 3d  26 44 39 33 0d 29 ea 12  |F_Type%=&D93.)..|
000064f0  43 53 56 5f 54 79 70 65  25 3d 26 44 46 45 0d 29  |CSV_Type%=&DFE.)|
00006500  f4 13 4d 65 73 73 61 67  65 5f 51 75 69 74 25 3d  |..Message_Quit%=|
00006510  30 0d 29 fe 17 4d 65 73  73 61 67 65 5f 44 61 74  |0.)..Message_Dat|
00006520  61 53 61 76 65 25 3d 31  0d 2a 08 17 4d 65 73 73  |aSave%=1.*..Mess|
00006530  61 67 65 5f 44 61 74 61  4c 6f 61 64 25 3d 33 0d  |age_DataLoad%=3.|
00006540  2a 12 17 4d 65 73 73 61  67 65 5f 52 41 4d 46 65  |*..Message_RAMFe|
00006550  74 63 68 25 3d 36 0d 2a  1c 16 4d 65 73 73 61 67  |tch%=6.*..Messag|
00006560  65 5f 50 72 65 51 75 69  74 25 3d 38 0d 2a 26 21  |e_PreQuit%=8.*&!|
00006570  4d 65 73 73 61 67 65 5f  54 61 73 6b 43 6c 6f 73  |Message_TaskClos|
00006580  65 44 6f 77 6e 25 3d 26  34 30 30 43 33 0d 2a 30  |eDown%=&400C3.*0|
00006590  20 4d 65 73 73 61 67 65  5f 57 69 6e 64 6f 77 43  | Message_WindowC|
000065a0  6c 6f 73 65 64 25 3d 26  34 30 30 43 42 0d 2a 3a  |losed%=&400CB.*:|
000065b0  1d 4d 65 73 73 61 67 65  5f 49 6d 70 75 6c 73 65  |.Message_Impulse|
000065c0  5f 31 25 3d 26 38 30 45  31 38 0d 2a 44 1d 4d 65  |_1%=&80E18.*D.Me|
000065d0  73 73 61 67 65 5f 49 6d  70 75 6c 73 65 5f 32 25  |ssage_Impulse_2%|
000065e0  3d 26 38 30 45 31 39 0d  2a 4e 1f 4d 65 73 73 61  |=&80E19.*N.Messa|
000065f0  67 65 5f 4d 4d 5f 44 6f  63 75 6d 65 6e 74 25 3d  |ge_MM_Document%=|
00006600  26 38 32 31 34 30 0d 2a  58 12 43 68 61 72 5f 53  |&82140.*X.Char_S|
00006610  70 61 63 65 25 3d 33 32  0d 2a 62 12 43 68 61 72  |pace%=32.*b.Char|
00006620  5f 51 75 6f 74 65 25 3d  33 34 0d 2a 6c 12 43 68  |_Quote%=34.*l.Ch|
00006630  61 72 5f 43 6f 6d 6d 61  25 3d 34 34 0d 2a 76 0f  |ar_Comma%=44.*v.|
00006640  43 68 61 72 5f 4c 46 25  3d 31 30 0d 2a 80 0f 43  |Char_LF%=10.*..C|
00006650  68 61 72 5f 43 52 25 3d  31 33 0d 2a 8a 12 43 68  |har_CR%=13.*..Ch|
00006660  61 72 5f 53 6c 61 73 68  25 3d 39 32 0d 2a 94 17  |ar_Slash%=92.*..|
00006670  43 68 61 72 5f 48 61 72  64 53 70 61 63 65 25 3d  |Char_HardSpace%=|
00006680  31 36 30 0d 2a 9e 05 e1  0d 2a a8 10 dd 20 f2 72  |160.*....*... .r|
00006690  65 61 64 6f 70 73 79 73  0d 2a b2 25 c8 99 20 22  |eadopsys.*.%.. "|
000066a0  4f 53 5f 42 79 74 65 22  2c 31 32 39 2c 30 2c 32  |OS_Byte",129,0,2|
000066b0  35 35 20 b8 20 2c 52 69  73 63 4f 53 25 0d 2a bc  |55 . ,RiscOS%.*.|
000066c0  2d e7 20 52 69 73 63 4f  53 25 3c 31 36 33 20 8c  |-. RiscOS%<163 .|
000066d0  20 52 69 73 63 4f 53 25  3d 32 30 30 20 8b 20 52  | RiscOS%=200 . R|
000066e0  69 73 63 4f 53 25 3d 33  30 30 0d 2a c6 05 e1 0d  |iscOS%=300.*....|
000066f0  2a d0 06 20 20 0d 2a da  06 20 20 0d 2a e4 06 20  |*..  .*..  .*.. |
00006700  20 0d 2a ee 06 20 20 0d  2a f8 06 20 20 0d 2b 02  | .*..  .*..  .+.|
00006710  06 20 20 0d 2b 0c 06 20  20 0d 2b 16 06 20 20 0d  |.  .+..  .+..  .|
00006720  2b 20 06 20 20 0d 2b 2a  06 20 20 0d 2b 34 06 20  |+ .  .+*.  .+4. |
00006730  20 0d ff                                          | ..|
00006733