Kernel 8.0 APIs Banner [skip navigation]
Office of Information & Technology (OIT) Banner

$$VALIDATE^XLFIPV(): Validate IP Address Format

Reference Type: Supported, Category: IP Address Functions, Integration Agreement: 5844

Description

This extrinsic function validates the format of an IP address (either IPv4 or IPv6).

Format

$$VALIDATE^XLFIPV(ip)
Input Parameters: ip: (required) IPv4 or IPv6 address (string; in quotes) to be validated
Output: returns:
  • 1 — If the IP address is in a valid format.
  • 0 — If the format is invalid or null input.

 

Examples

Example 1
>S X=$$VALIDATE^XLFIPV(10.126.3.1)
>W X
1
  
Example 2
>S X=$$VALIDATE^XLFIPV(10.999.3.1)
>W X
0
  
Example 3
>S X=$$VALIDATE^XLFIPV(2001:db8::8a2e:370:7334)
>W X
1
  
Example 4
>S X=$$VALIDATE^XLFIPV(2001:db8::8g2h:370:7334)
>W X
0