• @-codes in a String

    From ASCII Express@VERT/BTCPHL to All on Sat Jan 25 22:35:41 2014
    I've jumped in with both feet and have started writing my own command shell. It has gone well so far. I have an annoying problem though..

    I want to display a textfile based on the current message sub-board. I know Synchronet has this, but I need to do it myself. I thought I'd put the filename into a string variable.

    str fn
    sprintf fn "%%zrooms/%s" "@SUB@"
    printfile fn
    but it has unpredictable results. It seems to set it to the command string. I also tried

    set str "%zrooms/@SUB@"

    but the @-code didn't expand. How can I do this? Thanks.
















    s

    ---
    þ Synchronet þ Pay no attention to that man behind the curtain!
  • From Digital Man@VERT to ASCII Express on Mon Jan 27 16:07:30 2014
    Re: @-codes in a String
    By: ASCII Express to All on Sat Jan 25 2014 10:35 pm

    I've jumped in with both feet and have started writing my own command
    shell. It has gone well so far. I have an annoying problem though..

    I want to display a textfile based on the current message sub-board. I know Synchronet has this, but I need to do it myself. I thought I'd put the filename into a string variable.

    str fn
    sprintf fn "%%zrooms/%s" "@SUB@"
    printfile fn
    but it has unpredictable results. It seems to set it to the command string. I also tried

    set str "%zrooms/@SUB@"

    but the @-code didn't expand.

    @-codes are used for display purposes usually and cannot be used to expand values in strings in Baja.

    How can I do this? Thanks.

    I'm sort of surprised, but I cannot find a way to do this in Baja. There's no command-line (%) specifier for the current sub-board internal code nor any Baja
    "system variable" for that string.

    This is rather trivial in JavaScript however (bbs.cursub_code is a string which
    contains the current sub-board's internal code), so perhaps you could just write a small JavaScript to display this file and exec that script form your Baja script.

    digital man

    Synchronet "Real Fact" #77:
    Synchronet Match Maker had at one time over 4000 profiles of men and women. Norco, CA WX: 66.9øF, 52.0% humidity, 5 mph SE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From ASCII Express@VERT/BTCPHL to Digital Man on Mon Jan 27 22:45:51 2014
    Re: @-codes in a String
    By: Digital Man to ASCII Express on Mon Jan 27 2014 04:07 pm

    I'm sort of surprised, but I cannot find a way to do this in Baja. There's n
    o
    command-line (%) specifier for the current sub-board internal code nor any B
    aja
    "system variable" for that string.
    Right, I looked for that exact thing and couldn't find it. That would come in handy. I'll try the javascript idea. I've meant to brush up on it anyways.

    ---
    þ Synchronet þ Pay no attention to that man behind the curtain!