You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Simple routine that validates parameters or variables.
2
+
3
+
Routine that can be used to perform input validation for any routine to ensure that parameters are present or a certain type. You can specify each possible type that the data value can represent and optionally require that the value have all of the types. Here are the generic types that can be used:
4
+
5
+
- required : If set, the value must be present and defined.
6
+
7
+
- array : If set, value supplied must be an array.
8
+
9
+
- number : If set, value supplied must be a number.
10
+
11
+
This routine uses IDL's `isa` function to make the comparison so, in addition to the types above, you can specify anything else that can pass as an argument. Some exampled are: byte, int, long, float, hash, orderedhash, enviraster. They can be any IDL-specific data type and it can also be the type of object such as idlgrwindow or any named, custom object type.
12
+
13
+
## Examples
14
+
15
+
See the PRO code on descriptions of the keywords.
16
+
17
+
### Validate that an argument is present and defined:
18
+
19
+
```idl
20
+
inputValidator, hash('nameOfArg', 'required')
21
+
```
22
+
23
+
Note that this means the variable is not undefined (i.e. defined in the IDL code or passed in as a parameter). A variable defined as `!NULL` will still pass.
24
+
25
+
### Validate that an argument is a string array and present
0 commit comments