summaryrefslogblamecommitdiff
path: root/src/user/app/kbasic/var.c
blob: a49ce6104af35cc40184c7f18a430427e0a185c5 (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');
}