It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Can anyone help me to check this function?

Moderator: dafunkymunky

Can anyone help me to check this function?

Postby zargus on Mon Feb 12, 2007 10:26 am

Actually I am trying to create a function that can identify a postcode from a 'string' of address. The function should be able to verify the 5 digits (the postcode) which are located next to each other. The function that I have cannot function properly. Here is the function:

========================================
Function getpostcode (value)

dim leng As Integer
dim pc As String

For
leng=1 To len (value)
pc=mid(value,leng,1)
End if

If Is Numeric (pc) Then
pc=mid(value, leng,2)
End If

...........................

If Is Numeric (pc) =5 Then
getpostcode=pc
leng=Len (value) + 1
End If

Next leng
End Function
=========================================


I really hope there's someone out there can help me to correct the function. Thanks for your attention :wink:
zargus
 
Posts: 0
Joined: Mon Feb 12, 2007 9:43 am

Who is online

Users browsing this forum: No registered users and 5 guests