Examples

Retrieving News Items

*** Load libraries DO FoxNewsClient loNC = CREATE("FoxNewsClient") loNC.GetItems(DATE()-10,0,"NEWS") IF loNC.lError ? loNC.cErrorMsg RETURN ENDIF BROWSE && Browse the returned cursor

Retrieving an individual item

loNC = CREATE("FoxNewsClient") loItem = loNC.GetItem(93) && pk IF loNC.lError ? loNC.cErrorMsg RETURN ENDIF ? loItem.Subject ? loItem.Content

Saving an item (requires provider access)

loItem = CREATEOBJECT("FoxNewsItem") loItem.Subject = "New Item" loItem.Content = "Content for this item" loItem.Link = "http://..." * loItem.Private = .T. && Only show in this provider's view loNC = CREATE("FoxNewsClient") llResult = loNC.SaveItem(loItem) IF loNC.lError ? loNC.cErrorMsg && This could be a failure or validation error! RETURN ENDIF IF llResult Messagebox("Item Saved") ELSE Messagebox("Item not saved") ENDIF


  Last Updated: 6/3/2007 | © West Wind Technologies, 2007