• The code!

    From Sean Dennis@1:18/200 to All on Thu Oct 15 11:02:01 2009
    Hello, All.

    Oops, forgot to implement Scott's recommendation in that...so here's what I have now:

    === Cut ===
    Program HideTheSysop;

    Uses
    DOS, SysUtils;

    {$I TELEGARD.INC}

    Var
    NRec : NodesRec;
    NodeFile : File of NodesRec;
    NodeNum : Word;

    Begin
    NodeNum := StrToInt(ParamStr(1));
    Assign (NodeFile, 'nodes.dat');
    {$I+}Reset(NodeFile);{$I-}
    Seek(NodeFile, NodeNum);
    Read(NodeFile, NRec);
    NRec.WhosOnFlags := NRec.WhosOnFlags + [ishidden];
    Write(NodeFile, NRec);
    Close(NodeFile);
    End.
    === Cut ===

    That should be more like it.

    Later,
    Sean

    //sean@nsbbs.info | http://nsbbs.info | ICQ: 19965647

    ... A book is like a garden carried in the pocket. - Arab proverb
    --- GoldED/2 3.0.1
    * Origin: Nocturnal State BBS - Johnson City, TN - bbs.nsbbs.info (1:18/200)
  • From Sean Dennis@1:18/200 to All on Thu Oct 15 10:31:50 2009
    Hello, All.

    This program is supposed to set the hidden bit on a particular node in Telegard/2 when it's called. I was using the user record but evidently that's for use with being permanently hidden from the userlist. This will toggle the "ishidden" bit in NODES.DAT by reading the node number off of the command line and then will set the correct bit for the correct node. I'm using Virtual Pascal to do this.

    NODES.DAT is set up as each node number has its own record from 0 to n (0 being
    node 1).

    I'll put error handling in a little later.

    Okay, after reading the last few messages and making a few changes, here's what
    I have:

    === Cut ===
    Program HideTheSysop;

    Uses
    DOS, SysUtils;

    {$I TELEGARD.INC}

    Var
    NRec : NodesRec;
    NodeFile : File of NodesRec;
    NodeNum : Word;
    NI : WhosOnFlags;

    Begin
    NodeNum := StrToInt(ParamStr(1));
    Assign (NodeFile, 'nodes.dat');
    {$I+}Reset(NodeFile);{$I-}
    Seek(NodeFile, NodeNum);
    Read(NodeFile, NRec);
    NRec.NI := NRec.NI + [ishidden];
    Write(NodeFile, NRec);
    Close(NodeFile);
    End.
    === Cut ===

    Look close enough? :)

    Later,
    Sean

    //sean@nsbbs.info | http://nsbbs.info | ICQ: 19965647

    ... A book is like a garden carried in the pocket. - Arab proverb
    --- GoldED/2 3.0.1
    * Origin: Nocturnal State BBS - Johnson City, TN - bbs.nsbbs.info (1:18/200)
  • From Scott Little@3:712/848 to Sean Dennis on Sat Oct 17 06:02:50 2009
    [ On 2009-10-15 at 10:31:50, Sean Dennis wrote to All ]

    NODES.DAT is set up as each node number has its own record from 0 to n
    (0 being node 1).

    Seek(NodeFile, NodeNum);
    Read(NodeFile, NRec);
    NRec.NI := NRec.NI + [ishidden];
    Write(NodeFile, NRec);

    That'd be seek(nodefile, nodenum-1). And you need to do it again before the Write.


    -- Scott Little [fidonet#3:712/848 / sysgod@sysgod.org]

    --- * <- Tribble |_*_| <- Housebroken Tribble
    * Origin: [sysgod.org] Damn, I'm good! (3:712/848)