Advertisement
johnorork

Untitled

Apr 21st, 2014
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. rebol[]
  2. errchk: func [fldblk errblk ][
  3. i: 0
  4. foreach [fld tp] fldblk[
  5. i: i + 1
  6. ;alert [ "tp" tp "fld" fld]
  7. if error? try reduce [tp fld/text] [errblk/:i/1: fld errblk/:i/2: "Failed to convert"]
  8. ]
  9. ]
  10. view gui: layout[
  11. vi: field
  12. vdc: field
  13. vdt: field
  14. vtm: field
  15. vmn: field
  16.  
  17. button "val" [
  18. errblk: array [5 2]
  19. errblk copy []
  20. fldblk:[vi to-integer vdc to-decimal vdt to-date vtm to-time vmn to-money]
  21. errchk fldblk errblk
  22. either errblk/1/1 == none [
  23. alert "Good Entry"
  24. ][
  25. alert ["Errors" errblk/1/2]
  26. focus errblk/1/1
  27. return
  28. ]
  29. ]
  30. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement