Delphi PChar && String ³öÏÖµÄÎÊÌâ
function mf_AddZero_Righ(ShuJuP:PChar;ChangDu:Integer):PChar;
var
restr:string;
strlength,i:integer;
ShuJu:string;
begin
ShuJu:=strpas(ShuJuP);
restr:=ShuJu;
strlength:= Length(ShuJu);
for i:= strlength to ChangDu-1 do
begin
restr:='0'+restr;
end;
Result:=PChar(restr);
end;
ÕâÀïÒ»¸öÍê³É×óÆð²¹Æë×Ö·û´®µÄ function £¬ÔÚ²âÊÔÖз¢ÏÖ
.......
mf_AddZero_Righ('3',9);
.......
µÃµ½µÄ½á¹ûÊÇ 000000003
.......
mf_AddZero_Righ('123456789',9);
µÃµ½Êǽá¹ûÈ´ÊÇ 12345678
¸ßÊÖÃÇÕâÊÇÎÊʲôÄÄ £¿£¿£¿
ǧÍò²»Òª½«Õ»ÉϵÄÊý¾Ý×öΪº¯ÊýÊä³öµÄÊý¾Ý, Ò²¾ÍÊǾֲ¿±äÁ¿²»ÄÜÓÃÀ´Êä³ö, ÒòΪº¯Êý½áÊøÊ±,Õ»Êý¾Ý¶¼»á±»¶í»ØÊÕ, ÄãÕâÀïµÄÒªÇóʵ¼ÊÉÏÓú¯Êý±íʾʵ¼ÊÉÏÊÇ
function ExtStrLen(const source: string; fillchar: Char; MaxLength: integer): string;
var
len:Integer;
begin
Result := source;
len := MaxLength - Length(source);
if Len > 0 then
Result := StringOfChar(fillchar, len) + Result;
end;
µ÷ÓÃʱΪ ExtStrLen('1234', '0', 8) ×îºó½á¹ûÊÇ00001234
function mf_AddZero_Righ(ShuJuP:PChar;ChangDu:Integer):PChar;
var
re
Ïà¹ØÎÊ´ð£º
ÎÒ°²×°µÄÊÇÆóÒµ°æ¡£¡£¡£
ÎÒÎÊÏ£¬ CTRL+×ó¼ü Äܲ鿴 windows.pas Âð£¿
¾ÍÊÇ ½Ó¿ÚÀïµÄwindows¡£
µ±È»¿ÉÒÔ,CTRL+×ó¼üµã»÷Interface²¿·ÖµÄWindows¾Í¿ÉÒÔÁË
ɶɶÆóÒµ°æ£¿È¥°²×°Ä¿Â¼¿´¿´libÎļþ¼ÐÏÂÓÐÃ»Ó ......
·µ»ØµÄÄÚÈÝÊÇÈçÏ´úÂë,ÔõôÄÜÇþµÀ2b?
<p class="text1">1a </p>
<p class="text1">2b </p>
<p class="text1">3c </p>
<p cl ......
¼±Óá£ÁªÏµQQ£º8775262£¬Ð»Ð»¡£
ÐèÒª½øÐÐDllImportµÄµØ·½Ö±½ÓдDLLImport.·½·¨Ãû¡£
È磺DLLImport.GlobalAddAtom(¡¡);
Îļþ£ºUShare.pas
Delphi(Pascal) code:
unit UShare;
interface
uses Windows, Me ......
procedure TForm4.BitBtn2Click(Sender: TObject);
begin
if (Trim(ComboBox2.Text) <>'')and(Trim(Edit3.Text) <>'')then
begin
with ADOQuery1 do ......
Çë½ÌÒ»¸öÎÊÌ⣬ÏÖÔÚÓÐÒ»ÏîÄ¿ÐèÒª»æÖÆÇúÏßͼ£¬
ÒªÇ󣺣¨¿ÉÒÔÈÎÒâÑ¡Ôñºá×ø±ê£¨Ê±¼ä£©·¶Î§»³ö¶ÔÓ¦µÄÊý¾ÝÇúÏߣ¬×Ý×ø±ê×Ô¶¯ÓÅ»¯ÉèÖÃ(Ò²¿ÉÊÖ¹¤Ñ¡Ôñ)£¬¿ÉÒÔÔÚÈÎÒâʱ¼ä¶ÎÄÚ·Å´ó¡¢ËõСͼÐΣ¬Ä³¾ßÌåÊý¾ÝµãµÄ¶¨Î»¼°´ËÊý¾ÝµãµÄ ......