#include "Ifx.h"
#define read_dir "C:\\"
#define read_file "read.txt"
prototype readandwrite();
function readandwrite()
NUMBER nvFileHandle;
STRING szMsg;
begin
OpenFileMode (FILE_MODE_APPEND);
if (CreateFile (nvFileHandle, read_dir, read_file
) < 0) then
// MessageBox (failed to create file, SEVERE);
else
szMsg = "hello god is watching u";
if (WriteLine(nvFileHandle, szMsg) < 0) then
MessageBox ("error", SEVERE);
else
SprintfBox (INFORMATION, szMsg, read_file);
endif;
endif;
CloseFile(nvFileHandle);
end;
///////////////////////////////////////////
prototype readline();
function readline()
STRING szFileName, szPath, szText, svLine;
NUMBER nFlag, nFileHandle;
LIST listID;
begin
listID = ListCreate (STRINGLIST);
OpenFileMode (FILE_MODE_NORMAL);
OpenFile (nFileHandle,read_dir, read_file);
while (GetLine (nFileHandle, svLine) = 0)
ListAddString (listID, svLine, AFTER);
endwhile;
CloseFile (nFileHandle);
SdShowInfoList ("", read_file, listID);
ListDestroy (listID);
end;
No comments:
Post a Comment