Why doesn't this work?

Mark Schonewille m.schonewille at economy-x-talk.com
Sun May 31 13:20:21 EDT 2015


Bill,

If I run this script in a button

on mouseUp
      put "805" into vAC
      put URL 
("http://www.webservicex.net/uszip.asmx/GetInfoByAreaCode?USAreaCode=" & 
vAC) && "HTTP/1.1"
end mouseUp

I get...

<?xml version="1.0" encoding="utf-8"?>
<NewDataSet>
   <Table>
     <CITY>Woody</CITY>
     <STATE>CA</STATE>
     <ZIP>93287</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Acton</CITY>
     <STATE>CA</STATE>
     <ZIP>93510</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Arroyo Grande</CITY>
     <STATE>CA</STATE>
     <ZIP>93420</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Arroyo Grande</CITY>
     <STATE>CA</STATE>
     <ZIP>93421</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Arvin</CITY>
     <STATE>CA</STATE>
     <ZIP>93203</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Atascadero</CITY>
     <STATE>CA</STATE>
     <ZIP>93422</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Atascadero</CITY>
     <STATE>CA</STATE>
     <ZIP>93423</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Avila Beach</CITY>
     <STATE>CA</STATE>
     <ZIP>93424</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Bakersfield</CITY>
     <STATE>CA</STATE>
     <ZIP>93301</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Bakersfield</CITY>
     <STATE>CA</STATE>
     <ZIP>93302</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Bakersfield</CITY>
     <STATE>CA</STATE>
     <ZIP>93303</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Bakersfield</CITY>
     <STATE>CA</STATE>
     <ZIP>93304</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>


[snip]


     <CITY>Goleta</CITY>
     <STATE>CA</STATE>
     <ZIP>93199</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Grover Beach</CITY>
     <STATE>CA</STATE>
     <ZIP>93433</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Grover Beach</CITY>
     <STATE>CA</STATE>
     <ZIP>93483</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Guadalupe</CITY>
     <STATE>CA</STATE>
     <ZIP>93434</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
   <Table>
     <CITY>Harmony</CITY>
     <STATE>CA</STATE>
     <ZIP>93435</ZIP>
     <AREA_CODE>805</AREA_CODE>
     <TIME_ZONE>P</TIME_ZONE>
   </Table>
</NewDataSet> HTTP/1.1

...which I think is what you'd expect.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Installer Maker for LiveCode:
http://qery.us/468

Buy my new book "Programming LiveCode for the Real Beginner" 
http://qery.us/3fi

LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 5/31/2015 18:55, Bill Vlahos wrote:
> Unfortunately neither of these suggestions work. LiveCode doesn’t like the parenthesis.
>
> I also tried using quote & syntax and that didn’t work either.
>
> Bill
>
>> On May 31, 2015, at 9:34 AM, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:
>>
>> Bill,
>>
>> It doesn't work because LiveCode first parses "url [the url]" and then concatenates the subsequent strings. Try using parentheses:
>>
>>    put "805" into vAC
>>    put URL ("http://www.webservicex.net/uszip.asmx/GetInfoByAreaCode?USAreaCode=" & vAC) && "HTTP/1.1"
>>
>> --
>> Best regards,
>>
>> Mark Schonewille
>>
>> Economy-x-Talk Consulting and Software Engineering
>> Homepage: http://economy-x-talk.com
>> Twitter: http://twitter.com/xtalkprogrammer
>> KvK: 50277553
>>
>> Installer Maker for LiveCode:
>> http://qery.us/468
>>
>> Buy my new book "Programming LiveCode for the Real Beginner" http://qery.us/3fi
>>
>> LiveCode on Facebook:
>> https://www.facebook.com/groups/runrev/
>>
>> On 5/31/2015 18:29, Bill Vlahos wrote:
>>>     put "805" into vAC
>>>     put URL"http://www.webservicex.net/uszip.asmx/GetInfoByAreaCode?USAreaCode="  & vAC && "HTTP/1.1"






More information about the use-livecode mailing list