With Delphi's macro, you can do some very easy work. It is the action of the record keyboard. If we use some regular actions, use the macro to operate, you can achieve the effect of half the effort, the premise is written in the code style compare. The macro starts with Ctrl Shift R, and is also played in Ctrl Shift R. After the Ctrl Shift P is started. After the enrollment is entered, you can see 'Recording' words in the status bar. The following following ASSIGN is an example, For example, we have a lot of variables DNO: String [20]; dWorker: string [4]; DTRITE: STRING [10]; DTRADE_E: STRING [10]; DTRADE_E: STRING [10]; DMONEY_SALE: REAL; DMONEY_LAST: REAL;
DMONEY_SS: REAL; DMAN: STRING [2]; // GAD DMONEY_SK: REAL; // Collection DMONEY_ZL: REAL; // Loss Money_Mode: Real; // Cash Payment Ticket_Mode: Real; // Cash ticket payment amount CZK_MODE: REAL; // Stored value card payment amount MZK_MODE: REAL; // Face value card payment Bank_Mode: real; // Bank card payment amount DCARD_ZK: STRING [20]; // Discovery card number DCARD_HL: String [20]; // Honglika number DSUBSHOP: STRING [4]; DSALESMAN: STRING [4]; // Salesperson We want to assign its value to an AsSign object value in Assign, as follows: Procedure TMasterData.AssignValue (ASource: TMasterData); begin // want following results dno: = ASource.dno; dworker: = ASource.dworker; ddate: = ASource.ddate; dtrade_s: = ASource.dtrade_s; dtrade_e: = ASource.dtrade_e; dmoney_sale: = Asource.dmoney_sale; DMONEY_LAST: = Asource.dmoney_Last; What should we do? First copy the statement, form the following procedure tmasterdata.assignvalue (asource: tmasterdata); begin DNO: String [20]; dWorker: String [4]; DDATE: TDATETIME; DTRADE_S: STRING [10]; DTRADE_E: STRING [10]; DMONEY_SALE: REAL DMONEY_LAST: REAL; .... At this time, let's put the focus on the DNO line, press CTRL Shift R to start recording, then press Ctrl -> arrow, the cursor will move to DNO's word front desk, then Press CTRL SHIFT ->, you will choose DNO: This section, how to do more characters, press SHIFT <- arrow twice, now completely select DNO, press Ctrl C, copy, and then Pressing the -> arrow, then press <- arrow back: Before, then pick up: = asource. These letters, press CTRL V Paste, now it is DNO: = asource.dno: string [ 20]; Cursor in the second: Before, we will clear the characters behind, press SHIFT END, then press the Delete button, then complete the first column, then for convenience, we will position the cursor to the second line First, press the arrow, then press the home button. This is all our buttons, we press CTRL SHIFT R to recording, press Ctrl Shift P to play, very cool, if you are very familiar with Delphi's macro, then We can make a lot of wonderful things, such as us often have update a set dnum = b.dnum in MSSQL, you can use Delphi's macro to complete. The key points of the record, 1 must Pay attention to writing code neat laws 2 Ctrl Shift >