Need help with move() (ncurses)

  • gunpowderTR
    15th Dec 2016 Member 0 Permalink

    (this forum is for general development assistance too soo i opened a thread)

    Soo the issue is when i use move(); with normal numbers like: move(2,2); it works

    But:

    When i do:

    move(getMaxRow(),2);

    Note: getMaxRow() returns max rows in screen

    this does not work. please help

    Btw i tested if getMaxRow(); returns max rows and yes it does

    printw("%d", getMaxRow); outputs 30 (since it is the max row count)

    Edited 2 times by gunpowderTR. Last: 15th Dec 2016
  • LBPHacker
    15th Dec 2016 Developer 0 Permalink

    Too little information provided. *I* (note the emphasis) can't help without knowing what else your program does, what platform you're on, etc. I know it's a bit tedious to post all that here, so maybe if you joined #powder on freenode (or just freenode in general - query me), we could work it out there.

     

    Also, despite this being a development question, since it doesn't seem to be related to TPT development, I think this belongs in General. Correct me if I'm wrong though.

  • QuanTech
    15th Dec 2016 Member 0 Permalink

    @LBPHacker (View Post)

     I think things that are too serious and purposeful don't go in General lol. Also, is this lua or cpp?

  • mark2222
    16th Dec 2016 Member 0 Permalink

    I'm guessing the problem you have is that (30, 2) is outside the bounds of the terminal window. In particular, note that the coordinates are zero-indexed, so row 30 in fact refers to the 31st row. Perhaps what you want is:

     

    move(getMaxRow() - 1, 2);

     

    To confirm, move(30, 2) should not work either. Both move(30, 2) and move(getMaxRow(), 2) should return ERR (-1) instead of OK (0).

     

    As for which forum this belongs in, I think StackOverflow is the right answer. xD