How to use a web exe with an external txt data file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • DaSoulRed
    Forum Member
    • Aug 2007
    • 399

    How to use a web exe with an external txt data file

    I am trying to solve this and no luck so i think in the rigth short question and do direct question about it.

    Wich lines should i change to make a web exe file who reads a txt file who will act like database and this file will be modify any time the applcation closes becouse it is using the calendar plugin.

    so i want to set a web exe with a database acces to a single file using the calendar plugin can this bi done.

    becouse i allready solve the problem doing a hard drive folder but there is a lot off files in this option so i want to doit with less files and using a web exe file can this be done.

    here is the code and really thanks for the feedback

    ON SHOW

    --Save the Path to the Text file
    --strTextFilePath = Shell.GetFolder(SHF_MYDOCUMENTS).."\\CalNotes.txt" ;
    strTextFilePath = _SourceFolder.."\\AutoPlay\\Docs\\CalNotes.txt"
    --Create Table
    tbBlog = {};

    --Does the File Exist?
    if (File.DoesExist(strTextFilePath)) then
    --Read Text File
    tbTextFile = TextFile.ReadToTable(strTextFilePath);

    if (tbTextFile) then
    --Get Number of table elements
    nCount = Table.Count(tbTextFile);
    if (nCount > 1) then
    --Now Loop through the Table and store it
    for nPos = 1, nCount, 2 do
    --Get the Date
    strDate = tbTextFile[nPos];
    --Get the Note, and replace ASCII placeholder with LUA line breaks
    strNote = String.Replace(tbTextFile[nPos+1], "\002", "\r\n");
    --No Blanks
    if (strNote ~= "") then
    tbBlog[strDate] = strNote;
    --Now Make the Date Special
    Calendar.AddSpecialDate("calendar",strDate);
    end
    end
    end
    end
    end

    ON CLOSE

    -- Initialize variables
    tbWriteOut = {};
    nCount = 1;

    -- Check for table existance
    if (tbBlog) then
    -- Step through each item in the table
    for strDate, strText in tbBlog do
    if (strText ~= "") then
    -- The current line is not blank, output date to 'output' table
    tbWriteOut[nCount] = strDate;
    nCount = nCount + 1;

    -- Output notes to 'output' table, and replace LUA line breaks with an ASCII placeholder
    tbWriteOut[nCount] = String.Replace(strText, "\r\n", "\002");
    nCount = nCount + 1;
    end
    end

    -- Write the 'output' table to a text file
    --strTextFilePath = Shell.GetFolder(SHF_MYDOCUMENTS).."\\CalNotes.txt" ;
    strTextFilePath = _SourceFolder.."\\AutoPlay\\Docs\\CalNotes.txt"
    TextFile.WriteFromTable(strTextFilePath,tbWriteOut );
    end
Working...
X