home *** CD-ROM | disk | FTP | other *** search
/ The Weather Channel - Everything Weather / TheWeatherChannel-EverythingWeather-Win31.iso / twcia / winters / winters.dxr / 00075.ls < prev    next >
Encoding:
Text File  |  1995-08-22  |  1.4 KB  |  48 lines

  1. on mouseDown
  2.   set n to the clickOn
  3.   set the castNum of sprite n to the castNum of sprite n + 1
  4.   updateStage()
  5.   set theFile to the name of cast the castNum of sprite 15
  6.   printText(theFile)
  7.   set the castNum of sprite n to the castNum of sprite n - 1
  8. end
  9.  
  10. on printText theFile
  11.   global CDPath
  12.   set readObject to FileIO(mnew, "read", CDPath & "mainmenu\articles\" & theFile)
  13.   if objectp(readObject) then
  14.     set theText to readObject(mReadFile)
  15.     readObject(mdispose)
  16.   else
  17.     alert("File not found : " && readObject & RETURN & CDPath & "mainmenu\articles\" & theFile)
  18.   end if
  19.   if objectp(printer) then
  20.     printer(mdispose)
  21.   else
  22.     openXLib(CDPath & "mainmenu\pmatic.dll")
  23.   end if
  24.   set printer to PrintOMatic(mnew)
  25.   printer(mRegister, "10056779-130")
  26.   set propFont to "arial"
  27.   printer(mReset)
  28.   set w to printer(mGetPageWidth)
  29.   set h to printer(mGetPageHeight)
  30.   printer(mSetTextFont, propFont)
  31.   printer(mSetTextStyle, "normal")
  32.   printer(mSetTextSize, 10)
  33.   set start to 1
  34.   set end to the number of chars in theText
  35.   repeat while start < end
  36.     printer(mNewPage)
  37.     printer(mTextBox, 0, 0, w, h, 0)
  38.     set count to printer(mAppendText, char start to end of theText)
  39.     set start to start + count
  40.   end repeat
  41.   if printer(mDoJobSetup) = 1 then
  42.     updateStage()
  43.     printer(mPrint)
  44.     printer(mdispose)
  45.     closeXLib(CDPath & "mainmenu\pmatic.dll")
  46.   end if
  47. end
  48.