Common shared error

Forum for discussion about the documentation project.
Post Reply
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Common shared error

Post by sancho2 »

This little error I came accross today might be a good thing to add to the documentation under keyword "common":

COMMON variables cannot be object instances of CLASS/TYPE's with cons/destructors.
fxm
Moderator
Posts: 12158
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Common shared error

Post by fxm »

I already added it with more information more than a year ago (2016-05-28).
Use more recent documentation than the latest official release 1.05.0 (2016-01-31) !!! :-(

See COMMON:
.....
Description:
Declares a variable which is shared between code modules. A matching Common statement must appear in all other code modules using the variable.

Common variables cannot be initialized.
Common arrays are always variable-length, and must be defined with an empty parameter list (), and its dimensions set in a later Dim or Redim statement.
Common variables cannot be instances of a user-defined type having a constructor or a destructor even implicit.

The Shared optional parameter makes the variable global so that it can be used inside subs and functions, as well as at module level.
.....
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: Common shared error

Post by sancho2 »

Lol, oops.
I could have sworn I updated my documentation since then.
And I did go looking for it in the wiki. I wonder how I got this wrong.
Sorry.
Post Reply