ISPostCode.BelongsToRegion

Description

This function checks if the specified post code belongs to the region.

Syntax

object.BelongsToRegion(Region)

Part Attribute Type Description
object Required
The object always implements the ISPostCode interface
Region In, Required
The region related to the post code

Return Value

bool

Returns True if the specified post code belongs to the region.

Example

Display BelongsToRegion for the post code.

Dim aPostCode
Dim aMessage
Dim aRegions, aRegion
Dim i

set aPostCode = Profile.LookupPostCode("", "Mara", "CAN", "BC")
if aPostCode is nothing then
  exit sub
end if
set aRegions = aPostCode.Regions
  
aMessage =_
  "Country Code: " & VbTab & aPostCode.CountryCode & vbNewLine &_
  "Address 2: " & VbTab & aPostCode.Address2 & vbNewLine &_
  "Address 3: " & VbTab & aPostCode.Address3 & vbNewLine &_
  "Country Code: " & VbTab & aPostCode.CountryCode & vbNewLine &_
  "Post Code ID: " & VbTab & aPostCode.ID & vbNewLine &_
  "Latitude: " & VbTab & aPostCode.Latitude & vbNewLine &_ 
  "Longitude: " & VbTab & aPostCode.Latitude & vbNewLine &_     
  "Postal Code: "  & VbTab & aPostCode.PostalCode & vbNewLine &_
  "State Code: "  & VbTab & aPostCode.StateCode & vbNewLine &_
  "Regions Count: " & VbTab & aRegions.Count
  
for i = 0 to aRegions.Count - 1
  set aRegion = aPostCode.Regions.Item(i)
  aMessage = aMessage & vbNewLine &_
    "--- Region " & (i + 1) & " ---- " & vbNewLine &_  
    "    Code: " & VbTab & VbTab & aRegion.Code & VbTab & vbNewLine &_   
    "    Name: " & VbTab & aRegion.Name & vbNewLine &_  
    "    ID: " & VbTab & VbTab & aRegion.ID & vbNewLine &_
    "Belongs to Region '" & aRegion.Name & "' :" & aPostCode.BelongsToRegion(aRegion) 
next

Profile.MsgBox (aMessage)  
Note:

In Profile Client v8 on User Interface Region can be found in Maintain > Post Codes > Regions.

Version information

Added in v7.8.0