• getkeys

    From Nelgin@EOTLBBS to digitalman on Saturday, May 30, 2020 20:52:40
    I'm trying to use console.getkeys to have a user select a page in an address book they want to go to.

    I have a variable, pages, which contains a number so I'm using

    var keypress = console.getkeys(pages);

    According to the jsobjs file:

    "get one key from of a list of valid command keys, or a number between 1 and maxnum"

    Since I'm passing a number, I would expect only to be able to input a number between 1 and whatever pages is, however it lets me enter any character.

    What am I doing wrong?

    Just in case, I also tried forcing pages to be typeof number.

    ---
    ■ Synchronet ■ End Of The Line BBS - endofthelinebbs.com
  • From Digital Man to Nelgin on Saturday, May 30, 2020 21:44:25
    Re: getkeys
    By: Nelgin to digitalman on Sat May 30 2020 08:52 pm

    I'm trying to use console.getkeys to have a user select a page in an address book they want to go to.

    I have a variable, pages, which contains a number so I'm using

    var keypress = console.getkeys(pages);

    According to the jsobjs file:

    "get one key from of a list of valid command keys, or a number between 1 and maxnum"

    Since I'm passing a number, I would expect only to be able to input a number between 1 and whatever pages is, however it lets me enter any character.

    What am I doing wrong?

    You're not passing any keys.

    Just in case, I also tried forcing pages to be typeof number.

    If you only want a number, use console.getnum() instead.

    digital man

    This Is Spinal Tap quote #39:
    Airport Security Officer: Do you have any artificial plates or limbs?
    Norco, CA WX: 61.2°F, 80.0% humidity, 6 mph ENE wind, 0.00 inches rain/24hrs