structure reference

Beta Testing discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
peterverkaik
Posts: 174
Joined: 31 Aug 2009 22:44

structure reference

#1 Post by peterverkaik » 16 Dec 2009 16:31

I try to declare a structure that also
holds a pointer to a next structure of the same type

Code: Select all

structure vpBank
'  union {
'    nmReg vpReg;
'    nmUart vpUart;
'  };
  dim statePtr as ^TvoidSub '//state function
  dim nextVP as ^vpBank
  dim inPort as word '//for fast access to PORTx
  dim inPin as word
  dim outPort as word '//for fast access to LATx (or TRISx)
  dim outPin as word
  dim spare1 as word
  dim spare2 as word
end structure
This generates error
76 345 Recursive types are not allowed RGBWSv0_01p.mbas

Since a pointer has a fixed size of word, that should be allowed.
If not, any workaround?

regards peter

User avatar
nikola.kostic
mikroElektronika team
Posts: 433
Joined: 11 Aug 2009 12:12

#2 Post by nikola.kostic » 18 Dec 2009 14:37

It should be allowed. Thank you for the note, it will be fixed for next release and you'll be able to use it the way you wrote. We plan release during next week.

Post Reply

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