str to cardinal 的问题 |
|
wpf
一般會員 ![]() ![]() 發表:11 回覆:22 積分:6 註冊:2002-04-14 發送簡訊給我 |
|
wpf
一般會員 ![]() ![]() 發表:11 回覆:22 積分:6 註冊:2002-04-14 發送簡訊給我 |
Function StrToCardinal(Const S: String): Cardinal;
Begin If not TryStrToCardinal(S, Result) Then Raise EConvertError.Create(Format('''%s'' n''est pas une valeur entière correcte', [S])); End; Function StrToCardinalDef(Const S: String; Default: Cardinal): Cardinal; Begin If not TryStrToCardinal(S, Result) Then Result := Default; End; Function TryStrToCardinal(Const S: String; out Value: Cardinal): Boolean; Var tmpInt: Int64; Begin Result := False; If TryStrToInt64(S, tmpInt) Then If not ((tmpInt begin Value := tmpInt; Result := True; Exit; end; End; |
washare
初階會員 ![]() ![]() 發表:14 回覆:36 積分:35 註冊:2006-10-17 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |