Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

ncurses screen dump

Name: Anonymous 2009-08-18 15:48


void grand(int c)
{
  switch(c)
  {
    ...
    case 's':
      scr_dump("state");
      break;
    case 'l':
      scr_restore("state");
      break;
    case 'q':
      break;
  }
  move(row, col);
  refresh();


When I hit `s' the file with the data is created, but it isn't loaded after pushing `l'. What's wrong?

Name: Anonymous 2009-08-18 16:09

       The  scr_restore routine sets the virtual screen to
       the contents of  filename,  which  must  have  been
       written  using scr_dump.  The next call to doupdate
       restores the screen to the way  it  looked  in  the
       dump file.

Name: Anonymous 2009-08-18 16:12

>>2
I've seen that. You can see refresh() in the code, which should do the same thing. Never-the-less, I tried the doupdate() anyway, but with no effect.

Name: Anonymous 2009-08-18 16:38

[quote]int c
switch(c)
case 's':
's'
[/quote]

What?

Name: Anonymous 2009-08-18 16:44

>>4
Have you read your K&R today?

Name: Anonymous 2009-08-18 16:51

>>4
int noob = 'noob';

Name: Anonymous 2009-08-18 17:12

>>4
Character literals in C are just syntactic sugar for numeric literals.

Name: Anonymous 2009-08-18 17:40

>>4
There are curses macros(KEY_LEFT, etc.)in the snipped part of the code, and they are too big for a char.

Name: Anonymous 2009-08-18 19:03

>>7
Implying there is anything sugary about C syntax
IHBT.

Name: Anonymous 2009-08-18 19:07

>>7
Weak typing != syntactic sugar

Name: Anonymous 2009-08-18 19:47

>>10
Indeed.  Weak typing would be if someone tried to store 's' in a char.

Name: Anonymous 2009-08-19 5:43

bampu-pantsu

Name: Anonymous 2009-08-19 19:02

- has the process's wd changed in between the store and the retrieve?

- have you read your sicp today?

Name: Anonymous 2009-08-19 19:48

>>13
- has the process's wd changed in between the store and the retrieve?
Do you think I'm an idiot? Take tips like this to ubantoforums.
- have you read your sicp today?
Actually, I have.

Name: Anonymous 2009-08-19 21:21

>>14
Do you think I'm an idiot?
You started a thread advertising that you're too dumb to operate ncurses.  Was he wrong to believe you?

Name: Anonymous 2009-08-20 5:08

>>14
yes.
is your umask set right?

Name: Anonymous 2009-08-20 5:37

>>16
Yes.
>>15
You don't seem to know what's wrong either.

Name: Anonymous 2009-08-20 6:07

>>17
This may surprise you, but we can't guess what your error is from a simple snippet of code that doesn't have any error in it. You should be able to.

Name: Anonymous 2009-08-20 6:14

>>18
OK

Name: Anonymous 2010-12-09 14:20

Name: Anonymous 2011-01-31 20:18

<-- check em dubz

Don't change these.
Name: Email:
Entire Thread Thread List