home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
1&1 Multimedia Trend 1996 10 B
/
MM_TREND.ISO
/
prog
/
t-online
/
shared.dir
/
00302_Script_302
< prev
next >
Wrap
Text File
|
1996-08-16
|
3KB
|
128 lines
-- FileIO
-- Zugriff auf die FileIO.dll fⁿr Dateizugriffe
-- Fehlermeldungen wie DOS Int 34
-- *****************************************************************
on OpenFile art, datei
global gsX, gsStatus, giError, gxFileObj
set giError = 0
--debug "open file:" & datei & ": als :" & art
if (art = "r" ) or (art = "R") then
-- ÷ffne zum lesen
put FileIO( mNew, "read", datei) into gxFileObj
-- value: error = zahl <0 , ok ist text
put value( gxFileObj ) into giError
if giError < 0 then
put "" into gsX
else
set giError = 0
end if
end if
if (art = "w" ) or (art = "W") then
-- ÷ffne zum schreiben
put FileIO( mNew, "write", datei) into gxFileObj
put value( gxFileObj ) into giError
if giError < 0 then
put "" into gsX
else
set giError = 0
end if
end if
if (art = "a" ) or (art = "A") then
-- ÷ffne zum anhΣngen
put FileIO( mNew, "append", datei) into gxFileObj
put value( gxFileObj ) into giError
if giError < 0 then
put "" into gsX
else
set giError = 0
end if
end if
if art ="i" then
-- ÷ffne fⁿr infos
-- gi error <0 = fehler, >0 = FileLen
put FileIO( mNew, "read", datei) into gxFileObj
put value( gxFileObj ) into giError
if giError <= 0 then
put "" into gsX
else
put gxFileObj(mGetLength) into giError
end if
end if
--debug " result:" & giError
end
-- ***************************************************************
on CloseFile art
global gsX, giError, gxFileObj
set giError = 0
--debug "close file"
if (art = "r" ) or (art = "R") then
-- schliesse lesen
if objectP( gxFileObj ) then
gxFileObj( mDispose )
end if
else
-- schliesse schreiben
if objectP( gxFileObj ) then
gxFileObj( mDispose )
end if
end if
end
-- ****************************************************************
on ReadLine
global gsX, giError, gxFileObj, gsStatus
set giError = 0
--debug "readline"
if objectP( gxFileObj ) then
put gxFileObj(mReadLine ) into x -- bis CR
put char 1 to length(x)-1 of x into gsX
--debug " is ok"
put gxFileObj(mStatus) into gsStatus
put gxFileObj(mReadChar ) into x -- Lf lesen
else
--debug " error"
end if
end readline
-- *******************************************************************
on WriteLine txt
global gsX, gsCRLF, giError, gxFileObj
set giError = 0
set y = txt
--debug "write"
if objectP( gxFileObj ) then
gxFileObj(mWriteString, y )
gxFileObj(mWriteString, gsCRLF )
--debug " ok"
else
--debug " error"
end if
end readline