• console.getstr

    From High Spirit@VERT/DCBBS to All on Friday, May 29, 2015 11:02:50
    Working on something and can't seem to figure it out. Looking at the JavaScript
    Objet Model Reference for the getstr command, I see the usage:

    console.getstr([string] [,maxlen=128] [,mode=K_NONE])

    What is the [string] for?

    I was thinking it was a default value for the input but I cannot get that to work.

    eg:

    console.print("Input Here: ");
    console.getstr("value", 25, K_NOSPIN);

    would display:

    Input Here: value

    and the "value" would be highlighted and changed on first keystroke.

    Am I missing something or am I mis-interpreting what [string] is for?

    Thanks.


    -- High Spirit

    ---
    þ Synchronet þ Digital Creation BBS -- bbs.digitalcreationbbs.com:2323
  • From echicken@VERT/ECBBS to High Spirit on Friday, May 29, 2015 12:39:37
    Re: console.getstr
    By: High Spirit to All on Fri May 29 2015 11:02:50

    console.getstr([string] [,maxlen=128] [,mode=K_NONE])
    What is the [string] for?
    I was thinking it was a default value for the input but I cannot get that to work.

    I believe that you're correct.

    console.print("Input Here: ");
    console.getstr("value", 25, K_NOSPIN);

    I'm not sure if K_NOSPIN has any effect on console.getstr (maybe just console.getkey.)

    would display:

    Input Here: value
    and the "value" would be highlighted and changed on first keystroke.
    Am I missing something or am I mis-interpreting what [string] is for?

    You might try this instead, which should give you the result you're looking for:

    console.getstr("value", 25, K_EDIT|K_AUTODEL);

    You might want to throw K_LINE onto the mode argument as well.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From High Spirit@VERT/DCBBS to echicken on Friday, May 29, 2015 19:28:04
    Re: console.getstr
    By: echicken to High Spirit on Fri May 29 2015 12:39 pm

    console.getstr("value", 25, K_EDIT|K_AUTODEL);

    You might want to throw K_LINE onto the mode argument as well.

    Exactly what I wanted to do. Thanks echicken! :)


    -- High Spirit

    ---
    þ Synchronet þ Digital Creation BBS -- bbs.digitalcreationbbs.com:2323
  • From Digital Man@VERT to High Spirit on Friday, May 29, 2015 23:14:17
    Re: console.getstr
    By: High Spirit to All on Fri May 29 2015 11:02 am

    Working on something and can't seem to figure it out. Looking at the JavaScript Objet Model Reference for the getstr command, I see the usage:

    console.getstr([string] [,maxlen=128] [,mode=K_NONE])

    What is the [string] for?

    It's the default value for the string for K_EDIT mode.

    I was thinking it was a default value for the input but I cannot get that to work.

    eg:

    console.print("Input Here: ");
    console.getstr("value", 25, K_NOSPIN);

    would display:

    Input Here: value

    and the "value" would be highlighted and changed on first keystroke.

    Am I missing something or am I mis-interpreting what [string] is for?

    Add the K_EDIT mode flag. (e.g. "K_NOSPIN|K_EDIT").

    digital man

    Synchronet "Real Fact" #12:
    Synchronet was the first BBS software to ship with internal QWK networking. Norco, CA WX: 62.6øF, 81.0% humidity, 0 mph E wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From High Spirit@VERT/DCBBS to Digital Man on Monday, June 01, 2015 09:07:39
    Re: console.getstr
    By: Digital Man to High Spirit on Fri May 29 2015 11:14 pm

    It's the default value for the string for K_EDIT mode.

    Add the K_EDIT mode flag. (e.g. "K_NOSPIN|K_EDIT").

    Yeah, I missed the K_EDIT part... you look at code and docs all day and you will miss stuff.

    Thanks :)


    -- High Spirit

    ---
    þ Synchronet þ Digital Creation BBS -- bbs.digitalcreationbbs.com:2323