Xref: utzoo comp.unix.questions:32423 comp.unix.programmer:2135 comp.lang.c:40440 comp.unix.wizards:26124 comp.bugs.4bsd:1833 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!munnari.oz.au!yoyo.aarnet.edu.au!sirius.ucs.adelaide.edu.au!spam!dcook From: dcook@spam.ua.oz (David Cook) Newsgroups: comp.unix.questions,comp.unix.programmer,comp.lang.c,comp.unix.wizards,comp.bugs.4bsd Subject: Strange curses problem Summary: Re-post to more groups - can _anyone_ help ? Keywords: curses bug? Message-ID: <883@spam.ua.oz> Date: 25 Jun 91 14:33:35 GMT Article-I.D.: spam.883 Followup-To: comp.unix.programmer Organization: Statistics, Pure & Applied Mathematics, University of Adelaide Lines: 60 (I got no answer to this question from comp.unix.programmer, so am re-posting to other groups. Maybe someone else knows this problem .... ) Hello, Here is a section of code I've been having trouble with, in a program which uses curses. (the problem is the same on SunOS 4.1.1/SPARC and OSx5.1/Pyramid 98xx, using standard cc on both machines, ucb universe on the Pyramid - the program works ok in att universe on the Pyramid ) The problem is, I am trying to display the array 'abroll' on the screen, in a 6 row by 12 column format, evenly spaced. The current behaviour is to print the first number in each column in the correct place, and the other 5 appear around column 78 of the same line as the first number . If I remove the commented out section of code, below, the program works. I have experimented with location and amount of refresh(), but it seems to make no difference. Could someone out there _please_ reduce my frustration, and see the error that I'm missing (apart from the obvious one of using curses in the first place :-) Also, I am seriously considering using termcap directly instead, but I am not sure how to go about this, (I have RTFM, but I would like some example code ), and would appreciate some pointers in the right direction. Finally, if this is a known bug in BSD curses (a couple of people have suggested this), is there a work-around/fix ? Thanks in advance, int l1,l2,abroll[12][6]; initscr(); crmode(); nl(); clear(); for(l1=0;l1<12;l1++) for(l2=0;l2<6;l2++) { move(l2+6,l1*4+5); refresh(); printw("%2d",abroll[l1][l2]); refresh(); /* when I include this commented out code, it works fine ... */ /* move(23,1); refresh(); printw(" debug : gxy(%d,%d) ",l1*4+4,l2+6); refresh(); */ sleep(1); } David T Cook | e-mail: dcook@spam.adelaide.edu.au | Phone: +61 8 228 5709 Assistant Computer Manager, Stats, Pure and Applied Maths LMG, Adelaide Uni "The wonderful thing about USENET is that anyone can express their opinion." "The worrying thing is that they _do_."