1 line
12 KiB
Plaintext
Raw Normal View History

2023-03-04 03:45:20 +01:00
load 'macros.dump' include 'driver.equ' include 'wp.equ' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT D_BeachBall IMPORT CaretOff IMPORT D_ClearPrintFlags IMPORT D_CloseWordBox IMPORT X_CopyWPScrap IMPORT W_CurDoc IMPORT W_DeleteRange IMPORT X_DisposeWPScrap IMPORT W_FindLine IMPORT W_GetAddr IMPORT D_GetPrintHandle IMPORT D_KillFont IMPORT W_LastP IMPORT W_MakeCaret IMPORT D_MemoryError IMPORT D_NeedHandle IMPORT W_PasteText IMPORT D_PrJobDialog IMPORT W_PrintDoc IMPORT D_PrintToIW IMPORT D_PrintToLW IMPORT W_RecutDoc IMPORT W_SelectOff IMPORT W_SelectOn IMPORT D_SendMessage IMPORT D_SetCursor IMPORT W_UpdateDoc IMPORT W_VerifyMergeDB IMPORT D_WordBox IMPORT W_EndLine IMPORT W_EndOffset IMPORT W_EndPar IMPORT W_PHandle IMPORT W_PPtr IMPORT W_Selected IMPORT W_StartLine IMPORT W_StartOffset IMPORT W_StartPar import D_MyID import D_ToolID ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY W_GetFieldScrap ENTRY W_MergeDocName ENTRY W_MergeDocWin ENTRY W_PutFieldData ENTRY W_fieldstr ENTRY W_numrecStr ENTRY W_oldphand ENTRY W_oldelin ENTRY W_oldeoff ENTRY W_oldepar ENTRY oldsel ENTRY W_oldslin ENTRY W_oldsoff ENTRY W_oldspar ENTRY W_pmMessage ENTRY W_recStr ******************************************************************** * * Includes... * * Wednesday, May 3, 1989 2:28:52 AM ******************************************************************** **************************************************************** * * W_PrintMerge * **************************************************************** W_PrintMerge PROC EXPORT ;Using D_GlobalData ;Using WPGlobals ;Using W_PMergeData local hsize:l,scrap:l,docscrap:l local numrecs:w,rec:w,temp:l local par:w,oldLastP:w,IWFlag:w,LWFlag:w error oops begin +b ; Verify that a merge database window exists. If not then simply exit. stz oops jsl W_VerifyMergeDB bcc gotdoc brl bye ; Tell D_DB to swap in its active data. { D_Startup Message } gotdoc tool _PurgeAll,in=(>D_MyId:w) tool _PurgeAll,in=(>D_ToolID:w) tool _CompactMem spacelong pushword #3 pushword #$1305 pushlong W_MergeDocWin jsl D_SendMessage pulllong ax ; Ask D_DB for the number of records/fields currently active in W_Document { Count } spacelong pushword #3 pushword #$1301 pushlong W_MergeDocWin jsl D_SendMessage pullword numrecs plx ; Convert number of records into a string to be displayed in word box. gotnum pushword numrecs pushlong #W_numrecStr+1 pushword #4 ; length pushword #0 ; unsigned _Int2Dec ; Get job dialog. If user cancels or error occurs in job dialog then exit ; after shutting down the database. spaceword spacelong pushlong W_CurDoc jsl D_GetPrintHandle jsl D_PrJobDialog sta oops pla jeq D_Shutdown lda oops jne D_Shutdown ; D_Save current print flags; clear them initially. lda >D_PrintToIW sta IWFlag lda >D_PrintToLW sta LWFlag jsl D_ClearPrintFlags ; Get size of W_Document paragraph array W_Handle and D_Save old W_Document paragraph W_Handle. spacelong pushlong W_PHandle _GetHandleSize pulllong hsize movelong W_PHandle,W_oldphand ; Make sure port is set to current D_WP W_Document. pushlong W_CurDoc _SetPort jsl D_KillFont ; SRP, et al, 4/6/89 ; D_Save globals that will be changed so they can be restored latter. moveword W_Selected,oldsel moveword W_StartPar,W_oldspar moveword W_StartLine,W_oldslin moveword W_StartOffset,W_oldsoff moveword W_EndPar,W_oldepar moveword W_EndLine,W_oldelin moveword W_EndOffset,W_oldeoff moveword W_LastP,oldLastP ; added by MRH (3/13/89) ; Turn W_Caret off and deselect. jsl CaretOff jsl W_SelectOff ; Fake a D_WP scrap containing the entire W_Document; initially allocated as X_Locked. spacelong add