Object relationship

xiaoxiao2021-03-06  42

Today, I took the end of the first stage code. I spent some key objects once. Now I have a lot of time. It seems that I use test driver development, still better, although it looks Time spent, but there is a bottom, and it also reduces some jobs to test, and it is no longer so timid when reconstructing. One thing is not used to Dunit is that unlike other automated test tools, it can be handled on the interface. Although the code and interface relationship is not big, sometimes it is still unable to miss something. Today, I'll know today. When writing the code, I found that A object relies on B objects. I found that there are several new features to make B objects depend on A object. This is really bad, first is lazy in B The object is referenced to a object, run the test, passed, and then proposed an interface in the A object, it is used to access the B object, this is right, but I don't know if someone knows that my intentions are not, and the memories are less It took a large section of a flower. 2, there are three objects A, B, C, relationship is TB = Class ......... End TC = Class ... End; ta = Class B: TB; CS: TobjectList; / / Saved here is a collection of TC, I really want to use a TCS object. First, it can be packaged, and the other is to look smoothly. 3, rename some variables, there are some variables to get better, but later due to the increase in new features, it is found that the variable will be misunderstood, spend a few minutes to name them or worth it. Still old, first change the name, run again, which error is changed, which is more insurance than Search, is fast. 4, in MSSQL to write a encrypted algorithm, for a long time, I found that MSSQL did not support converted into a hexadecimal, and finally found that it is much more than checked. It is not a few minutes. I am really lazy, this is not a good habit of programmers, and I found that the STR function will cause excess space. 5, I want to access the Paradox table through OpenDataSource in MSSQL, but unfortunately, I haven't found a solution for a long time. I have access to Access is ok, access to Paradox, I want OLEDB-"ODBC-" Paradox, theoretical Why don't I prompt no permissions or there is no corresponding table, it is really depressed. 6, afternoon and a colleague discussed the way to generate the HTML form, the colleagues are really blame, I want to use this control, use that control, the result is not good, it is not good to define, I have to spend a long time to write. No way, can only take the old age.

I divide the form into a header, row (field name, value), column, three parts, stored in the INI file, then read data from the data table, generate string in turn, the result, this effect is still very good Unlike that kind of

... ..
. . deadboard, you cannot change the properties of the table, and you can also use the style paper. Oh, it is worth sending, the code is very simple, but it is still to stick it. var I: Integer; tmpStringList: TStringList; IniFile: TIniFile; tmpStr: string; tmpStr1: string; tmpCol1: string; tmpCol2: string; begin IniFile: = TIniFile.Create (ExtractFilePath (Application.ExeName) 'grid.ini') ; tmpStringList: = TStringList.Create; try tmpStringList.Append (IniFile.ReadString ( 'grid', 'Table_B', '')); tmpStringList.Append (IniFile.ReadString ( 'grid', 'Row_Title_B', ' ')); TMPSTR: = INIFILE.ReadString (' grid ',' colorn_title_b ',' '); tmpstr1: = INIFILE.ReadString ('grid', 'row_content_1_e', '');

TMPCOL1: = INIFILE.Readstring ('grid', 'colorn_content_b', '

'); TMPSTR1: = INIFILE.ReadString (' grid ',' colorn_title_e ',' ' ); For i: = 0 to adoQuery1.fieldcount - 1 do begin tmpstringlist.append (tmpstr adoquery1.fields [i] .fieldname tmpstr1);

TmpstringList.Append (InIfile.Readstring ('grid', 'row_title_e', ''));

Tmpstr: = INIFILE.ReadString ('grid', 'row_content_1_b', '

'); TMPCOL2: = INIFILE.ReadString ('grid', 'color_content_e', '');

Adoquery1.last; adoquery1.prior; adoQuery1.prior; // Data too much, display three bar .While not adoquery1.eof do begin tmp file (tmpstr); for i: = 0 to adoquery1.fieldcount - 1 do begin TmpstringList.Append (TmpCol1 AdoQuery1.fields [i] .sstring tmpcol2); end; tmpstringlist.append (tmpstr1);

Adoquery1.next; end;

TmpStringList.Append ('grid', 'table_e', '')); Finally Memo1.Lines.Assign (TmpstringList); TmpStringList.Free; InIfile.Free; End; Profile as follows [Grid ] Table_b =

// Where the style paper is placed here, the properties of the table are still very nice. Table_e =

Row_title_b =

// field of properties are here defined here, anyway, read. Row_title_e =

Column_title_b =

row_content_1_e = row_content_2_b =
Column_title_e =

Row_content_1_b =

row_content_2_e = row_content_3_b = row_content_3_e =

COLUMN_CONTENT_B =

COLUMN_CONTENT_E =

转载请注明原文地址:https://www.9cbs.com/read-75072.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.027, SQL: 9