FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
Socket
Spider
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Email Object
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
FileAccess
Bzip2
LZW
Icon

 

Non-Chilkat Links
Text and String Handling

HTTP GET - Download and Parse HTML

Downloads an HTML page from the Singapore Exchange and parses a row of options prices from an HTML table.

Download Chilkat XML ActiveX

Download Chilkat HTTP ActiveX

LOCAL loHttp
LOCAL lnSuccess
LOCAL lcHtml
LOCAL loHtmlToXml
LOCAL lcXmlStr
LOCAL loXml
LOCAL loNode

loHttp = CreateObject('Chilkat.Http')

*  Any string unlocks the component for the 1st 30-days.
lnSuccess = loHttp.UnlockComponent("Anything for 30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loHttp.LastErrorText)
    QUIT
ENDIF

*  Send the HTTP GET and return the content in a string.

lcHtml = loHttp.QuickGetStr("http://esite.sgx.com/live/dt/DTFuture.asp?JBFE")

*  Use the Chilkat HTML-to-XML component to convert
*  the HTML to parsable XML:
loHtmlToXml = CreateObject('Chilkat.HtmlToXml')

*  Any string argument automatically begins the 30-day trial.

lnSuccess = loHtmlToXml.UnlockComponent("30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX("HtmlToXml component unlock failed")
    QUIT
ENDIF

*  Indicate the charset of the output XML we'll want.
loHtmlToXml.XmlCharset = "utf-8"

*  Set the HTML:
loHtmlToXml.Html = lcHtml

*  We won't need the scripts or images, so drop those tags...
loHtmlToXml.DropTagType("img")
loHtmlToXml.DropTagType("script")

*  Get the XML:

lcXmlStr = loHtmlToXml.ToXml()

*  Load the XML into the Chilkat XML parser:
loXml = CreateObject('Chilkat.Xml')
loXml.LoadXml(lcXmlStr)

*  success = xml.SaveXml("out.xml");

*  Find a known point in the XML.  In this case we'll look for the text node
*  containing this string: "Chg From Prev Settle"
loNode = loXml.SearchForContent(NULL,"text","Chg From Prev Settle")
IF (loNode = NULL ) THEN
    =MESSAGEBOX("Did not find Chg From Prev Settle")
    QUIT
ENDIF

*  Move up to the TD node:
loNode.GetParent2()

*  Move up to the TR node:
loNode.GetParent2()

*  Move to the next row (i.e. next TR)
loNode.NextSibling2()

loNode.FirstChild2()
loNode.NextSibling2()

? "Expire Month/Year: " + loNode.GetChildContent("text")
loNode.NextSibling2()

? "Last: " + loNode.GetChildContent("text")
loNode.NextSibling2()

? "Change: " + loNode.GetChildContent("text")
loNode.NextSibling2()

*  ...

lnSuccess = loNode.SaveXml("row.xml")

RELEASE loNode

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2007 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · ASP Mail Component · XML Parser