summaryrefslogtreecommitdiff
path: root/src/user/app/kbasic/var.c
blob: 6ed22559c8753b849194d0ada309d57472e29d31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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');
}