home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / PERFCHK.TAS < prev    next >
Text File  |  1991-06-09  |  1KB  |  32 lines

  1.  { PERFCHK.TAS  ( Author Martin Moore)
  2.   Script to print out the performance of certain stocks since a particular
  3.   day. To add a ticker and date to the list of stocks to be tracked, just
  4.   put a line like this in:
  5.     if TICKER = 'tickername' then find_date = yyddmm.0 else
  6.   where 'tickername' is the stock ticker surrounded by quotes and
  7.         'yymmdd' is the year, month and day. Be sure to include the 
  8.         ".0" after the date (see documentation on size of INTEGERs
  9.  }                        
  10. #output_file 'perfchk.lst'
  11.   if FIRST_TICKER then
  12.   BEGIN
  13.   writeln('          CURRENT  PERCENT  POINTS     SINCE');
  14.   writeln('TICKER     CLOSE   CHANGE   CHANGE     DATE');
  15.   END;
  16.  
  17.  if TICKER = 'AMGN' then find_date = 910502.0 else
  18.  if TICKER = 'IBM'  then find_date = 900802.0 else 
  19.  if TICKER = 'AAPL' then find_date = 900802.0 else
  20.  RETURN;        { no matching stock ticker..just return}
  21.  date_found_sw = 0;  { indicate date not yet found}
  22.  i = 0;              { search backwards for date match}
  23.  :DATE_LOOKUP
  24.  if dates[i] = find_date then goto DATE_FOUND;
  25.  i = i - 1;   { backup one day's index}
  26.  if i = -quote_count then return;  { date not found..should not happen, Ken!}
  27.  goto DATE_LOOKUP;        { go back and check prior day}
  28.  :DATE_FOUND
  29.   writeln(TICKER,C,ROC(C,-i,'%'),'% ',ROC(C,-i,'$'),'   ',
  30.         datestr(dates[i]));
  31.  
  32.