summaryrefslogblamecommitdiff
path: root/src/user/app/kbasic/var.c
blob: 6ed22559c8753b849194d0ada309d57472e29d31 (plain) (tree)


















                                                     

 
#include <ctype.h>

#include "basic.h"

int variables[26]= {    /* 26 user variables,  A-Z */
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0
};

/* Find a pointer to the value of a variable. */
int* find_var(char *s)
{
	if(!isalpha(*s)){
		serror(4); /* not a variable */
		return 0;
	}
	return variables + (toupper(*s)-'A');
}