From: Pam & H. N. <phn...@ve...> - 2007-01-08 23:51:52
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Hi,<br> <br> This is an update to my request for an update to curses accept which allow preexisting data to be displayed as opposed to being over written by an empty variable.<br> <br> I am not, nor do I plan to become a C programmer. I did, however find an easy way to acheive my goals without apparently causing any other problems to occur.<br> <br> In the scr_curses.c file I changed one variable to another<br> /*-------------------------------------------------------------------------*\<br> | |<br> | _DisplayForAccept |<br> | |<br> \*-------------------------------------------------------------------------*/<br> static void _DisplayForAccept(struct ScrFld *pFld) {<br> <br> set_atributes(pFld);<br> tcob_scr_setyx(pFld->iLine, pFld->iCol);<br> <br> if(pFld->iAttributes & SCR_BLANK_LINE)<br> clrtoeol();<br> <br> if(pFld->iAttributes & SCR_SECURE)<br> tcob_scr_setchar('*', pFld->fldScr.len);<br> else if(pFld->iAttributes & SCR_NOECHO)<br> tcob_scr_setchar(' ', pFld->fldScr.len);<br> else<br> addnstr(pFld->caWk,pFld->iFldPos + 1); <big>This is the line I changed. I took the variable </big>pFld->fldScr.len out <big>and replaced it with</big> pFld->iFldPos + 1<br> <big>This change results in the display to terminate at the end of the newly typed in data instead of at the</big><br> // else <big>end of the variable.<br> </big>// addnstr(pFld->caWk, pFld->fldScr.len); <big>I know you aren't really interested with developing a compiler unique to each application, <br> but this change may be useful to others and it allowed me to make my customer happy.<br> </big>}<br> void tcob_scr_display_field(struct ScrFld *pFld){<br> _DisplayField(pFld);<br> }<br> void tcob_scr_display_for_input(struct ScrFld *pFld){<br> // _DisplayForAccept(pFld);<br> }<br> void tcob_scr_display(struct ScrFld *fields){<br> struct ScrFld *pFld;<br> <br> for(pFld=fields; pFld; pFld=pFld->pNext) {<br> // if(pFld->fldFrom) { /* if we have a from field */<br> // tcob_move(pFld->fldFrom, pFld->caFrom, &(pFld->fldScr), pFld->caScr);<br> // }<br> tcob_scr_display_field(pFld);<br> tcob_scr_setx(tcob_scr_getx() + pFld->fldScr.len);<br> }<br> } <br> </body> </html> |
From: David E. <de...@us...> - 2007-01-09 07:57:42
|
Harold Norris wrote: > ... > This is an update to my request for an update to > curses accept which allow preexisting data to be > displayed as opposed to being over written by an > empty variable. > > I am not, nor do I plan to become a C programmer. > I did, however find an easy way to achieve my goals > without apparently causing any other problems to occur. After some small tests, I suspect your modifications do not fully meet your objective. Just to clarify your objective. Do you have some small sample COBOL code you could you post to this list, which demonstrates what you are trying to achieve. David Essex |