ASPEN_GetNumberedStory

 

Related Topics

 

 

Purpose

Retrieve a story by its story number.

 

 

Call Syntax

#include <aspen.h>

AspenRequest(slp->server_session, ASPEN_GetNumberedStory, &story_num, &story_text);

 

 

Parameters

Input

A pointer to a long that contains the story’s number.

 

Output

A pointer to an ASPEN_GET_NUMBERED_STORY2_OUTPUT structure.

 

 

Structures

Typedef struct

{

   char data[];

}ASPEN_GET_NUMBERED_STORY2_OUTPUT;

 

 

Remarks

Most data feeds classify stories using a numbering scheme. For example, stories pertaining to livestock futures are classified under one number, while stories on Dow Jones 30 Industrial stocks are classified under another number. ASPEN_GetNumberedStory allows story retrieval by this numbering scheme.

 

In an application designed to support this functionality, a user would specify the number associated with the desired story class. An AspenRequest() call with the ASPEN_GetNumberedStory service then retrieves the most recent story with that number.

 

ASPEN_GetNumberedStory allows a client application to trap stories of a particular numeric class or classes. By evaluating a story’s number in ASPEN_NEWS_NOTICE upon reception of an ASPEN_NewsNotice, an application can ignore unwanted stories and process desired stories.

 

 

Return Value

ASPEN_OK

 

 

See Also

AspenRequest()

ASPEN_GET_NUMBERED_STORY2_OUTPUT

ASPEN_NewsNotice

ASPEN_NEWS_NOTICE

 

 

Example

void CNewsDlg::OnSearch()

{

   ASPEN_GET_NEWS_INDEX_INPUT       news_input;

   ASPEN_GET_NEWS_INDEX_OUTPUT      *news_output;

   ASPEN_GET_NUMBERED_STORY2_OUTPUT *story_text;

   server_list                      *slp = list;

   CString                          strText,strStory;

   char                             buf[8];

   int                              retval;

   long                             story_num;

   GetDlgItemText(NEWS_ENTER_STORY_NUM,strText);

   if (!strText.IsEmpty())

   {

      SetDlgItemText(EDIT_NEWSHISTORY_TEXT, "");

      strcpy(buf,strText);

      story_num = atol(buf);

      SetDlgItemText(NEWS_ENTER_STORY_NUM, "");

      retval = AspenRequest(slp->server_session,

                  ASPEN_GetNumberedStory,

                  &story_num,

                  &story_text);

      if (retval == ASPEN_OK)

      {

         strStory.Format("%s",story_text->data);

         m_NewsText.AppendNewsText(strStory);

      }

   }

   …

}

 

©2006 Aspen Research Group, Ltd. All rights reserved. Terms of Use.