Liberty BASIC Community Forum
« most current file »

Welcome Guest. Please Login or Register.
Nov 17th, 2017, 1:25pm


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


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: most current file  (Read 475 times)
alincon2001
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 494
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:

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

function fileDate$(typ$)
    path$="C:\libbas\security\"
    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