Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Google Address Verification?
Message
From
22/04/2009 12:52:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01395898
Message ID:
01395922
Views:
117
Bingo! I should have known that. I have a "Map" button for all addresses that uses that URL syntax.

Thanks to both of you.

>Try
>
>*- Google maps address verification
>=YGoogleMapSearch("11 Chestnut Ridge, Tannersville PA")
>RETURN
>
>*
>PROCEDURE YGoogleMapSearch
>LPARAMETERS lcAddress
>#DEFINE READYSTATE_COMPLETE 4
>CLEAR
>IF NOT (TYPE("oIE")="O" AND NOT ISNULL(oIE))
>	oIE = CREATEOBJECT("InternetExplorer.Application")
>ENDIF
>
>oIE.VISIBLE=.T.
>lcURL="http://maps.google.com?q=" + lcAddress
>
>oIE.NAVIGATE(lcURL)
>
>DO WHILE oIE.Readystate <> READYSTATE_COMPLETE
>	WAIT WIND TIME 1.0 ""
>ENDDO
>
>DO CASE
>CASE "Did you mean:" $ oIE.DOCUMENT.body.innerText
>	lcresult = SUBSTR(oIE.DOCUMENT.body.innerText, AT("Did you mean:",oIE.DOCUMENT.body.innerText))
>	?LEFT(lcresult,AT(CHR(13),lcresult))
>	?SUBSTR(lcresult,AT(CHR(13),lcresult)+2,AT(CHR(13),lcresult,2) -AT(CHR(13),lcresult)-1)
>
>CASE "Address:"+CHR(13) $oIE.DOCUMENT.body.innerText
>
>	lcresult= SUBSTR(oIE.DOCUMENT.body.innerText, AT("Address:"+CHR(13),oIE.DOCUMENT.body.innerText))
>	lcout=lcresult
>	ilines=1
>
>	DO WHILE lcout <> "A." AND ilines<5
>		?LEFT(lcout,AT(CHR(13),lcout)-1)
>		lcout=SUBSTR(lcout,AT(CHR(13),lcout)+2)
>		ilines=ilines+1
>	ENDDO
>
>OTHERWISE
>	lcresult = oIE.DOCUMENT.body.innerText
>	STRTOFILE(lcresult,'temp.txt')
>
>ENDCASE
>
>
>RETURN
>
>>Here's the entire code. I added your CASE, but I still get the same result in the TEMP.TXT file. The code is in a file TEMP.PRG and I just enter DO TEMP from the command window.
Ray Roper
Previous
Reply
Map
View

Click here to load this message in the networking platform