Previous Next Up Title Contents Index Functions Index Top Library

INITIALIZE STRING 3

pinit_string3


CALL SEQUENCE

void pinit_string3 (ws_id, string_dev, init_string, pet, echo_volume, string_data_rec)

INPUT PARAMETERS

Pint	ws_id,
Pint	string_dev,
const char	*init_string,
Pint 	pet,
const Plimit3	*echo_volume,
const Pstring_data3	*string_data_rec

ARGUMENTS

ws_id,
Workstation identifier
string_dev,
String device number
init_string,
Initial string
pet,
Prompt and echo type
echo_volume,
Echo volume
string_data_rec
Data record

TYPES

typedef struct {
	Pfloat	x_min;	/* minimum x 	*/
	Pfloat	x_max;	/* maximum x 	*/
	Pfloat	y_min;	/* minimum y 	*/
	Pfloat	y_max;	/* maximum y 	*/
	Pfloat	z_min;	/* minimum z 	*/
	Pfloat	z_max;	/* maximum z 	*/
} Plimit3;
typedef struct {
	Pint 		n_buf_size;	/* input buffer size	*/
	Pint			init_pos;	/* initial editing position	*/
	union Pstring3_pets {
		struct	Pstring3_pet_r1 {
			int	impl_dep;
		} pet_r1;
		int		impl_dep;
	} pets;
} Pstring_data3;

PHIGS STATE

(PHOP, WSOP, *, *).

EFFECT

This function initializes the STRING input device (character string input) number string_dev for workstation ws_id.

Devices 1 to 20 are available.

The following echo types are available:

The following fields of a Pstring_data structure are to be initialized:

Pstring_data string_datra_rec;

string_data_rec.in_buf_size = maximum length of the returned string.

string_data_rec.init_pos = initial editing position.

Example:

/* Sample program for initialization of a string device */

#include <phigs.h>

main()
{
	Pint ws_id,string_dev,pet;
	Pstring_data string_data_rec;
	char *init_string;
	Plimit echo_area;

/* Open PHIGS session */
	popen_phigs  (PDEF_ERR_FILE,PDEF_MEM_SIZE);

/* Open workstation */
	ws_id = 1;
	popen_ws  (ws_id,"GPHIGS.OUT",8887);

/* Initialize string device number 1 with echo type number -1 */
	string_dev = 1;
	init_string = "Enter:";
	pet = -1;
	string_data_rec.in_buf_size = 80;
	string_data_rec.init_pos = 7;
	echo_area.x_min = 0.;
	echo_area.y_min = 0.;
	echo_area.x_max = .3;
	echo_area.y_max = .1;
	pinit_string(ws_id,string_dev,init_string,
			pet,&echo_area,&string_data_rec);

/* Close workstation */
	pclose_ws(ws_id);

/* Close PHIGS session */
	pclose_phigs();
}

ERRORS

3
Ignoring function, function requires state (PHOP, WSOP,*,*)
54
Ignoring function, the specified workstation is not open
61
Ignoring function, specified workstation is neither of category INPUT nor of category OUTIN
250
Ignoring function, the specified device is not available on the specified workstation
251
Ignoring function, the function requires the input device to be in REQUEST mode
254
Ignoring function, invalid echo area volume: XMIN>>=XMAX, YMIN>>=YMAX or ZMIN>>ZMAX
255
Ignoring function, one of the echo area volume boundary points is outside the range of the device
253
Ignoring function, the specified prompt echo type is not available on the specified workstation
260
Ignoring function, one of the fields within the input device data record is in error
261
Ignoring function, initial value is invalid
263
Ignoring function, length of the initial string is greater than the buffer size

SEE ALSO

initialize string, set string mode, request string 3, sample string 3, get string 3, inquire string device state 3, inquire default string device state 3, inquire number of available logical input devices


Previous Next Up Title Contents Index Functions Index Top Library