show_x()

Purpose

Functions that display data in map fields on screen

Old name

#define showx show_x

Syntax

int show_c(mapnr, fieldnr, data)
int show_d(mapnr, fieldnr, data)
int show_h(mapnr, fieldnr, data)
int show_l(mapnr, fieldnr, data)
int show_n(mapnr, fieldnr, data)
int show_t(mapnr, fieldnr, data)
int show_y(mapnr, fieldnr, data)

Parameters

int mapnr

Map containing field to display

 

int fieldnr

Number of field to display data in

 

<type> data

Variable or pointer to variable in which to place data to be displayed

 

The <type> of the parameter data depends on which of the show_x() functions is being used, as shown below. Also shown is the corresponding DP4 datatype for each of the show_x() functions:

Function Type DP4 datatype

show_c

char *

C,M,S,U

show_d

datetype *

D

show_h

short

I,J,K

show_l

long

L

show_n

double

N

show_t

timetype *

T

show_y

BOOLEAN

Y

Description

These functions display the data in the specified field of the given map.

You are recommended to set up the output properties for data fields with MAPEDIT. This enables you to change the format without having to change the program.

You can also control the format in which the data is displayed with the global variables show_flags and showd_flags. The global variable show_flags is used for all the show_x() functions except show_d which uses the global variable showd_flags. These global variables are initialised to the value DEFAULT.

The global variables show_flags and showd_flags may take any suitable combination of the following values:

 

Value

Meaning

 

DEFAULT

The data is formatted using the flags set in MAPEDIT. This is the preferred method of controlling display formats. (If no format flags are set in MAPEDIT, the user preferences are used).

 

NOT_DEFAULT

You can use this value when the format you want corresponds to the absence of any of the explicify format flags but you won'd want to use the users preferred default format.

 

SKIP_MISSING_FIELD

Allows the program to silently the ignore the system error which would normally be generated if the field to be displayed into is missing from the map.

 

BLANK_IF_ZERO

The field is left blank if you display a value of zero

 

LEFT_JUSTIFY

This left justifies the data displayed within a field

 

RIGHT_JUSTIFY

This right justifies the data displayed within a field

 

FILL_WITH_ASTERISK

This places asterisks (*) in the portion of a field that is not used for displaying data

 

NO_LEADING_ZEROS

This suppresses zeros from the front of numeric data

 

LEADING_ZEROS

This adds zeros to the front of numeric data

 

TRAILING_MINUS

This places a minus sign (-) at the end of negative numbers

 

IN_PARENTHESIS

This places brackets ( () ) around negative numbers

 

WITH_COMMAS

This places commas (,) between every 3 digits of numeric data

 

LONG_YEAR

This displays dates with the year in full, for example 1993 rather than 93

 

YEAR_FIRST

This displays dates with the year first

 

MONTH_FIRST

This displays dates with the month first

 

MONTH_NAME

This displays dates with the month in words. The words used are those that you set in the user preferences

 

NO_SEPARATOR

This displays dates without any separating character (such as /) between the day, month and year

 

SHOW_SECONDS

This includes seconds when times are displayed

 

SHOW_HUNDREDTHS

This includes hundredths of seconds when times are displayed

 

Numeric Data

When using numeric data, you must set the global variable show_flags to DEFAULT or any suitable combination of:

BLANK_IF_ZERO, LEFT_JUSTIFY, RIGHT_JUSTIFY, FILL_WITH_ASTERISK, LEADING_ZEROS, NO_LEADING_ZEROS, TRAILING_MINUS, IN_PARENTHESIS, WITH_COMMAS, NOT_DEFAULT, SKIP_MISSING_FIELD

Dates

When using dates, you must set the global variable showd_flagsto DEFAULT or any suitable combination of:

LONG_YEAR, YEAR_FIRST, MONTH_FIRST, MONTH_NAME, NO_SEPARATOR, NOT_DEFAULT, SKIP_MISSING_FIELD

Times

When using times, you must set the global variable show_flags to DEFAULT or any suitable combination of:

SHOW_SECONDS, SHOW_HUNDREDTHS, NO_SEPARATOR, NOT_DEFAULT, SKIP_MISSING_FIELD

To display multi-occurs fields you should use the function show() directly unless character fields are being displayed, in which case you can still use the function show_c().

See also

show() , show_over(), field_blank() .

Example

 show_c(1,1,customer.name);
 show_d(1,2,&order.date);
 show_t(1,2,&order.time);
 show_h(1,3,orderline.quantity);
 show_l(1,3,longdata);
 show_n(1,4,order.ordernr);
 show_y(1,5,orderline > 100);