Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rebol[]
- errchk: func [fldblk errblk ][
- i: 0
- foreach [fld tp] fldblk[
- i: i + 1
- ;alert [ "tp" tp "fld" fld]
- if error? try reduce [tp fld/text] [errblk/:i/1: fld errblk/:i/2: "Failed to convert"]
- ]
- ]
- view gui: layout[
- vi: field
- vdc: field
- vdt: field
- vtm: field
- vmn: field
- button "val" [
- errblk: array [5 2]
- errblk copy []
- fldblk:[vi to-integer vdc to-decimal vdt to-date vtm to-time vmn to-money]
- errchk fldblk errblk
- either errblk/1/1 == none [
- alert "Good Entry"
- ][
- alert ["Errors" errblk/1/2]
- focus errblk/1/1
- return
- ]
- ]
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement