Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

From Scratch

From Scratch: Using StocksSocket in an Application

Issue: 2.3 (December/January 2003)
Author: William Leshner
Author Bio: William Leshner has been programming for twenty years and programming Macs for ten. He has spent a good deal of the last several years building REALbasic applications, including KidzMail, ResPloder, and several plugins and utilities.
Article Description: No description available.
Article Length (in bytes): 9,505
Starting Page Number: 40
RBD Number: 2319
Resource File(s):

Download Icon 2319.sit Updated: Monday, March 15, 2004 at 2:35 AM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

This is the third article in a series of three articles in which we are creating StocksSocket, a subclass of HTTPSocket that fetches stock information from a NASDAQ XML feed. In the first article we looked at how to subclass HTTPSocket to create StocksSocket and how to use StocksSocket to get stock information. In the second article we talked about how to parse the XML information we get back from the server. In this article we are going to see how to put StocksSocket to use in a simple application.

Stocks, The Project

"Stocks" is the name of the application that we will build on top of StocksSocket. Stocks is pretty simple; it consists of an EditField to enter comma-delimited stock symbols, a "Get" button to initiate a stock fetch, and a ListBox to display the results. We will only display the symbol, last price, and price change of each stock in the ListBox. We will add two simple enhancements to Stocks. The first enhancement is the ability to fetch stock information automatically every five minutes. The second enhancement is the ability to display each row in the ListBox in either red or green, depending on whether a stock is up or down.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


List of Errata

Unfortunately, it appears that NASDAQ has shut down the stock feed that StocksSocket queries for stock information. I have yet to find a suitable replacement. The examples and code in these articles are still valuable, but they will no longer work to fetch stocks information. If I discover a replacement for the NASDAQ feed, I will update this page with the new information.


 


|

 


Weblog Commenting and Trackback by HaloScan.com