Dbase Field Validation |
答題得分者是:timhuang
|
Vashee
初階會員 發表:38 回覆:87 積分:25 註冊:2003-03-31 發送簡訊給我 |
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 發送簡訊給我 |
|
Vashee
初階會員 發表:38 回覆:87 積分:25 註冊:2003-03-31 發送簡訊給我 |
|
timhuang
尊榮會員 發表:78 回覆:1815 積分:1608 註冊:2002-07-15 發送簡訊給我 |
引言: Can u explain the use of that futher? I am not familiar with this component thnxSometimes 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 發送簡訊給我 |
|
timhuang
尊榮會員 發表:78 回覆:1815 積分:1608 註冊:2002-07-15 發送簡訊給我 |
引言: 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. |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |