Accessing bit in module

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
arco
Posts: 312
Joined: 15 Apr 2008 13:54
Location: The Netherlands

Accessing bit in module

#1 Post by arco » 01 Oct 2018 13:12

I have a main module where I declare some GP flags

Code: Select all

Program MyMain
include "MyModule"

Dim Flags As Word
  fError As sBit At Flags.0
  fOK   As sBit At Flags.1
  ..
  ..
I now want to access bits 'fError' and 'fOK' in the 'Flags' word, so I declare:

Code: Select all

Module MyModule

Dim Flags As Word External
I can now access 'Flags', but not the bits in it. How do I access them in the module?
(I tried to redeclare the bits or set bits as external, but both aren't allowed)
Regards,

Peter.

arco
Posts: 312
Joined: 15 Apr 2008 13:54
Location: The Netherlands

Re: Accessing bit in module

#2 Post by arco » 01 Oct 2018 14:37

Found it...
Seems that when declaring a bit external, you don't include the 'At Flags.0' part... :)
Regards,

Peter.

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”