Error message: OpenURL statement url is malformed


#1

I’m helping a friend convert some very large and complex databases from Panorama 6.0 to Panorama X and I need some help. This code:

local mapURL,mapRoot,mapStreet,mapCity,mapState,mapZip,mapCountry
mapStreet=«SERV.ADDRESS»
mapCity="Las Vegas"
mapState="NV"
mapZip=«SRV.ZIP»
mapRoot="http://batchgeo.com/map/?i=<redacted code>&q="

mapURL=mapRoot+arraystrip(replace(mapStreet+" "+mapCity+" 
"+mapState+" "+mapZip," ","+"),"+")

shellopendocument mapURL

produces this message:

18%20am

The code is supposed to display the Serv.Address location in Google Maps. The code uses a variable called mapURL which is not good given that Panorama X has a function, mapurl(, but changing that makes no difference.

If I put

http://maps.google.com/maps?q=8255+Hickam+Av+Las+Vegas
NV+89129

into Safari I get the correct map display.


#2

Seems to be an embedded return in the quoted space between mapCity and mapState.


#3

For Panorama X, I would recommend using the mapurl( function instead of “rolling your own”

I’ve never heard of batchgeo.com before. Looks like it is a paid mapping service. If you want to use that, I think Gary is correct about the carriage return.


#4

I saw that too but, when I removed it, I got this:

01%20am

Using the openurl statement instead of openanything, it seems that the content of the url string can be quite flexible. These all work:

openurl "http://www.google.com/maps/place/8255+Hickam+Ave,+Las+Vegas,+NV+89129,+USA"
openurl "http://www.google.com/maps/place/8255 Hickam Ave, Las Vegas, NV 89129, USA"
openurl "http://www.google.com/maps/place/8255 Hickam Ave Las Vegas NV 89129"

but I’m having great difficulty constructing them.


#5

These both work (with the variable name changed for neatness):

ABmapURL=mapRoot+arraystrip(mapStreet+", "+mapCity+", "+mapState+", "+mapZip," ")
ABmapURL=mapRoot+arraystrip(mapStreet+" "+mapCity+" "+mapState+" "+mapZip," ")

Mission accomplished (I think).


#6

Possibly so but I can’t get mapurl( to work when I have to use the arraystrip( function. I keep getting an “incorrect number of parameters” message.