Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP6 Writing to a search engine

Status
Not open for further replies.

eric43

Programmer
Joined
Apr 29, 2005
Messages
94
Location
AU
I have a variable laddr2( one of a number - but one will do as a sample).

I wish to make up a URL with this value -like
lcURL = "
lcURL = lcURL + "&addr2="+ MY VARIABLE HERE +"&icon=x"

I have tried brackets and & with the variables but have not been able to get the variable value itself into the string.

Any one able to help?

Thanks Eric
 
Could it be that you need to translate the spaces in your variable?

Code:
lcURL = "[URL unfurl="true"]http://www.multimap.com/map/places.cgi?lient=public"[/URL]
lcMyVar="MY VARIABLE HERE"
lcMyVar=STRTRAN(lcMyVar,CHR(32),[%20])
lcURL = lcURL + "&addr2=" + lcMyVar + "&icon=x"
?lcUrl
 
baltman

after much watching in the debugger I have used this technique - why i need to I don't know BUT it has just worked for me

Code:
passing line1 etc

lAddr2 = line1
lAddr3 = line2
lState = line3
lPc = line4
lDB = line5

then this for each variable
mydata = laddr2
mydata = lower(alltrim(mydata ))
addto = "&addr2="
myline = addto + mydata
lcURL = lcURL + myline
enabling me to watch each step in debugger.

I will try Ur suggestion later tonight - thanks

Eric
 
Upon additional reflection, I believe your problem is probably the '&' character. VFP is trying to interpret it as a macro substitution. Try using the chr function instead...

addto = CHR(38)+"addr2="
?addto

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top