• System Variables...

    From High Spirit@VERT/DIGITALC to DOVE-Net.Synchronet_Baja on Wed Apr 9 12:53:00 2008
    I'm sure this has been asked before, but I'm at a loss... I'm probably blind and the answer is right in front of me.

    How do I do a math operation (ADD, SUB, DIV, MUL) to a system variable like @STATS.LOGONS@?

    For example, divide STATS.LOGONS (total logons during history of system) by
    7 to get the average calls per day... (just an example, not really the value I'm looking for).

    ---
    ■ Synchronet ■ Digital Creation - digital.servebbs.com
  • From Angus McLeod@VERT/ANJO to High Spirit on Wed Apr 9 19:24:00 2008
    Re: System Variables...
    By: High Spirit to DOVE-Net.Synchronet_Baja on Wed Apr 09 2008 12:53:00

    How do I do a math operation (ADD, SUB, DIV, MUL) to a system variable like @STATS.LOGONS@?

    For example, divide STATS.LOGONS (total logons during history of system) by 7 to get the average calls per day... (just an example, not really the value I'm looking for).

    @CODES@ as embedded in menus and other text screens aren't variables in
    the programatic sense. They are substitution codes that are textually replaced in ASCII/ANSI files when those files are sent to the caller.
    You can't do arithmetic with them.

    If you are coding in BAJA and want to do arithmetic with a system variable
    you use the ADD, SUB, MUL and DIV operations. I'd recommend copying the
    value to a user variable first and working with that, though.

    ---
    Amarok: 17,459 tracks from 1,238 albums by 1,349 artists, but none playing.
    ■ Synchronet ■ Where we BAJA Rob into writing our modules. The ANJO BBS
  • From High Spirit@VERT/DIGITALC to Angus McLeod on Wed Apr 9 20:13:00 2008
    Re: System Variables...
    By: Angus McLeod to High Spirit on Wed Apr 09 2008 07:24 pm

    @CODES@ as embedded in menus and other text screens aren't variables in
    the programatic sense. They are substitution codes that are textually replaced in ASCII/ANSI files when those files are sent to the caller.
    You can't do arithmetic with them.

    If you are coding in BAJA and want to do arithmetic with a system variable you use the ADD, SUB, MUL and DIV operations. I'd recommend copying the value to a user variable first and working with that, though.

    I had that figured out... but what are the variable names to access those in BAJA? I've tried them without the @'s and it gives me the error:

    !SYNTAX ERROR (expecting variable name):


    ---
    ■ Synchronet ■ Digital Creation - digital.servebbs.com
  • From Angus McLeod@VERT/ANJO to High Spirit on Thu Apr 10 08:20:00 2008
    Re: System Variables...
    By: High Spirit to Angus McLeod on Wed Apr 09 2008 20:13:00

    @CODES@ as embedded in menus and other text screens aren't variables in the programatic sense. They are substitution codes that are textually replaced in ASCII/ANSI files when those files are sent to the caller.
    You can't do arithmetic with them.

    I had that figured out... but what are the variable names to access those in BAJA? I've tried them without the @'s and it gives me the error:

    !SYNTAX ERROR (expecting variable name):

    Oh, I see.

    Well, not every @CODE@ has an equivilent BAJA variable. Look near the
    bottom of docs/baja.html for a list of system variables.

    ---
    Playing: "Stand on the rock" by "Fleetwood Mac"
    from the "Behind the mask" album.
    ■ Synchronet ■ Where we BAJA Rob into writing our modules. The ANJO BBS
  • From MRoblivious1bmf@VERT to High Spirit on Fri Jun 6 17:42:00 2008
    To: High Spirit
    .,: This is something about System Variables...,
    High Spirit said it to DOVE-Net.Synchronet_Baja on Wed Apr 09 2008 12:53 pm --──────────────────────-────---───────────────---─────────--────────
    I'm sure this has been asked before, but I'm at a loss... I'm probably blind and the answer is right in front of me.

    How do I do a math operation (ADD, SUB, DIV, MUL) to a system variable like @STATS.LOGONS@?

    For example, divide STATS.LOGONS (total logons during history of system) by 7 to get the average calls per day... (just an example, not really the value I'm looking for).


    look in sbbsdefs.inc for stuff you can work with in baja.

    for example, a callers mod i had laying around:

    !INCLUDE SBBSDEFS.INC
    !INCLUDE FILE_IO.INC
    INT FILE
    int T
    STR SL CPS SEX ULBYTE DL UL DLBYTE DLTIME HANDLE LOCATION MODEM CONNECTION
    CID NODENUM LC_LOGONS

    COPY LC_LOGONS _USERON.LOGONS
    COPY NODENUM _NODE_NUM
    COPY HANDLE _USERON.ALIAS
    COPY LOCATION _USERON.LOCATION
    COPY MODEM _USERON.MODEM
    COPY CONNECTION _CONNECTION
    COPY SL _USERON.LEVEL
    COPY SEX _USERON.SEX
    COPY CPS _CUR_CPS
    COPY ULBYTE _LOGON_ULB
    COPY UL _LOGON_ULS
    COPY DL _LOGON_DLS
    COPY DLBYTE _LOGON_DLB


    FOPEN FILE O_WRONLY|O_CREAT|O_APPEND "%N..\\LCALLS\LCALLMID.ANS"

    TIME T
    FTIME_STR STR "%H:%M" T
    FPRINTF FILE " \r\n|05 (time) %-6.6s " T
    FPRINTF FILE " |13 (node) %-2.2s" NODENUM
    FPRINTF FILE " |13 (sl) %-2.2s" SL
    FPRINTF FILE " |13 (handle) %-15.15s" HANDLE
    FPRINTF FILE " |05 (location) %-25.25s" LOCATION
    FPRINTF FILE " |13 (modem) %-13.13s" MODEM

    FCLOSE FILE

    |15 .─.┌ ┬ ┬┬ ┬┬.─.┬ ┬┌┐
    |07-│ │├┐│ ││ │││ ││ │└┐-
    |07 `─'└┘┴┘┴`\/'┴`─'└-┘└┘
    |08°∙·.[|04Edge of oblivion bbs |12eob-bbs.com|08].·∙°|15


    --- Synchronet 3.14a-Win32 NewsLink 1.85
    * eob - Racine, WisconSIN - telnet://eob-bbs.com
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ telnet://vert.synchro.net