Metropoli BBS
VIEWER: matchok.c MODE: TEXT (ASCII)
/* Copyright (C) 1993 by Thomas Glen Smith.  All Rights Reserved. */
/* matchok APL2 V1.0.0 *************************************************
* Called by cat, deal, decode, execjotz, find, match and mdivide.      *
* Called to ensure two apl variables are of the same data type,        *
* converting as necessary.  A character variable will be converted to  *
* a numeric type only if it is empty.  When the data types are  a      *
* combination of integer and real, the integer will be converted to    *
* real.  1 is returned if matching data types are obtained.  Otherwise *
* 0 will be returned.                                                  *
***********************************************************************/
#define INCLUDES APLCB
#include "includes.h"
int matchok(pleft,prite,datatyp)
Aplcb pleft[], prite[];
int datatyp;
{
     Endoper; Errinit; Matchoks;
     extern int aplerr;

     if (errinit() == 0)
	     if (matchoks(pleft,prite,datatyp))
	          return(1); /* ok */
     endoper(*pleft);
     *pleft = NULL;
     endoper(*prite);
     *prite = NULL;
     if (aplerr == 0)
	     aplerr = 1; /* dissimilar types */
     return(0); /* data not ok */
}
[ RETURN TO DIRECTORY ]