home *** CD-ROM | disk | FTP | other *** search
-
- /* g4field.c
-
- (c)Copyright Sequiter Software Inc., 1987-1990. All rights reserved.
-
- This is the only SAY/GET Screen I/O routine which uses Code Base
- database management routines.
-
- Consequently, it is in its own file to make the SAY/GET module
- and the other Code Base modules independent of one another.
- */
-
- #include "w4.h"
- #include "d4base.h"
-
-
- void g4field( int row, int col, long field_ref )
- {
- GET *get_ptr ;
- char field_type ;
- int width ;
-
- field_type = f4type(field_ref) ;
- if ( field_type == 'M' ) return ;
- if ( field_type == 'F' ) field_type = 'N' ;
-
- if ( field_type == 'L' )
- {
- get_ptr = g4alloc( row, col, f4ptr(field_ref), 'C') ;
- g4picture( "L" ) ;
- }
- else
- get_ptr = g4alloc( row, col, f4ptr(field_ref), field_type) ;
- if ( field_type != 'D' )
- {
- if ( (width = f4width(field_ref)) >= MAX_GET_WIDTH-1 )
- width = MAX_GET_WIDTH-2 ;
- get_ptr->width_data = get_ptr->width_scr = width ;
- get_ptr->num_decimals = f4decimals(field_ref) ;
- }
- }
-
-
- void w4field( int row, int col, long field_ref )
- {
- int width ;
- char *ptr ;
-
- ptr = f4ptr( field_ref ) ;
- if ( ptr == (char *) 0 ) return ;
-
- width = f4width( field_ref ) ;
-
- switch( f4type(field_ref) )
- {
- case 'D':
- w4( row, col, c4dt_format( ptr, v4default_date )) ;
- break ;
-
- case 'N':
- case 'F':
- case 'L':
- case 'C':
- w4num( row, col, ptr, width ) ;
- break ;
- }
- }
-
-
-