• @-codes in a String

    From ASCII Express@BTCPHL to All on Saturday, January 25, 2014 22:35:41
    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 to ASCII Express on Monday, January 27, 2014 16:07:30
    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
  • From ASCII Express@BTCPHL to Digital Man on Monday, January 27, 2014 22:45:51
    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!