|
Best of Support |
|
|
Automatic Lettering of Appendices |
|
Issue
How to automatically letter Appendices or Schedules.
Solution:
I thought I would post the results of an iterative process of reducing what was dozens of lines of code to just a few
single lines. The issue was how to create an incrementing Exhibit List where the exhibits were identified as Exhibit A, Exhibit B or Appendix I, Appendix II, etc. And then to use those Exhibit References in multiple places in the document.
Here is what I came up with after some help from your friends at GhostFill Tech Support.
At the top of the document, define two functions that will convert any number value to either A,B,C or I, II, III:
%[SetBlock('Alpha') |Sets Alpha caps converter]%[Scripts.Select('\Cypress', 'NumAlpha')]%[EndBlock()] %[SetBlock('Roman') |Set Roman caps converter]%[Scripts.Select('\Cypress', 'NumRoman')]%[EndBlock()]
The text of NumAlpha Script ("i" is a numeric index variable):
%[Element(i, 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,AZ', ',')| Conversion Utility from Numeric to Alphabetic from A to AZ. Need to pass the ExhNum to the script. Will return an ExhRef in the proper format]
The text of NumRoman Script:
%[Element(i,
'I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII,XIII,XIV,XV,XVI,XVII,XVIII,XIX,XX,XXI,XXII,XXIII,XXIV,XXV,XXVI,XXVII,XXVIII,XXIX,XXX,XXXI,XXXII,XXXII,XXXIII,XXXIV,XXXV,XXXVI,XXXVII,XXXVIII,XXXIX,XL,XLI,XLII,XLIII,XLIV,XLV,XLVI,XLVII,XLVIII,XLIX,L,LI,LII',',')| Conversion Utility from Numeric to Roman from I to LVII. Need to pass the ExhNum to the script. Will return an ExhRef in the proper format]
And in the document, run through a list of all potential exhibits and set the Exhibit/Appendix References Appendices Descriptions:
%[i = 0 |Set counter to zero]
%[KeepBlockIf(Deal.TypeMC = 'Competitive')]
Notice of Sale Notice of Sale:
%[Appendix.NoticeOfSaleMEM] (Appendix %[i = (i + 1); ^ExhNoticeOfSale = Alpha])
%[EndBlock()]
%[DeleteBlockIf((Deal.SecTypeMC = 'General Obligation'))]
Sum of Auth Res/Ord:
%[Appendix.AuthResSummaryMEM] (Appendix %[i = (i + 1) ; ^ExhSumAuthResOrd = Alpha])
%[EndBlock()]
Notice the counter "i" is set to zero and then incremented. Using the ^ the value of the script is invoked by the ALPHA block and result is both SET and displayed in the fillpoint. BTW: It is ever so frustrating how so much complexity is reduced to a few simple lines of reusable code.
Seth G. Rowland, Esq.
Additional Comment by Daniel Todes
I guess the "trouble" with GhostFill is that there are many ways to achieve the same result <g>. To Simplify Seth's model slightly, I would do the setting of "Alpha", "Roman", etc. inside a single script:
%[SetBlock('Alpha')]%[Element(i, 'A,B,C,D,E,F,G,H,I,J', ',')|etc.]%[EndBlock]
%[SetBlock('Roman')]%[Element(i,'I,II,III,IV,V,VI,VII,VIII,IX,X', ',')|etc.]%[EndBlock]
etc.
This single script needs to be loaded only once and thereafter as per Seth's example, you could at any point execute %[Alpha] or %[Roman] to get the required incremented number, assuming that "i" has been set correctly at that point.