attach "filecomp.oac"
fname1 = 'oa3code:test1.txt'
fname2 = 'test2.txt' 
doit = false 
lookall = 'No' 
ok = call("filexist",fname1,lookall)
if ok
   doit = true
else
   lookall = 'Yes' 
   ok = call("filexist",fname1,lookall)
   if  ok
       doit = true 
   end if 
end if
if  doit 
    ok = call("apendall",fname1,fname2)
    if  ok 
        ok = call("showfile",fname1)
        get ok 
    end if 
    moreinfo = 'Append this Line ONLY'
    ok = call("apendone",fname1,moreinfo)
    if  ok 
        ok = call("showfile",fname1)
        get ok
    end if 
    fname2 = call("whereis",fname2)
    if  length(fname2) > 0 
        ok = call("filedel",fname2)
    end if 
else
    put at 10,10 "File not found: ", fname1 
    get ok 
end if 
put do clear screen 
config = 'program.con'   ! file to be cleared and written to must exist 
lastfile = fname1 
if  call("clrwrite",config,lastfile)
    put at 10,10 'Program Configuration File written'
    get ok 
end if
! 
!  the following is example code using SHOWDIR 
! 
put do clear screen 
fileext = '.txt,.df'
thefile = ''
thefile = call("showdir",fileext,'No')
if  length(thefile) > 0
    put at 10,10 'The File chosen is: ', thefile 
else
    put at 10,10 'NO FILE CHOSEN' 
end if
ok = false 
get ok 
detach "filecomp.oac" 
