home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / winprogs / childenc / oecdemo / shared.dir / 00395.ls < prev    next >
Encoding:
Text File  |  1996-07-24  |  2.6 KB  |  93 lines

  1. on ImportFile fileName, textCast
  2.   global gMoviePathName
  3.   if the optionDown then
  4.     set theFile to FileIO(mnew, "?read", "TEXT")
  5.   else
  6.     set FilepathName to getResourcePathName(fileName, "TextFile")
  7.     if FilepathName = EMPTY then
  8.       return 0
  9.     end if
  10.     set theFile to FileIO(mnew, "read", FilepathName)
  11.   end if
  12.   if not objectp(theFile) then
  13.     return 0
  14.   end if
  15.   set x to theFile(mReadFile)
  16.   if the paramCount = 2 then
  17.     set the text of cast textCast to x
  18.   end if
  19.   theFile(mdispose)
  20.   if the paramCount = 2 then
  21.     return 1
  22.   else
  23.     return x
  24.   end if
  25. end
  26.  
  27. on ImportPICT theCastNum, thePICT, subDir
  28.   global gMoviePathName
  29.   set PICTpathName to getResourcePathName(thePICT, "-Picts")
  30.   if PICTpathName = EMPTY then
  31.     return 0
  32.   end if
  33.   set PICTfile to FileIO(mnew, "read", PICTpathName)
  34.   if not objectp(PICTfile) then
  35.     return 0
  36.   end if
  37.   set the picture of cast theCastNum to PICTfile(mReadPICT)
  38.   PICTfile(mdispose)
  39.   return 1
  40. end
  41.  
  42. on getResourcePathName name, resourceType, subDir
  43.   global gMoviePathName, pictureName
  44.   set resourceDirPrefix to EMPTY
  45.   if stringp(pictureName) then
  46.     set resourceDirPrefix to char 1 to 2 of pictureName
  47.   end if
  48.   if the machineType = 256 then
  49.     set x to char 1 to 2 of the movie
  50.     if stringp(subDir) then
  51.       set resourcePathName to gMoviePathName & resourceDirPrefix & resourceType & "\" & subDir & "\" & name
  52.     else
  53.       set resourcePathName to gMoviePathName & resourceDirPrefix & resourceType & "\" & name
  54.     end if
  55.   else
  56.     if stringp(subDir) or integerp(subDir) then
  57.       set resourcePathName to gMoviePathName & resourceDirPrefix & resourceType & ":" & subDir & ":" & name
  58.     else
  59.       set resourcePathName to gMoviePathName & resourceDirPrefix & resourceType & ":" & name
  60.     end if
  61.     if fileExists(resourcePathName) <> "TRUE" then
  62.       beep()
  63.       put resourcePathName
  64.       return EMPTY
  65.     end if
  66.   end if
  67.   return resourcePathName
  68. end
  69.  
  70. on getResPathName name, resourceType, subDir
  71.   global gMoviePathName, pictureName
  72.   if the machineType = 256 then
  73.     set x to char 1 to 2 of the movie
  74.     if stringp(subDir) then
  75.       set resourcePathName to gMoviePathName & resourceType & "\" & subDir & "\" & name
  76.     else
  77.       set resourcePathName to gMoviePathName & resourceType & "\" & name
  78.     end if
  79.   else
  80.     if stringp(subDir) or integerp(subDir) then
  81.       set resourcePathName to gMoviePathName & resourceType & ":" & subDir & ":" & name
  82.     else
  83.       set resourcePathName to gMoviePathName & resourceType & ":" & name
  84.     end if
  85.     if fileExists(resourcePathName) <> "TRUE" then
  86.       beep()
  87.       put resourcePathName
  88.       return EMPTY
  89.     end if
  90.   end if
  91.   return resourcePathName
  92. end
  93.