| BASIC CODE: VALIDATION |
| Examples of validation logic. |
|
|
| Code Example |
|
| * Checking to see if they input a number |
| if num(ANS) then |
| gosub good.value |
| end else |
| error.flag = 1 |
| end |
| * |
|
|
|
| * |
| * In this program snippet, we are check for a limited set of answers, each |
| * with it's own logical path |
| begin case |
| case MYINFO = "A" ; gosub do.addition |
| case MYINFO = "S" ; gosub do.subtraction |
| case MYINFO = "K" ; gosub do.known.formula |
| end case |
|
|
|
| * |
| * This time we want to iterate through a list |
| * and validate each element separately. |
| loop |
| CURRENT = FULL.LIST<1> |
| FULL.LIST = delete(FULL.LIST,1) |
| until FULL.LIST = '' do |
| if oconv(CURRENT,'MCA') = CURRENT then |
| * This is alphabetic, okay! |
| GOOD.LIST<-1> = CURRENT |
| end |
| repeat |
|
| Synonyms |
|
| See also |
CASE
| IF
| LOOP
|
| Categories |
ALL
| BRANCHING
|
More Details or Suggestions?
|
Updated from a Post-Relational data table on 10:18:30 23 Apr 2010
Courtesy of Key Ally, Inc.
More information at U2-Users Group
UniVerse is a Trademark of Rocket Software. Previous, IBM, Informix, Ardent, and vMark.
DMOZ
Wikipedia
|