Home > Back-end >  TPrinter doubt, for help
TPrinter doubt, for help

Time:10-03

New one, ask questions about TPrinter use:
Everyone in the I see online example is
TPrinter * Prn=Printer ();
//and then set the parameters and then perform the following two sentences:
Prn - & gt; BeginDoc ();
.
Prn - & gt; EndDoc ();
There is no need to new and delete excuse me? The executed multiple times I print command, for example, will the footprint is bigger and bigger?
And I found that if I don't declare instance TPrinter * Prn=Printer (); With TPrinter directly () to perform all also can command, this and what is the difference between the above, please?

Thank you all for your help!!!!!!

CodePudding user response:

Rest assured, will not increase your memory,
If you think you can increase the memory, any function that you can't define a pointer variable,
Can't write code, ha ha
 

TPrinter * P=Printer ();
P - & gt; BeginDoc ();
P - & gt; Canvas - & gt; The Font - & gt; Size=14;
P - & gt; Canvas - & gt; The Font - & gt; Name="tahoma";

Ss=coyear - & gt; The Text;
X=ini - & gt; ReadInteger (" Position ", "the starting year x", 290);
Y=ini - & gt; ReadInteger (" Position ", "the starting year y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (+ 160 x, y, ss);//year

Ss=comonth - & gt; The Text;
X=ini - & gt; ReadInteger (" Position ", "starting in x", 290);
Y=ini - & gt; ReadInteger (" Position ", "y" in starting, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (+ 270 x, y, ss);//the month

Ss=coday - & gt; The Text;
X=ini - & gt; ReadInteger (" Position ", "x" start date, 290);
Y=ini - & gt; ReadInteger (" Position ", "y" start date, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (+ 350 x, y, ss);//day
Ss=Edit2 - & gt; The Text;//funds unit code
X=ini - & gt; ReadInteger (" Position ", "imposing unit code x", 290);
Y=ini - & gt; ReadInteger (" Position ", "y" imposing unit code, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
Ss=Edit3 - & gt; The Text;//bill number
X=ini - & gt; ReadInteger (" Position ", "payment number x", 290);
Y=ini - & gt; ReadInteger (" Position ", "y" payment number, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 140, y + 60, ss);
Ss=Edit6 - & gt; The Text;//the
X=ini - & gt; ReadInteger (" Position ", "x" client, 290);
Y=ini - & gt; ReadInteger (" Position ", "y" client, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 140, y + 60, ss);

Ss=ComboBox1 - & gt; The Text;//collection way
X=ini - & gt; ReadInteger (" Position ", "payment methods" x, 290);
Y=ini - & gt; ReadInteger (" Position ", "payment methods" y, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 750, y + 60, ss);

Ss=Edit49 - & gt; The Text;
P - & gt; Canvas - & gt; The Font - & gt; Size=12;
X=ini - & gt; ReadInteger (" Position ", "project code 1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "1 y" project code, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (+ 195-30 x, y, ss);//serial number

Ss=Edit8 - & gt; The Text;
P - & gt; Canvas - & gt; The Font - & gt; Size=14;
X=ini - & gt; ReadInteger (" Position ", "charging items 1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "charging items 1 y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 120, + 195, y ss);//charging projects

Ss=Edit17 - & gt; The Text;
X=ini - & gt; ReadInteger (" Position ", "units 1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "unit 1 y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 390, + 195, y ss);//

Ss=Edit26 - & gt; The Text;
X=ini - & gt; ReadInteger (" Position ", "number 1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "number 1 y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 510, + 195, y ss);//the number of

Ss=ComboBox2 - & gt; The Text;
P - & gt; Canvas - & gt; The Font - & gt; Size=10;
X=ini - & gt; ReadInteger (" Position ", "charge standard 1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "charge standard 1 y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 600, + 195, y ss);//charge standard

P - & gt; Canvas - & gt; The Font - & gt; Size=14;
Ss=Edit4 - & gt; The Text;//millions
X=ini - & gt; Millions ReadInteger (" Position ", "1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "1 y" million, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 740, + 195, y ss);

Ss=Edit7 - & gt; The Text;//the,
X=ini - & gt; ReadInteger (" Position ", and "hundreds of 1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", and "hundreds of 1 y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);

//P - & gt; Canvas - & gt; TextOut (x + 770, + 195, y ss);

Ss=Edit10 - & gt; The Text;//
X=ini - & gt; ReadInteger (" Position ", "1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "1 y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 800, + 195, y ss);

Ss=Edit11 - & gt; The Text;//m
X=ini - & gt; ReadInteger (" Position ", "qian 1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "1 y" thousand, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 830, + 195, y ss);

Ss=Edit12 - & gt; The Text;//hk
X=ini - & gt; ReadInteger (" Position ", "1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "1 y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 860, + 195, y ss);

Ss=Edit13 - & gt; The Text;//10
X=ini - & gt; ReadInteger (" Position ", "1 x 10", 290);
Y=ini - & gt; ReadInteger (" Position ", "1 y" 10, 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 890, + 195, y ss);

Ss=Edit14 - & gt; The Text;//a
X=ini - & gt; ReadInteger (" Position ", "yuan 1 x", 290);
Y=ini - & gt; ReadInteger (" Position ", "yuan 1 y", 232);
P - & gt; Canvas - & gt; TextOut (x, y, ss);
//P - & gt; Canvas - & gt; TextOut (x + 920, + 195, y ss);
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related