Postcode Lite Software providing Royal mail PAF data

Programmers SDK : Get Premises Level Address using our User Interface

Getting the address at premises level is simple, using one simple call to display a window for the user to search for the Premises Level address.   It then simply returns the address data if found.

Function : Function SearchForFullAddressWithDialogue(PostcodePrima As String, Caption As String,

          ShowLicienceDetails As Boolean, AllowManageAccount As Boolean, DisplayErrors As Boolean,

          DataKeyOrLocation$, Parms$) As Boolean

Parameter Description
PostcodePrima If left blank then the window allows the user to enter the postcode to find.  The search field can be primed by setting this parameter to the required postcode.
Caption Sets the title of the window
ShowLicenceDetails if TRUE, then shows license status on window
AllowManageAccount if TRUE, then allows user to go to web site to purchase licenses
DisplayErrors if TRUE, then allows program to show errors.  If off then will simply close and return errors in General_credits_display_text and General_errormessage
DataKey For Internet based data, use your data key, assigned when you opened an account.

When Postcode Lite is used within an organisation use the data key beginning with "I", and buy User licenses to access the data.
When supplying the address data to the general public, on a web site, use the data key beginning with "W" and purchase Web Credit Packs.


Location For Local Data, specify the location of the data files.
For example "C:\MyApp".  The correct license is assigned as part of the unlock process when using local data.
Parms This is for future expansion

Returns:

This function returns true if search returned valid data, else .General_errormessage will contain the error, and .General_credits_display_text if problem with license.

This PostCodeLite Object contains the following properties:

Property Description
General_errormessage Error Message if error
General_credits_display_text Number of Credits/Users available

We then call .GetFullAddressLineForSelection() to get each line to display, and keep the PostcodeLite object alive, since it knows the ID's which mach the lines displayed.

Example code : Visual Basic :

Dim PostCodeLite As Object, ReturnedData as string

 

Set PostCodeLite = CreateObject("IPostCodeLite.PostCode")

With PostCodeLite
  List.clear
  PostcodeToSearchFor = "PE13 2QL"
  If SearchForFullAddressWithDialogue(Me.txtPostcode, _
             "Get address using simple call to COM Object", _
             True, _
             True, _
             True, DataKey, DataPATH, "") Then
    'Process data

    Dim DataToShow$
    DataToShow = "Data Returned : " & vbCrLf
    DataToShow = DataToShow & " Status : " & .General_credits_display_text & vbCrLf
    DataToShow = DataToShow & " accountadminpage : " & .General_accountadminpage & vbCrLf
    DataToShow = DataToShow & "" & vbCrLf
    DataToShow = DataToShow & " Company : " & .Address_Organisation & vbCrLf
    DataToShow = DataToShow & " line1 : " & .Address_Line1 & vbCrLf
    DataToShow = DataToShow & " line2 : " & .Address_Line2 & vbCrLf
    DataToShow = DataToShow & " line3 : " & .Address_Line3 & vbCrLf
    DataToShow = DataToShow & " town : " & .Address_Town & vbCrLf
    DataToShow = DataToShow & " county : " & .Address_County & vbCrLf
    DataToShow = DataToShow & " postcode : " & .Address_Postcode & vbCrLf
    DataToShow = DataToShow & " country : " & .Address_Country & vbCrLf
    msgbox DataToShow
  Else
    'Show/Handle any errors
    MsgBox .General_credits_display_text & vbCrLf & .General_errormessage, vbCritical,
                  "Postcode Lite"
  End If

  'Show Credit/License in form caption
  Me.Caption = .General_credits_display_text
End With

set PostCodeLite = Nothing

 

 

 
Postcode Lite is brought to you by ComTek Accounts Ltd