home *** CD-ROM | disk | FTP | other *** search
- #include "microlib.h"
-
- /*****************************************************************************/
- /* Function: void statline(char *line) */
- /* Description: Displays the status line at row 23 centred. Letters between */
- /* two "&....&" are printed with the attribute custom[STAT_F]. */
- /* Parameters: char *line -> string to display. */
- /* Returns: Nothing. */
- /* Uses: Attribute from custom[STAT_N] and custom[STAT_F]. */
- /*****************************************************************************/
- void statline(line)
- char *line;
- {
- int i, count, col, intensity_flag, prev_wref;
-
- count = 0;
- i = 0;
- col = 0;
- intensity_flag = 0; /* ( 0=STAT_N, 1=STAT_F ) */
- prev_wref = w4select(1);
-
- strcpy(statusline_save, line);
-
- w4num_att(23, 0, space(80), 80, custom[STAT_N]);
-
- /* Count the '&' characters in line */
- while(line[i]) {
- if(line[i] == '&')
- count ++;
- i ++;
- }
-
- /* Find where the first character will be printed. */
- col = (80 - (strlen(line) - count)) / 2;
-
- /* Print the string in row 23 with the right attributes. */
- i = 0;
- while(line[i]) {
- if(line[i] == '&') {
- intensity_flag = intensity_flag ? 0 : 1 ;
- }
- else {
- w4num_att(23, col, &line[i], 1, intensity_flag ? custom[STAT_F]:custom[STAT_N]);
- col ++;
- }
- i ++;
- }
- w4select(prev_wref);
- }
-
- /*****************************************************************************/
- /* Function: void helpline(char *line) */
- /* Description: Displays the help line at row 24 centred. */
- /* Parameters: char *line -> string to display. */
- /* Returns: Nothing. */
- /* Uses: Attribute from custom[MESS_N]. */
- /*****************************************************************************/
- void helpline(line)
- char *line;
- {
- int col = 0;
- int prev_wref = 0;
-
- prev_wref = w4select(1);
-
- strcpy(helpline_save, line);
- w4num_att(24, 0, space(80), 80, custom[MESS_N]);
- col = (80 - strlen(line))/ 2;
- w4num_att(24, col, line, strlen(line), custom[MESS_N]);
- w4select(prev_wref);
- }
-
- /*****************************************************************************/
- /* Function: char *space(int num) */
- /* Description: Returns a pointer to a blank string of */
- /* num spaces (space_line) */
- /* Parameters: int num -> number of spaces. */
- /* Returns: A pointer to the string of spaces. */
- /* Uses: Nothing. */
- /*****************************************************************************/
- char *space(num)
- int num;
- {
- char *sp_str_p;
- sp_str_p = &space_line[0];
- return(sp_str_p + (80 - num));
- }
-
- /*****************************************************************************/
- /* Function: blank(char *str, int len) */
- /* Description: Fills a sting with spaces. */
- /* Parameters: char *str -> String to fill. */
- /* int len -> Length of string to blank. */
- /* Returns: Nothing. */
- /* Uses: Nothing. */
- /*****************************************************************************/
- int blank(str, len)
- char *str;
- int len;
- {
- int i;
- for (i = 0; i < len; ++ i, str ++)
- *str = ' ';
- }
-
-
- /*****************************************************************************/
- /* Function: int screen_file(char *scr_filename, int rows, int columns) */
- /* Description: Reads a screen from a file and displays it at the current */
- /* window. */
- /* Parameters: char *scr_filename -> File name of the screen file. */
- /* int rows -> Rows to read and display. */
- /* int columns -> Columns to display. */
- /* Returns: 1 on error, 0 if ok. */
- /* Uses: w4display(). */
- /*****************************************************************************/
- int screen_file(scr_filename, rows, columns)
- char *scr_filename;
- int rows;
- int columns;
- {
- FILE *scr;
- int count;
- char line[80];
- char *p_end; /* Pointer to the newline character. w4() must not */
- /* display newline character. */
- char *p_input; /* Pointer to the characters '&' in every line. */
-
-
- char *xorscr; /* XOR screen pointer */
- int xc; /* XOR screen character count */
- int lc; /* Line count */
- int xlen; /* XOR screen actual number of characters. (MAX 2000) */
-
-
- w4clear(0);
- /* Allocate memory for the XORED screen */
- if( (xorscr = (char *) malloc(sizeof(char) * 2000)) == NULL ) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
-
- /* Open the XORED screen file read MAX 2000 characters and close again. */
- if ((scr = fopen(scr_filename, "rb")) == NULL) {
- w4display(mes[MT+1], mes[ME], " ",scr_filename, (char *) 0);
- return(1);
- }
-
- xlen = fread(xorscr, 1, 2000, scr);
- fclose(scr);
-
- xc = 0; /* Point to the first character on the XORED screen (only ONCE!)*/
-
- for(count = 0; count <= rows; count++) {
- /* Simulate fgets() but with a XORED file. */
- for(lc = 0;;xc++, lc++) {
- if(xc == 0)
- line[lc] = xorscr[xc] ^ 35;
- else
- line[lc] = xorscr[xc] ^ xorscr[xc-1];
-
- if(line[lc] == '\r') {
- line[lc] = '\n';
- line[lc+1] = '\0';
- xc ++;
- xc ++;
- break;
- }
- if(lc == columns - 1 || xc >= xlen) {
- line[lc] = '\n';
- line[lc+1] = '\0';
- xc ++;
- break;
- }
- }
-
- p_end = strchr(line, '\n');
- *p_end = ' ';
-
- while((p_input = strchr(line, '&')) != NULL ) {
- *p_input = ' ';
- *(++ p_input) = ' ';
- *(++ p_input) = ' ';
- }
-
- w4(count, 0, line );
- }
-
- free(xorscr);
- return(0);
- }
-
-
- /*****************************************************************************/
- /* Function: int get_input_positions(char *scr_filename) */
- /* Description: Reads a the input positions from a file and places marks */
- /* to a mattrix of integers. */
- /* Parameters: char *scr_filename -> File name of the screen file. */
- /* Returns: 1 on error, 0 if ok. */
- /* Uses: w4display(). */
- /*****************************************************************************/
- int get_input_positions(scr_filename)
- char *scr_filename;
- {
- FILE *scr;
- int mark;
- int row;
- int col;
- char line[80];
- char *line_inp; /* Position of marker in line. */
-
- char *xorscr; /* XOR screen pointer */
- int xc; /* XOR screen character count */
- int lc; /* Line count */
- int xlen; /* XOR screen actual number of characters. (MAX 2000) */
-
- /* Allocate memory for the XORED screen */
- if( (xorscr = (char *) malloc(sizeof(char) * 2000)) == NULL ) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
-
- /* Open the XORED screen file read MAX 2000 characters and close again. */
- if ((scr = fopen(scr_filename, "rb")) == NULL) {
- w4display(mes[MT+1], mes[ME], " ",scr_filename, (char *) 0);
- return(1);
- }
- xlen = fread(xorscr, 1, 2000, scr);
- fclose(scr);
-
- /* Mattrix Initialization. */
- for(row = 0; row <= 39; row ++)
- srow[row] = 0;
- for(col = 0; col <= 39; col++ )
- scol[col] = 0;
-
- xc = 0; /* Point to the first character on the XORED screen (only ONCE!)*/
- /* Fill the mattrix. */
- for(row = 0; row <= 24; row++) {
- /* Simulate fgets() but with a XORED file. */
- for(lc = 0;;xc++, lc++) {
- if(xc == 0)
- line[lc] = xorscr[xc] ^ 35;
- else
- line[lc] = xorscr[xc] ^ xorscr[xc-1];
-
- if(line[lc] == '\r') {
- line[lc] = '\n';
- line[lc+1] = '\0';
- xc ++;
- xc ++;
- break;
- }
- if(lc == 79 - 1 || xc >= xlen) {
- line[lc] = '\n';
- line[lc+1] = '\0';
- xc ++;
- break;
- }
- }
-
- while( (line_inp = strchr(line, '&')) != NULL ) {
- *line_inp = ' ';
- line_inp[3] = '\0';
- col = line_inp - line;
- srow[atoi(line_inp)] = row;
- scol[atoi(line_inp)] = col + 1;
- line_inp[3] = ' ';
- }
- }
- free(xorscr);
- return(0);
- }
-
-
- /*****************************************************************************/
- /* Function: int zerofill(char *field, int num) */
- /* Description: Fills with zeros the begining of a field which is not */
- /* filled from the user. */
- /* Parameters: char *field -> File name of the screen file. */
- /* int num -> The Width of the field. */
- /* Returns: Nothing. */
- /* Uses: Nothing. */
- /*****************************************************************************/
- int zerofill(field, num)
- char *field;
- int num;
- {
- int count, i;
- char tmp_field[20];
-
- memcpy(tmp_field, field, num);
-
- c4trim_n(tmp_field, num+1);
- for(count = 0; count < num - strlen(tmp_field); count ++)
- field[count] = '0';
-
- i = 0;
- while(count < num) {
- field[count] = tmp_field[i ++];
- count ++;
- }
- }
-
- /*****************************************************************************/
- /* Function: int wshow(char *line) */
- /* Description: Displays a window with a string. */
- /* Parameters: char *line -> string to display. */
- /* Returns: TRUE if ENTER, FALSE if ESC */
- /* Uses: */
- /*****************************************************************************/
- int wshow(line)
- char *line;
- {
- int wshow_wref;
-
- wshow_wref = w4define(10, 15, 16, 65);
- w4border( DOUBLE, custom[WAIT_B]);
- w4attribute (custom[WAIT_N]);
- w4popup();
- w4memory();
- w4activate(wshow_wref);
-
- w4centre(1, line);
- return(0);
- }
-
- /*****************************************************************************/
- /* Function: int warning(char *line) */
- /* Description: Displays a warrning window and waits for Esc or Enter. */
- /* Parameters: char *line -> string to display. */
- /* Returns: TRUE if ENTER, FALSE if ESC */
- /* Uses: */
- /*****************************************************************************/
- int warning(line)
- char *line;
- {
- int col = 0;
- int warn_wref;
- int key_val;
-
- warn_wref = w4define(10, 15, 16, 65);
- w4border( DOUBLE, custom[WARN_N]);
- w4attribute (custom[WARN_N]);
- w4popup();
- w4memory();
- w4activate(warn_wref);
-
- col = (50 - strlen(line))/ 2;
- w4(1, col, line);
- w4(2, 14, "ENTER-NAI / ESC-OXI");
- w4(2, 43, "┌───┐");
- w4(3, 43, "│ ! │");
- w4(4, 43, "└───┘");
- for(;;) {
- key_val = g4char();
- if(key_val == RETURN ) {
- w4deactivate(warn_wref);
- w4close(warn_wref);
- w4select(warn_wref -1);
- return(1);
- }
- if(key_val == ESC) {
- w4deactivate(warn_wref);
- w4close(warn_wref);
- w4select(warn_wref -1);
- return(0);
- }
- }
- }
-
- /*****************************************************************************/
- /* Function: int help(char *search_str) */
- /* Description: Displays the help screen with the index key "search_key". */
- /* Parameters: char *search_str -> index key to search for. */
- /* Returns: Nothing. */
- /* Uses: */
- /*****************************************************************************/
- #define NEXTSYMBOL "\20"
- int help(search_str)
- char *search_str;
- {
- FILE *hlp;
- int help_wref;
- int previous_wref;
- int no_help_flag; /* Flag: If TRUE the Index Key was not found. */
-
- int cur_row;
- char line[80];
- char *lpos; /* Pointer to the line string. (Used to convert */
- /* '\n' to NULL */
- char *ind;
- int i;
- long file_pos;
-
- no_help_flag = FALSE;
- cur_row = 1;
- line[0]='\0';
- previous_wref = w4select(-1);
-
- help_wref = w4define(3, 3, 21, 76);
- w4border(DOUBLE, custom[HELPSCR_N]);
- w4attribute(custom[HELPSCR_N]);
- w4popup();
- w4memory();
- w4activate(help_wref);
- /* Open help file. */
- if ((hlp = fopen("IEP.HLP", "rb")) == NULL) {
- w4display("", mes[ME], "IEP.HLP", (char *)0);
- w4deactivate(help_wref);
- w4close(help_wref);
- w4select(previous_wref);
- return(1);
- }
-
- /* Allocate memory for the XORED index */
- if( (ind = (char *) malloc(sizeof(char) * 2000)) == NULL ) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
-
- /* Seek for Index Key ! */
- fread(ind, 1, 2000, hlp);
- for(i = 0; i <= 1999; i++) {
- ind[i] = ind[i] ^ 35;
- }
-
- if(!strstr(ind, search_str)) {
- w4display("", mes[ME+8], (char *)0);
- no_help_flag = TRUE;
- }
- if( ! no_help_flag) {
- /* If found display title. */
- w4attribute(custom[HELPSCR_T]);
- file_pos = c4atol(strstr(ind, search_str) + 20, 6);
- fseek(hlp, file_pos, SEEK_SET);
-
- xorgets(line, 79, hlp);
- lpos = strchr(line, '\n');
- *lpos = '\0';
- w4(cur_row, 1, line);
-
- /* Display help. */
- w4attribute(custom[HELPSCR_N]);
- xorgets(line, 79, hlp);
- cur_row ++;
- for(;;) {
- for(;cur_row <= 15; cur_row ++) {
- lpos = strchr(line, '\n');
- *lpos = '\0';
- w4(cur_row, 1, line);
- xorgets(line, 79, hlp);
- if( strstr(line, "##")) {
- break;
- }
- }
- if( strstr(line, "##")) {
- g4char();
- break;
- }
- w4num_att(16, 69, NEXTSYMBOL, 1, custom[HELPSCR_S]);
- if(g4char() == ESC)
- break;
- w4clear(0);
- cur_row = 1;
- }
- }
- free(ind);
- fclose(hlp);
- w4deactivate(help_wref);
- w4close(help_wref);
- w4select(previous_wref);
- }
-
- int xorgets(char *line, int num, FILE *fp)
- {
- char *xorline;
-
- int lc; /* Line count */
- int xc; /* Line count */
- int xlen ;
- long file_pos;
-
- /* Allocate memory for the XORED line */
- if( (xorline = (char *) malloc(sizeof(char) * num)) == NULL ) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
-
- file_pos = ftell(fp);
-
- xlen = fread(xorline, 1, num, fp);
- if( !xlen ) {
- free(xorline);
- return(0);
- }
-
- xc = 0;
- for(lc = 0;; lc++) {
- line[lc] = xorline[xc] ^ 35;
- xc ++;
-
- if(line[lc] == '\r') {
- line[lc] = '\n';
- line[lc+1] = '\0';
- xc ++;
- fseek(fp, file_pos + (long) xc, SEEK_SET);
- break;
- }
- if( lc == num - 1 ) {
- line[lc] = '\n';
- line[lc+1] = '\0';
- break;
- }
- } /* for loop */
- free(xorline);
- return(1);
- }
-
- #ifdef MANOS
- int xorgets(char *line, int num, FILE *fp)
- {
- char *xorline;
-
- char xtmp; /* XOR character */
- int lc; /* Line count */
- int xc; /* Line count */
- int xlen ;
- long file_pos;
-
- /* Allocate memory for the XORED line */
- if( (xorline = (char *) malloc(sizeof(char) * num)) == NULL ) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
-
- file_pos = ftell(fp);
- if(file_pos != 0L) {
- fseek(fp, -1L, SEEK_CUR);
- fread(&xtmp, 1, 1, fp);
- }
-
- xlen = fread(xorline, 1, num, fp);
- if( !xlen ) {
- free(xorline);
- return(0);
- }
-
- xc = 0;
- for(lc = 0;; lc++) {
- if(lc == 0 && file_pos == 0L) {
- line[lc] = xorline[xc] ^ 35;
- xtmp = xorline[xc];
- xc ++;
- }
- else {
- line[lc] = xorline[xc] ^ xtmp;
- xtmp = xorline[xc];
- xc ++;
- }
-
- if(line[lc] == '\r') {
- line[lc] = '\n';
- line[lc+1] = '\0';
- xc ++;
- fseek(fp, file_pos + (long) xc, SEEK_SET);
- break;
- }
- if( lc == num - 1 ) {
- line[lc] = '\n';
- line[lc+1] = '\0';
- break;
- }
- } /* for loop */
- free(xorline);
- return(1);
- }
- #endif
-
- /*****************************************************************************/
- /* Function: int browse(int wtop, int wleft, int wbottom, char *wtitle, */
- /* D4DATA *dbfile, X4FILTER filter, F4FIELD **fields_ref, */
- /* int num_fields) */
- /* Description: Browses the specified fields of the selected database */
- /* Parameters: int wtop - */
- /* int wleft - */
- /* int wbottom -> Coordinates of the browse window. */
- /* X4FILTER filter -> The database to be browsed. */
- /* F4FIELD **fields_ref-> Mattrix containing the reference numbers */
- /* of the fields to be displayed. */
- /* int num_fields -> Total number of fields to be displayed. */
- /* Returns: Nothing. */
- /* Uses: w4define(), w4activate(), w4attribute(), w4num_att(), w4border(), */
- /* w4title(), w4popup(), w4memory(), w4select(), w4deactivate(), */
- /* w4close(), f4width(), f4str(), x4skip(), x4bottom(). */
- /*****************************************************************************/
- int browse(wtop, wleft, wbottom, wtitle, dbfile, filter, fields_ref, num_fields)
- int wtop, wleft, wbottom, num_fields;
- char *wtitle;
- D4DATA *dbfile;
- X4FILTER filter;
- F4FIELD **fields_ref;
- {
- int browse_wref, prev_wref;
- int key_val;
- int i; /* Counter. */
- int cur_col = 0;
- int cur_row = 0;
- int wright; /* Window's Right position. */
- int maxrow = (wbottom - wtop) - 2;
- char result_ptr[9];
-
- /* Find window's right border position. */
- for(i = 0, wright = 0; i <= num_fields -1; i ++) {
- wright = wright + f4len(fields_ref[i]);
- ++ wright;
- }
- wright = wleft + wright;
- /* Create the Browse window */
- browse_wref = w4define(wtop, wleft, wbottom, wright);
- w4attribute(custom[BROWSER_N]);
- w4border(DOUBLE, custom[BROWSER_B]);
- w4title(0, 1, wtitle,custom[BROWSER_B]);
- w4popup();
- w4memory();
- w4activate(browse_wref);
- prev_wref = w4select(-1) - 1;
-
- /* Display the records */
- for(cur_row = 0; cur_row <= maxrow ; cur_row ++) { /* ==L1== */
- for(i = 0; i < num_fields -1 ; i ++) { /* == L2 == */
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- cur_col = cur_col + f4len(fields_ref[i]);
- w4num_att(cur_row, cur_col, "│", 1, custom[BROWSER_N]);
- ++ cur_col;
- } /* == L2 == */
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- if(x4skip( &filter, 1)) {
- d4unlock_index(dbfile);
- break;
- }
- d4unlock_index(dbfile);
- cur_col = 0;
- } /* == L1 == */
-
- /* Skip to the first record found. */
- for(i = 0 ; i <= cur_row; i ++)
- x4skip(&filter, -1);
-
- d4unlock_index(dbfile);
- cur_col = 0;
- cur_row = 0;
-
- /* Display the bar */
- for(i = 0; i < num_fields -1 ; i ++) { /* == L1 == */
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- cur_col = cur_col + f4len(fields_ref[i]);
- w4num_att(cur_row, cur_col, "│", 1, custom[BROWSER_S]);
- ++ cur_col;
- } /* == L1 == */
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- cur_col = 0;
-
-
- for (;;) { /* == L1 == */
- key_val = g4char();
-
- if(key_val == ESC || key_val == RETURN)
- break;
- if(key_val == DOWN) { /* == If DOWN == */
- /* Display with normal attribute the current row. */
- for(i = 0, cur_col = 0; i < num_fields -1 ; i ++) { /* == L2 == */
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- cur_col = cur_col + f4len(fields_ref[i]);
- w4num_att(cur_row, cur_col, "│", 1, custom[BROWSER_N]);
- ++ cur_col;
- } /* == L2 == */
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_N]);
-
- if (x4skip(&filter, 1) == r4eof) {
- x4bottom(&filter);
- cur_row --;
- }
- d4unlock_index(dbfile);
- if (cur_row == maxrow) {
- cur_row --;
- w4scroll(1);
- }
- cur_row ++;
- /* Display the bar */
- for(i = 0, cur_col = 0; i < num_fields -1 ; i ++) { /* ==L2 ==*/
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- cur_col = cur_col + f4len(fields_ref[i]);
- w4num_att(cur_row, cur_col, "│", 1, custom[BROWSER_S]);
- ++ cur_col;
- } /* ==L2==*/
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- } /* == If DOWN == */
-
-
- else if (key_val == UP) { /* == If UP == */
- /* Display with normal attribute the current row. */
- for(i = 0, cur_col = 0; i < num_fields -1 ; i ++) { /* == L2 ==*/
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- cur_col = cur_col + f4len(fields_ref[i]);
- w4num_att(cur_row, cur_col, "│", 1, custom[BROWSER_N]);
- ++ cur_col;
- } /* == L2 == */
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_N]);
- if (x4skip(&filter, -1)) {
- x4top(&filter);
- cur_row ++;
- }
- d4unlock_index(dbfile);
- if (cur_row == 0) {
- cur_row ++;
- w4scroll(-1);
- }
- cur_row --;
- for(i = 0, cur_col = 0; i < num_fields -1 ; i ++) {
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- cur_col = cur_col + f4len(fields_ref[i]);
- w4num_att(cur_row, cur_col, "│", 1, custom[BROWSER_S]);
- ++ cur_col;
- }
- if(f4type(fields_ref[i]) == 'D') {
- a4format(f4str(fields_ref[i]), result_ptr, "DD/MM/YY");
- w4num_att(cur_row, cur_col, result_ptr,\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- }
- else
- w4num_att(cur_row, cur_col, f4str(fields_ref[i]),\
- f4len(fields_ref[i]), custom[BROWSER_S]);
- } /* == If UP == */
- } /* == L1 == */
- w4deactivate(browse_wref);
- w4close(browse_wref);
- w4select(prev_wref);
- return(key_val);
- }
-
- int deb(times)
- int times;
- {
- int count;
- long i;
-
- for(count = 1; count <= times; count ++) {
- g4bell_set(1);
- g4bell();
- g4bell_set(0);
- for(i = 1 ; i <= 130000; i ++);
- }
- g4char();
- }
-
- int clen( entry_area, length )
- char *entry_area;
- int length;
- {
- if(memcmp(entry_area, space(length), length))
- return(length);
- else
- return(0);
- }
-