OK, for a BASIC string, the actual basic variable looks like:
struct basic_string
{
char type; //equals 3 for type string
char name[2];
unsigned char len;
char *data; //data is in string space or the code
}
HOWEVER, VARPTR(A$) returns a pointer to len.
So, are there any subroutine .CO files out there, that when passed a
VARPTR, backtracks the pointer to check the type? Or can I
just trim things down and say:
struct varptr_string
{
unsigned char len;
char *data;
}
Because if we go with the full struct basic_string, the caller would
have to remember to give it to basic_call() with the pointer +3.
While I'm picking on strings in particular here, this applies to all
the BASIC variables.
Or should I just do both sets of structs (basic_type and varptr_type)
in the include file? structs defined but not used use no space in the
final binary... (I don't think small-c will allow nested structs so the
basic_type struct can't just have a varptr_type struct inside it. :-( )
Willard
--
Willard Goosey [email protected]
Socorro, New Mexico, USA
I search my heart and find Cimmeria, land of Darkness and the Night.
-- R.E. Howard