Code Samples/Comparisons

Dave Cragg dave.cragg at lacscentre.co.uk
Sat Dec 5 12:30:37 EST 2009


On 5 Dec 2009, at 15:09, Colin Holgate wrote:

> 
> On Dec 5, 2009, at 5:48 AM, Dave Cragg wrote:
> 
>> In what circumstances would you ever need to use this. The url returns over 1700 lines of text, and so many questions are raised:
>> 
>> -- Why would you download so much data just to get a single item?
> 
> There isn't a choice about that, in any language. By giving the RBS code you've already reduced the list down from all companies to just one, but beyond that you would have to have another online script dedicated to extracting the most recent date to cut the returned text down the one line.

But there's another API method for returning a single quote: (http://download.finance.yahoo.com/d/quotes.csv?s=RBS.L&f=l1) This wouldn't require any chunking expression at all. (get url "http://download.finance.yahoo.com/d/quotes.csv?s=RBS.L&f=l1") But it also wouldn't require much of the code in the other languages.

My point was that the one liner used in the example didn't represent a real world task, and therefore is in danger of being ridiculed.  If we are to propose comparisons, it shouldn't be along the lines of this:

How would you do the following in Java/C/etc?

get last item of line 2 of url "http://ichart.finance.yahoo.com/table.csv?s=RBS.L"

but rather, 

How would you get and display the latest stock price for RBS.L from the internet in Rev/ Java/C/etc?

Dave


More information about the Use-livecode mailing list