• onlyonce ammeded

    From Avon@21:1/101 to All on Wednesday, August 23, 2017 20:39:17
    I have this MPS code written by g00r00

    [snip]

    Uses
    CFG,
    USER;

    Var
    FN : String;
    Begin
    GetThisUser;

    FN := JustFileName(ParamStr(1));

    If Pos(PathChar, ParamStr(1)) = 0 Then
    FN := CfgTextPath + FN;

    FindFirst (FN + '.*', 0);

    While DosError = 0 Do Begin
    If DirTime > UserLastOn Then Begin
    DispFile(FN);

    Break;
    End;

    FindNext
    End;

    FindClose;
    End.

    [snip]

    My question is, what do I add to the While loop below to take the current
    test from checking if the file has been altered since last user login, to a condition that will display the file if X days have passed since user login?

    While DosError = 0 Do Begin
    If DirTime > UserLastOn Then Begin
    DispFile(FN);

    Break;
    End;


    If current date + UserLastOn > xyz days then begin...

    Best, Paul

    --- Mystic BBS v1.12 A34 (Windows/32)
    * Origin: Agency BBS | telnet://agency.bbs.geek.nz (21:1/101)
  • From Gryphon@21:1/120 to Avon on Wednesday, August 23, 2017 21:25:56
    On 08/23/17, Avon said the following...

    My question is, what do I add to the While loop below to take the current test from checking if the file has been altered since last user login,
    to a condition that will display the file if X days have passed since
    user login?

    While DosError = 0 Do Begin
    If DirTime > UserLastOn Then Begin
    DispFile(FN);

    Break;
    End;


    If current date + UserLastOn > xyz days then begin...

    If you look in my gfiles.mps app, you'll find a 'GetAgo()' function that does pretty much what you are looking for. It utilizes the built-in DaysAgo MPL function.

    Var FileAge : Integer
    FileAge:=DaysAgo(Date2Julian(DateStr(DirTime,1)))

    That line above will tell you how many days old the file is. You should be able to do the math once you have that figure.

    HTH

    --- Mystic BBS v1.12 A34 (Linux/64)
    * Origin: Cyberia BBS | cyberia.darktech.org | San Jose, CA (21:1/120)
  • From g00r00@21:1/108 to Avon on Friday, August 25, 2017 12:23:01
    I have this MPS code written by g00r00


    You can just use the /NEW option with the menu command to display a text file if you want this sort of functionality.

    My question is, what do I add to the While loop below to take the current test from checking if the file has been altered since last user login,
    to a condition that will display the file if X days have passed since
    user login?

    While DosError = 0 Do Begin
    If DirTime > UserLastOn Then Begin
    DispFile(FN);

    If DaysAgo(UserLastOn) > 3 Then

    Something like that

    --- Mystic BBS v1.12 A35 (Windows/32)
    * Origin: Sector 7 [Mystic BBS WHQ] (21:1/108)
  • From Avon@21:1/101 to g00r00 on Saturday, August 26, 2017 09:11:17
    On 08/25/17, g00r00 pondered and said...
    If DirTime > UserLastOn Then Begin
    DispFile(FN);

    If DaysAgo(UserLastOn) > 3 Then

    Something like that

    Thank you I will try this :)

    --- Mystic BBS v1.12 A34 (Windows/32)
    * Origin: Agency BBS | telnet://agency.bbs.geek.nz (21:1/101)