home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 February / WPCFEB97.ISO / multi / times / data / article.dir / 00004.ls < prev    next >
Encoding:
Text File  |  1996-08-12  |  1.8 KB  |  55 lines

  1. on exitFrame
  2.   global theArticle, theArticleList
  3.   setPuppets(1, 48, 0)
  4.   setPuppets(13, 19, 1)
  5.   cursor(4)
  6.   setDelimOn()
  7.   if item 3 of theArticle = 0 then
  8.     setOffStage("17")
  9.   else
  10.     set the locV of sprite 17 to 4
  11.     set the locH of sprite 17 to 115
  12.   end if
  13.   if item 4 of theArticle = EMPTY then
  14.     setOffStage("18")
  15.   else
  16.     set the locV of sprite 18 to 4
  17.     set the locH of sprite 18 to 144
  18.   end if
  19.   createPath("article", item 1 of theArticle)
  20.   openXLib("fileio")
  21.   set thetextfile to FileIO(mnew, "read", the result)
  22.   if objectp(thetextfile) then
  23.     set artTemp to thetextfile(mReadFile)
  24.     set topBoxTemp2 to line 3 of artTemp & "," && line 5 of artTemp & RETURN & line 7 of artTemp
  25.     set artHeadTemp to item 2 of theArticle
  26.     if char length(artHeadTemp) of artHeadTemp = "┬╗" then
  27.       delete char length(artHeadTemp) - 1 to length(artHeadTemp) of artHeadTemp
  28.     end if
  29.     delete line 1 to 8 of artTemp
  30.     set the text of field "artHead" to artHeadTemp
  31.     set the text of field "artHead2" to topBoxTemp2
  32.     set the text of field "artText" to artTemp
  33.     thetextfile(mdispose)
  34.     closeXLib("fileio")
  35.   else
  36.     set the text of field "artHead" to string("Sorry - article not found - " && theArticle)
  37.     set the text of field "artText" to "Sorry - article not found"
  38.     set the text of field "artHead2" to "Sorry - article not found"
  39.   end if
  40.   if voidp(theArticleList) then
  41.     set theArticleList to theArticle & RETURN
  42.   else
  43.     repeat with n = 1 to the number of lines in theArticleList
  44.       if string(line n of theArticleList) = string(theArticle) then
  45.         delete line n of theArticleList
  46.       end if
  47.     end repeat
  48.     put theArticle & RETURN after theArticleList
  49.     if the number of lines in theArticleList > 76 then
  50.       delete line 1 of theArticleList
  51.     end if
  52.   end if
  53.   setDelimOff()
  54. end
  55.