help with #option and defining bits

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

help with #option and defining bits

Post by Jerry Messina » Wed Mar 11, 2009 10:39 am

I've seen the following syntax in a few modules

Code: Select all

#option SSPI_SCK = PORTC.3
dim FSCK as SSPI_SCK.SSPI_SCK@
This seems to define FSCK as a 'bit', whereas if I do

Code: Select all

#option SSPI_SCK = PORTC.3
dim FSCK as SSPI_SCK
FSCK ends up being a 'byte', which isn't what I want.

I can't seem to find this explained anywhere. Is there a reference to how this works?

Thanks,
Jerry

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Fri Mar 13, 2009 4:45 pm

dear Jerry,

I couldn't find reference to the use of @ in this sense either. In the SF manual, @ is the unary operator and points to the address of the particular variable coming after it. But using it at the end of the variable is something not documented at all. I couldn't find it in the help file and neither in the pdf file.

Moreover, the preprocessor list is also incomplete in the help file. There is no reference to #IsValidPortPin and #IsValidPort. I am not sure how many other preprocessors that are not listed.

We will have to clarify this with David or the other beta testers.
Maybe David should revise the help file to include these.

Regards,
Liak

Post Reply