NAME

generic - format of generic data type

SYNOPSIS

#include <basic/string.h>
#include <basic/type.h>
#include <basic/generic.h>

DESCRIPTION

Some BASIC statements and functions do not have type restrictions, yet good C code ought not to use types loosely.  The generic union permits values of any type to be manipulated in a structured fashion.  The type of the value is conveyed by a separate argument.  A number of functions use this method of passing arguments.  Type is among the following:
/*	Basmark BASIC Compiler
 *
 * Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992
 *	by Basmark Corporation
 *	Cleveland, Ohio, USA	*/

/* codes for run-time function arguments */

	/* types, may be combined to indicate multiple types permitted */
#define TY_STR	0x01	/* string */
#define TY_INT	0x02	/* integer */
#define TY_FLT	0x04	/* float */
#define TY_DBL	0x08	/* double */
	/* address of, indicates value passed by address */
#define TY_ADR	0x10
	/* pass type, indicates that type code is required by function */
#define TY_TYP	0x20

#define	TY_SAD	0x11	/* string address */
#define	TY_PTR	0x3F	/* address of any value, with type */
The generic union is defined as follows:
/*	Basmark BASIC Compiler
 *
 * Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992
 *	by Basmark Corporation
 *	Cleveland, Ohio, USA	*/

union generic {
	short		gn_int;
	float		gn_flt;
	double		gn_dbl;
	struct string	gn_str;
};

FILES

/usr/include/basic/type.h
/usr/include/basic/generic.h

SEE ALSO

strS(cvt), bwrite(io), input(io), numcvt(io), print(io), printu(io), usenum(io), usfnum(io), environ(misc), strinS(str)

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber