Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Grab Stock Market Data
Message
From
13/03/2004 10:51:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00885913
Message ID:
00885943
Views:
17
Here is the missing piece that takes the extracted data from Yahoo copies it to a variable named lcfile and copys that data to a cursor. And now you know the rest of the story...

I was referring you to the Universal Thread magazine only to show you the value of this publication. While it is not free, it can save you a lot of time and very quickly pay for itself. I believe that the older (say 1 year old +) editions are freely accessible. Check out the following article by my good friend Hector Correa that shows you how to create and control Excel PivotTable's from VFP. Really some great stuff and something you will probably find of great interest:

http://www.utmag.com/June2002/Page13.asp
   CREATE CURSOR stockquotes ( ;
    Symbol c( 8 ), ;
    LAST Y, ;
    DATE D, ;
    TIME c( 8 ), ;
    CHANGE Y, ;
    OPEN Y, ;
    HIGH Y, ;
    Low Y, ;
    VOLUME B( 0 ))
  ENDIF

  SELECT stockquotes
  APPEND FROM ( lcFile ) DELIMITED
  SET SAFETY OFF
  ERASE ( lcFile )
  BROWSE
>Tom,
>
>If I understand this code correctly, is this saving the info on MSFT in a file (using STRTOFILE) ? If so, I don't see it being saved anywhere - or perhaps I just missing something.
>
>Thanks,
>Mel Cummings
>
>
>loXmlHttp = NEWOBJECT( "Microsoft.XMLHTTP" )
>
>  lcURL = "http://finance.yahoo.com/d/quotes.csv"
>  loXmlHttp.open( "POST" , lcURL, .F. )
>  loXmlHttp.send( "s=MSFT,^DJI&f=sl1d1t1c1ohgv&e=.csv" )
>
>  IF loXmlHttp.STATUS != 200
>    lcMessage = TEXTMERGE( ;
>      "An error occurred - status = <<loXmlHttp.STATUS>><<loXmlHttp.statustext>>" )
>
>    MESSAGEBOX( lcMessage, 16, PROGRAM() )
>    EXIT
>  ENDIF
>
>  lcFile = SYS( 2015 )
>  STRTOFILE( loXmlHttp.responsetext, lcFile )
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform