全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1179
推到 Plurk!
推到 Facebook!

Dbase Field Validation

答題得分者是:timhuang
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-06 05:36:10 IP:217.36.xxx.xxx 未訂閱
I am trying to do a input Item Code Validation consist of 3 digi. e.g. '001', however, because I want it to be a fixed 3 digi, it has to be either text or string. which integer validation won't be able to apply in this case: e.g. if 'edit1.text < 1 or > 201 then showmessage.'Valid'; I figured out doing a string validation would be unclever too, so it is possible to convert the string into integer, then perform an validtion.
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-06 10:59:55 IP:61.221.xxx.xxx 未訂閱
Hi, please use the TMaskEdit VCL to check user input data. As this example, set the EditMask property with 000;1;_ to perform the input validation.
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-04-06 15:08:37 IP:217.36.xxx.xxx 未訂閱
Can u explain the use of that futher? I am not familiar with this component thnx
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-04-06 21:24:57 IP:61.221.xxx.xxx 未訂閱
引言: Can u explain the use of that futher? I am not familiar with this component thnx
Sometimes we want to constrain the input data, we use this VCL. Here is the description of MaskEdit: Use a TMaskEdit object to put a masked edit control on your form. Masked edit controls validate the text the user enters against a mask that encodes the valid forms the text can take. The mask can also format text that is displayed to the user. The most important property of MaskEdit is EditMask. Here is the common Characters meaning in EditMask property: L -----The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z. l -----The l character permits only an alphabetic character in this position, but doesn't require it. A -----The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9. a -----The a character permits an alphanumeric character in this position, but doesn't require it. C -----The C character requires an arbitrary character in this position. c -----The c character permits an arbitrary character in this position, but doesn't require it. 0 -----The 0 character requires a numeric character only in this position. 9 -----The 9 character permits a numeric character in this position, but doesn't require it. Just look up the on-line help, you can find more important information about this component.
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-04-06 21:50:56 IP:217.36.xxx.xxx 未訂閱
so I just set mask property as: 000;1;_ then put my validation code inside the maskedit then I am done?
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-04-07 00:11:06 IP:61.221.xxx.xxx 未訂閱
引言: so I just set mask property as: 000;1;_ then put my validation code inside the maskedit then I am done?
Just set the EditMask property. And you have not to put any validation code into this component. It will validate the input with the EditMask property automaticlly.
系統時間:2024-11-22 17:22:34
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!