Function

BoilerplateTemplateFieldsOK

Module

uTemplateFields

Last Modified

3/11/2015 8:41:54 AM

Scope

Interfaced

Declaration

function BoilerplateTemplateFieldsOK(const AText: string; Msg: string = ''): boolean;

Calls Hierarchy


BoilerplateTemplateFieldsOK
 └ListTemplateFields
   └GetTemplateField
     ├LoadTemplateFieldByIEN
     ├LoadTemplateField
     └TTemplateField.Create
       ├TemplateFieldCode2Field
       └TemplateDateCode2DateType

Called-By Hierarchy


                         BoilerplateTemplateFieldsOK
                           CheckBoilerplate4Fields┤ 
                                DoTemplateDialog┤ │ 
                    CheckBoilerplate4Fields...┤ │ │ 
                             TTemplate.GetText┘ │ │ 
                ExecuteTemplateOrBoilerPlate┤   │ │ 
                      TfrmDrawers.InsertText┤   │ │ 
           TfrmDrawers.tvTemplatesDblClick┤ │   │ │ 
            TfrmDrawers.tvTemplatesKeyDown┤ │   │ │ 
                TfrmDrawers.NewRECDragDrop┤ │   │ │ 
          TfrmDrawers.SetRichEditControl┘ │ │   │ │ 
                 TfrmDCSumm.FormCreate┤   │ │   │ │ 
               TfrmConsults.FormCreate┤   │ │   │ │ 
                TfrmSurgery.FormCreate┤   │ │   │ │ 
                  TfrmNotes.FormCreate┘   │ │   │ │ 
        TfrmDrawers.mnuInsertTemplateClick┘ │   │ │ 
  TfrmDCSumm.popSummMemoInsTemplateClick┤   │   │ │ 
TfrmConsults.popNoteMemoInsTemplateClick┤   │   │ │ 
 TfrmSurgery.popNoteMemoInsTemplateClick┤   │   │ │ 
   TfrmNotes.popNoteMemoInsTemplateClick┘   │   │ │ 
         TfrmDrawers.mnuPreviewTemplateClick┤   │ │ 
        TfrmDCSumm.popSummMemoPreviewClick┤ │   │ │ 
      TfrmConsults.popNoteMemoPreviewClick┤ │   │ │ 
       TfrmSurgery.popNoteMemoPreviewClick┤ │   │ │ 
         TfrmNotes.popNoteMemoPreviewClick┘ │   │ │ 
            TfrmDrawers.mnuCopyTemplateClick┤   │ │ 
            TfrmTemplateEditor.mnuBPTryClick┘   │ │ 
          TfrmTemplateEditor.tvTreeKeyDown┘     │ │ 
                                ShowTemplateData┘ │ 
        TfrmDrawers.mnuPreviewTemplateClick...┤   │ 
           TfrmTemplateEditor.mnuBPTryClick...┘   │ 
                            TdmodShared.TemplateOK┘ 
                       TfrmDrawers.InsertText...┤   
          TfrmDrawers.mnuPreviewTemplateClick...┤   
                TfrmDrawers.mnuCopyTemplateClick┤   
         TfrmTemplateEditor.mnuBPErrorCheckClick┘   
              TfrmTemplateEditor.tvTreeKeyDown┤     
           TfrmTemplateEditor.mnuBPTryClick...┘     

Calls

Name Declaration Comments
ListTemplateFields procedure ListTemplateFields(const AText: string; AList: TStrings; ListErrors: boolean = FALSE); -

Called-By

Name Declaration Comments
CheckBoilerplate4Fields procedure CheckBoilerplate4Fields(SL: TStrings; const CaptionText: string = ''; PreviewMode: boolean = FALSE); overload; -
TdmodShared.TemplateOK function TemplateOK(tmpl: TTemplate; Msg: string = ''): boolean; -


Source

881   function BoilerplateTemplateFieldsOK(const AText: string; Msg: string = ''): boolean;
882   var
883     Errors: TStringList;
884     btns: TMsgDlgButtons;
885   
886   begin
887     Result := TRUE;
888     Errors := TStringList.Create;
889     try
890       ListTemplateFields(AText, Errors, TRUE);
891       if(Errors.Count > 0) then
892       begin
893         if(Msg = 'OK') then
894           btns := [mbOK]
895         else
896         begin
897           btns := [mbAbort, mbIgnore];
898           Errors.Add('');
899           if(Msg = '') then
900             Msg := 'text insertion';
901           Errors.Add('Do you want to Abort ' + Msg + ', or Ignore the error and continue?');
902         end;
903         Result := (MessageDlg(Errors.Text, mtError, btns, 0) = mrIgnore);
904       end;
905     finally
906       Errors.Free;
907     end;
908   end;