Why doesn't "If INTCON.1 and intcon.4 Then" compil

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
Blue Bill
Posts: 10
Joined: Thu Sep 27, 2012 3:37 pm
Location: Toronto

Why doesn't "If INTCON.1 and intcon.4 Then" compil

Post by Blue Bill » Mon Jun 03, 2013 2:29 pm

Code: Select all

If INTCON.1 and INTCON.4 Then
gives me a
Boolean expression expected. I'm sure it's something simple I'm overlooking.
Blue Bill (aka BlueRoomElectronics)

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Mon Jun 03, 2013 2:52 pm

Unlike C, Swordfish has true booleans, so a conditional expression (if, while etc) must be a boolean expression.

For example:

Code: Select all

if INTCON.Booleans(1) and...
or

Code: Select all

dim value as INTCON.1
if value and...
or

Code: Select all

if INTCON1 = 1 then

User avatar
Blue Bill
Posts: 10
Joined: Thu Sep 27, 2012 3:37 pm
Location: Toronto

Post by Blue Bill » Mon Jun 03, 2013 3:24 pm

Thanks David, I thought I tried that but guess I didn't

Funny it doesn't automatically capitalize ".booleans(x)" with the current Si version.

PS fantastic compiler. I'll have to take a look at Firewing
Blue Bill (aka BlueRoomElectronics)

Post Reply