PageMac
Home
   dot Projects
   dot Pics and Images
   dot WREK
D++
   dot About / FAQ
   dot Download
   dot Code Library
   dot Documentation
   dot VB6 Runtime Files
About

  Source Code - dpp/source/filetest.dpp

Download link (right click, save as)



1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
newvar count=1;

function main()
{
    title "File Test";
    newvar ret=1;

    do until ret <> 1;
        dowrite("a");
        screenput "Done.  Append more text? ";
        ret = getyn();    
        screen;
    loop

    screenput "Done";
}

function getyn();
{
    newvar temp;
    screenin temp;
    getyn = 0;
    if lcase(temp) = "y" then
        getyn = 1;
    elseif lcase(temp) = "yes" then
        getyn = 1;
    endif
}

function dowrite(mode)
{
    newvar f;
    f = f_open("C:\output.txt", "a");
    f_out(f, "This is line " & count);
    f_close(f);
    count++;
}


This code is Copyright (C) 2000-2012 PageMac Programming. Reproduction of this code must adhere to the GNU General Public License.