Anobium - 2013-11-08

Within Great Cow Basic you can use regular variable assignments. But, you can also use C like maths assignments.

See http://gcbasic.sourceforge.net/help/settingvariables.htm for the help file.

The following is also supported:

~~~~~ 
GLCDPrintLoc += 6
CharCode -= 15
CharCode++
CharCode---
~~~~~~

Within Great Cow Basic you can define constants. The following is supported with respect to assigning numbers to constants.

As you can see, you can use many different methods to define constants.

~~~~~
#chip 16F88, 4
#config Osc = INT, MCLRE_OFF

' All these work
#define Test0 b'11111111'
#define Test1 0b11111111
#define Test2 0B11111111
#define Test3 255
#define Test4 0xFF
#define Test5 0xff
#define Test6 0Xff

# Proof
dir porta Out

porta = test0
porta = test1
porta = test2
porta = test3
porta = test4
porta = test5
porta = test6

You can assigned values/numbers with all the methods shown above (for constants and variables) but a warning. 

Use 0 not 00. As one zero is zero and two zeros will give you an unassigned variable. 

Any finally, a few critical constants that are defined. They include:

#define ON 1
#define OFF 0
#define TRUE 255
#define FALSE 0
~~~~

Thanks go to Thomas Henry who found one of these 'gotchas'. Hence, this FAQ....