home *** CD-ROM | disk | FTP | other *** search
- # include <stdio.h>
- # include <bench.h>
- # include <proc.io>
- # include "iodef.h"
- # include "field.h"
- # include "sup.h"
- # include "screen.h"
-
- /*
- * find field above the current one
- */
-
- void up_field(cur, table, screen, ip, ip_fld)
- int *cur;
- int table;
- int screen;
- struct ipf *ip;
- FIELD *ip_fld;
- {
- int i,save = 0;
- int row = ip_fld[*cur].frow;
- int col = ip_fld[*cur].fcol;
-
- for (i = 0; ip[i].screen != -1; i++)
- if (ip[i].table == table && ip[i].screen == screen)
- if (ip_fld[i].fcol == col)
- if (ip_fld[i].frow < row)
- if (ip_fld[i].frow > ip_fld[save].frow || save == 0 )
- save = i;
- if (save)
- {
- *cur = save;
- return;
- }
- prev_field(cur, table, ip);
- }
-
- /*
- * find field below the current one
- */
-
- void down_field(cur, table, screen, ip, ip_fld)
- int *cur;
- int table;
- int screen;
- struct ipf *ip;
- FIELD *ip_fld;
- {
- int i,save = 0;
- int row = ip_fld[*cur].frow;
- int col = ip_fld[*cur].fcol;
-
- for (i = 0; ip[i].screen != -1; i++)
- if (ip[i].table == table && ip[i].screen == screen)
- if (ip_fld[i].fcol == col)
- if (ip_fld[i].frow > row)
- if (ip_fld[i].frow < ip_fld[save].frow || save == 0 )
- save = i;
- if (save)
- {
- *cur = save;
- return;
- }
- next_field(cur, table, ip);
- }
-
-