Advertisement
Guest User

Untitled

a guest
Sep 9th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.41 KB | None | 0 0
  1. V := Validator.Create();
  2. V.AddRule(
  3.         function(myForm : TMyForm)
  4.         begin
  5.             result := myForm.TEdit1;
  6.         end;
  7.     ).NotEmpty().IsInteger().WithMessage('Must be an integer value');
  8.  
  9. V.AddRule(
  10.         function(myForm : TMyForm)
  11.         begin
  12.             result := myForm.TEdit2;
  13.         end;
  14.     ).NotEmpty().IsFloat().WithinRange(0,1000).WithMessage('Must be an floating point value between 0 and 1000');
  15.  
  16.  
  17. if not V.Validate() then;
  18.    ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement