home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 - Expo 2000 / Image.iso / t-online / show / t_start.dxr / 00004.ls < prev    next >
Encoding:
Text File  |  1996-11-25  |  567 b   |  28 lines

  1. on Test
  2.   if ReadFileIntoCastMember(2, "test.txt") = 1 then
  3.     PrintCastMember(2)
  4.   else
  5.     alert("Datei nicht gefunden!")
  6.   end if
  7.   PrintCastMember(3)
  8. end
  9.  
  10. on ReadFileIntoCastMember theCastNum, theFileName
  11.   set myFile to new(xtra("fileio"))
  12.   openFile(myFile, theFileName, 1)
  13.   if status(myFile) = 0 then
  14.     set theFile to readFile(myFile)
  15.     put theFile into field theCastNum
  16.     set theReturn to 1
  17.   else
  18.     set theReturn to 0
  19.   end if
  20.   closeFile(myFile)
  21.   set myFile to 0
  22.   return theReturn
  23. end
  24.  
  25. on PrintCastMember theCastNum
  26.   print(cast theCastNum)
  27. end
  28.