B benxiong Unregistered / Unconfirmed GUEST, unregistred user! 2005-03-29 #1 小弟想将小于10000自然数变成定长字符串,字符串长度为4,字符串不够前面补0,不知怎样做,请大虾们帮忙。
B benxiong Unregistered / Unconfirmed GUEST, unregistred user! 2005-03-29 #2 小弟想将小于10000自然数变成定长字符串,字符串长度为4,字符串不够前面补0,不知怎样做,请大虾们帮忙。
J jfyes Unregistered / Unconfirmed GUEST, unregistred user! 2005-03-29 #3 //这样行不 procedure TForm1.Button1Click(Sender: TObject); var I: Integer; begin caption := format('%d', [100]); for I := 0 to 4 - Length(caption) - 1 do caption := '0' + Caption; end;
//这样行不 procedure TForm1.Button1Click(Sender: TObject); var I: Integer; begin caption := format('%d', [100]); for I := 0 to 4 - Length(caption) - 1 do caption := '0' + Caption; end;
A amao123 Unregistered / Unconfirmed GUEST, unregistred user! 2005-03-29 #4 for I := 1 to 9999 do Memo1.Lines.Add(Format('%.4d',));