1: Plate the template characters in the database, form a linked table structure, and read from the database when needed, as shown below:
Using an array analog linked list, then read by the program, the Delphi code is as follows:
procedure TForm1.Button1Click (Sender: TObject); var sql: string; var str2: string; begin RichEdit1.Clear; Mem1.Clear; ADOQuery1.Close; ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add ( 'Select * from 1_WZ WHERE ID = 1 '); adoQuery1.open; while not adoquery1.isempty do begin if adoquery1.fieldbyname (' nl '). Asboolean = true kilin str2: = STR2 # 13; END;
Str2: = str2 adoQuery1.fieldByname ('wtext'). asstring; sql: = adoQuery1.fieldbyname ('wnext'). asstring; if SQL = '' Then Break; sql: = 'SELECT * FROM 1_WZ where id =' SQL; AdoQuery1.close; adoquery1.sql.clear; adoQuery1.sql.add (sql); adoquery1.open; end; mem1.lines.add (str2); richedit1.clear; richedit1.Lines.Add (str2); END;
The effect is shown as follows: