Procedure

ConvertCodes2Text

Module

uTemplateFields

Last Modified

3/11/2015 8:41:54 AM

Scope

Interfaced

Declaration

procedure ConvertCodes2Text(sl: TStrings; Short: boolean);

Calls Hierarchy


ConvertCodes2Text
 ├TemplateFieldCode2Field
 └TemplateDateCode2DateType

Called-By Hierarchy


                        ConvertCodes2Text
  TfrmTemplateFields.cboObjectsNeedData┤ 
TfrmTemplateFieldEditor.cbxObjsNeedData┘ 

Calls

Name Declaration Comments
TemplateDateCode2DateType function TemplateDateCode2DateType(const Code: string): TTmplFldDateType; -
TemplateFieldCode2Field function TemplateFieldCode2Field(const Code: string): TTemplateFieldType; -

Called-By

Name Declaration Comments
TfrmTemplateFields.cboObjectsNeedData procedure cboObjectsNeedData(Sender: TObject; const StartFrom: String; Direction, InsertAt: Integer); -
TfrmTemplateFieldEditor.cbxObjsNeedData procedure cbxObjsNeedData(Sender: TObject; const StartFrom: String; Direction, InsertAt: Integer); -


Source

956   procedure ConvertCodes2Text(sl: TStrings; Short: boolean);
957   var
958     i: integer;
959     tmp, output: string;
960     ftype: TTemplateFieldType;
961     dtype: TTmplFldDateType;
962   
963   begin
964     for i := 0 to sl.Count-1 do
965     begin
966       tmp := sl[i];
967       if piece(tmp,U,4) = BOOLCHAR[TRUE] then
968         output := '* '
969       else
970         output := '  ';
971       ftype := TemplateFieldCode2Field(Piece(tmp, U, 3));
972       if ftype = dftDate then
973       begin
974         dtype := TemplateDateCode2DateType(Piece(tmp, U, 5));
975         output := output + TemplateDateTypeDesc[dtype, short];
976       end
977       else
978         output := output + TemplateFieldTypeDesc[ftype, short];
979       SetPiece(tmp, U, 3, output);
980       sl[i] := tmp;
981     end;
982   end;