ISRegion.ContainsPostCode

Description

This function checks if the specified region contains the selected post code.

Syntax

object.ContainsPostCode(PostCode)

Part Attribute Type Description
object Required
The object always implements the ISRegion interface
PostCode In, Required
The postcode related to the region

Return Value

bool

Returns True if the specified region contains the selected post code.

Example

Display ContainsPostCode for the region.

Dim aPostCode1, aPostCode2
Dim aRegions, aRegion
Dim aMessage
Dim i

set aPostCode1 = Profile.LookupPostCode("", "Mara", "CAN", "BC")
if aPostCode1 is nothing then
  exit sub
end if

set aPostCode2 = Profile.LookupPostCode("", "Mara", "CAN", "BC")
if aPostCode2 is nothing then
  exit sub
end if

set aRegions = aPostCode1.Regions
  
aMessage =_
  "Country Code: " & VbTab & aPostCode1.CountryCode & vbNewLine &_
  "Postal Code: " & VbTab & aPostCode1.PostalCode & vbNewLine &_
  "Regions Count: " & VbTab & aRegions.Count
  
for i = 0 to aRegions.Count - 1
  set aRegion = aPostCode1.Regions.Item(i)
  aMessage = aMessage & vbNewLine &_
    "------------------ Region " & (i + 1) & " ---------------- " & vbNewLine &_  
    "Code: " & VbTab & VbTab & aRegion.Code & VbTab & vbNewLine &_   
    "Name: " & VbTab & VbTab & aRegion.Name & vbNewLine &_  
    "ID: " & VbTab & VbTab & aRegion.ID & vbNewLine &_
    "Contains Post Code '" & aPostCode2.PostalCode & "' :" & VbTab &_
    aRegion.ContainsPostCode(aPostCode2) 
next

Profile.MsgBox (aMessage)  
Note:

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

See also

Version information

Added in v7.8.0