Liberty BASIC Community Forum
« most current file »

Welcome Guest. Please Login or Register.
Jan 20th, 2018, 11:01am

Rules|Home|Help|Search|Recent Posts|Notification

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: most current file  (Read 536 times)

member is offline



Posts: 510
xx most current file
« Thread started on: Mar 15th, 2015, 4:34pm »

I have a small sequential password file - actually two. When I do an update, I read in one and write to the other. Naturally I want to read the most current file. Using filedialog works, but it's easy to click on the wrong file, especially if the names are similar and the print is small.
I am now using this code:

    typ$ = ".txt"
    if fileDate$(".dat") > fileDate$(".txt") then typ$ = ".dat"
    open "security"+typ$ for input as #secFile

function fileDate$(typ$)
    files path$, "security"+typ$, info$()
    dts$ = (info$(1,2))   'date time stamp
    jDay = date$(dts$)
    fileDate$ = str$(jDay) + right$(dts$,2) + mid$(dts$,10,8)
    end function
    'right$(dts$,2) is am or pm
    'mid$(dts$,10,8) is hours, minutes, seconds
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls