• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Validating and Formatting Data > USING VALIDATION ROUTINES

USING VALIDATION ROUTINES

You can think of a validation routine as a mini-scripting machine within your project that validates the data it receives and then acts accordingly (based on whether that data is valid or invalid). As such, most validation routines comprise functions composed primarily of conditional (if ) statements.

It’s typical to split validation routines into separate functions, one for each type of data to be validated (for example, one function for validating strings, another for numbers, and so on). This allows you to script a function once and then use it anywhere in your project, as opposed to writing the validation routine repeatedly whenever a certain type of data needs to be validated.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint