Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Google Address Verification?
Message
From
22/04/2009 12:19:58
 
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:
01395914
Views:
98
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.
*****************************************************************
*- 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/"

oIE.Navigate(lcURL)

do while oIE.Readystate <> READYSTATE_COMPLETE
	wait wind time 1.0 ""
enddo

oShell = CreateObject("WScript.Shell")
lnstart=second()

do while not oShell.AppActivate(OIE.DOCUMENT.title) and second()-lnstart <=10
	wait wind time 1.0 "Entering ..."
ENDDO

if oShell.AppActivate(OIE.DOCUMENT.title)
    oShell.SendKeys(lcAddress+"{ENTER}")
    WAIT WINDOW TIMEOUT 1.0 ""

     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
endif

RETURN

*****************************************************************
Ray Roper
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform