GsTestRange - geostan_1 - 2024.01

GeoStan Geocoding Suite Reference for Windows, Linux, and z/OS

Product type
Software
Portfolio
Locate
Product family
GeoStan Geocoding Suite
Product
GeoStan Geocoding Suite > GeoStan
Version
2024.01
Language
English
Product name
GeoStan
Title
GeoStan Geocoding Suite Reference for Windows, Linux, and z/OS
Copyright
2024
First publish date
1994
Last updated
2024-07-29
Published on
2024-07-29T23:01:18.924000

Determines whether a house number falls within a range.

Syntax

GsFunStat GsTestRange(GsId gs, gs_const_str number,gs_const_str rangeLo, gs_const_str rangeHi);

Arguments

GsIdgs   ID returned by GsInitWithProps for the current instance of GeoStan. Input.

gs_const_strnumber       House number to test. Input.

gs_const_strrangeLo      Low house number in the range. Input.

gs_const_strrangeHi      High house number in the range. Input.

Return Values

Non-zero    Number is within the range.

0   Number is not within the range or GeoStan cannot make the comparison.

Prerequisites

GsInitWithProps()

Notes

GsTestRange() tests to see if the house number is within the range defined by rangeHi and rangeLo. It handles all valid house number patterns, such as

123
123A
A123
1A23
A1B23
1A23B
1-23
AB
 
 

This function uses USPS rules defined in Publication 28, "Postal Addressing Standards," to determine if a number is in range. For more information, refer to this publication on the USPS Website.

Some patterns are not comparable with other patterns; for example, 123 is not comparable to a range of 1A01 to 1A99.

Note: GsTestRange() does not respect parity.