home *** CD-ROM | disk | FTP | other *** search
/ 1&1 Multimedia Trend 1996 10 B / MM_TREND.ISO / prog / t-online / shared.dir / 00302.ls < prev    next >
Encoding:
Text File  |  1996-08-16  |  1.7 KB  |  78 lines

  1. on OpenFile art, datei
  2.   global gsX, gsStatus, giError, gxFileObj
  3.   set giError to 0
  4.   if (art = "r") or (art = "R") then
  5.     set gxFileObj to FileIO(mnew, "read", datei)
  6.     set giError to value(gxFileObj)
  7.     if giError < 0 then
  8.       set gsX to EMPTY
  9.     else
  10.       set giError to 0
  11.     end if
  12.   end if
  13.   if (art = "w") or (art = "W") then
  14.     set gxFileObj to FileIO(mnew, "write", datei)
  15.     set giError to value(gxFileObj)
  16.     if giError < 0 then
  17.       set gsX to EMPTY
  18.     else
  19.       set giError to 0
  20.     end if
  21.   end if
  22.   if (art = "a") or (art = "A") then
  23.     set gxFileObj to FileIO(mnew, "append", datei)
  24.     set giError to value(gxFileObj)
  25.     if giError < 0 then
  26.       set gsX to EMPTY
  27.     else
  28.       set giError to 0
  29.     end if
  30.   end if
  31.   if art = "i" then
  32.     set gxFileObj to FileIO(mnew, "read", datei)
  33.     set giError to value(gxFileObj)
  34.     if giError <= 0 then
  35.       set gsX to EMPTY
  36.     else
  37.       set giError to gxFileObj(mGetLength)
  38.     end if
  39.   end if
  40. end
  41.  
  42. on CloseFile art
  43.   global gsX, giError, gxFileObj
  44.   set giError to 0
  45.   if (art = "r") or (art = "R") then
  46.     if objectp(gxFileObj) then
  47.       gxFileObj(mdispose)
  48.     end if
  49.   else
  50.     if objectp(gxFileObj) then
  51.       gxFileObj(mdispose)
  52.     end if
  53.   end if
  54. end
  55.  
  56. on ReadLine
  57.   global gsX, giError, gxFileObj, gsStatus
  58.   set giError to 0
  59.   if objectp(gxFileObj) then
  60.     set x to gxFileObj(mReadLine)
  61.     set gsX to char 1 to length(x) - 1 of x
  62.     set gsStatus to gxFileObj(mStatus)
  63.     set x to gxFileObj(mReadChar)
  64.   else
  65.   end if
  66. end
  67.  
  68. on WriteLine txt
  69.   global gsX, gsCRLF, giError, gxFileObj
  70.   set giError to 0
  71.   set y to txt
  72.   if objectp(gxFileObj) then
  73.     gxFileObj(mWriteString, y)
  74.     gxFileObj(mWriteString, gsCRLF)
  75.   else
  76.   end if
  77. end
  78.