reserved words

Questions about the BASICtools and MakeItC
Post Reply
basicchip
Posts: 995
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

reserved words

Post by basicchip » Wed Jan 16, 2013 11:54 pm

>
> Hello everyone! I just purchased an ARMexpress LITE, and have a project going
with it already.
>
> I am trying to interface with an SPI device, and I cannot get the simplest of
things to work in the compiler.
>
> For instance, here is my program:
>
>
> #include
>
> SUB sendData(data)
> str$(0) = data
> 'SPIOUT (CS, CLK, DATA, LSBfirst, 1, str$)
> END SUB
>
>
> And I get the following errors:
>
>
> SUB sendData(data)
> -ERROR In Line PhilipsLCD_testing.bas: 11: parameter error1, found data)
>
> str$(0) = data
> -ERROR In Line PhilipsLCD_testing.bas: 12: Expected Integer Variable or IO,
found (0) = data
>
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> -ERROR In Line PhilipsLCD_testing.bas: 13: Expected string variable, found
str$)
>
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> -ERROR In Line PhilipsLCD_testing.bas: 13: Expected End Of Line, found str$)
>
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> -First ERROR at line :11
>
>
> I just don't get it... If anyone can offer a simple solution to this, I would
be grateful.
> Thank you!
>

I'm sorry, the program is actually

#include

CONST CS = 8
CONST SCLK = 9
CONST SDATA = 10
CONST RST = 11

CONST LSBfirst = 0
CONST MSBfirst = 1

SUB sendData(data)
str$(0) = data
SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
END SUB



basicchip
Posts: 995
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: reserved words

Post by basicchip » Wed Jan 16, 2013 11:54 pm

> SUB sendData(data)
> str$(0) = data
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> END SUB
>

data is a reserved word

don't worry, a second set of eyes is often useful

change the name to something else

basicchip
Posts: 995
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: reserved words

Post by basicchip » Wed Jan 16, 2013 11:55 pm

>
>
> > SUB sendData(data)
> > str$(0) = data
> > SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> > END SUB
> >
>
> data is a reserved word
>
> don't worry, a second set of eyes is often useful
>
> change the name to something else
>

Okay, so I changed it to dataOut, and now I still get the error:
-ERROR In Line PhilipsLCD.bas: 22: Expected Integer Variable or IO, found (0) =
"dataOut"

thank you for the help

basicchip
Posts: 995
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: reserved words

Post by basicchip » Wed Jan 16, 2013 11:55 pm

> change the name to something else
>
Oh jeez, nevermind. I never dim'ed the str$. Thanks again!

Post Reply