Author Topic: INCLUDE vs. $INCLUDE  (Read 5962 times)

precisonline

  • President
  • Administrator
  • Rock Star
  • *****
  • Posts: 1612
    • Precision Solutions
INCLUDE vs. $INCLUDE
« on: October 26, 2007, 06:02:44 PM »
This is more of a Unidata issue than a Prelude issue, but being how I discovered this today on a Prelude site, I figured this would be a good place to post it.

The INCLUDE directive in BASIC is incompatible with $BASICTYPE "U".

As you know there are two flavors of BASIC in Unidata, the Pick flavor ($BASICTYPE "P") and the Unidata default flavor ($BASICTYPE "U").  The Unidata flavor of BASIC has some cool enhancements over the Pick flavor, such as the ability to work with multiple numbered select lists simultaneously.  So every now and again, it can be useful to add that $BASICTYPE "U" directive at the top of the subroutine and leverage all that this flavor has to offer.

However... The Prelude ADS.INCLUDE ADS.COMMON block that gives your subroutine access to whole bunch of open Prelude files does not use the $ version of INCLUDE when including SB+'s DMSKELCODE COMMON.  As a result, if you $INCLUDE ADS.INCLUDE ADS.COMMON to get all these open files and you're using $BASICTYPE "U", the program won't compile!

So here's a solution.  Assuming we don't want to touch Prelude's ADS.COMMON definition, copy it to a new name (ADS.COMMON.U perhaps?) and change the line that says:

INCLUDE DMSKELCODE COMMON

...to...

$INCLUDE DMSKELCODE COMMON

Remember when you upgrade to be sure to make this change again, or verify that Prelude has added the $ in ADS.COMMON.  (I sure hope they do add it; the $-version of $INCLUDE is compatible with both flavors of Unidata BASIC and every other Multivalue platform that I've ever seen, so the risk would seem to be nominal if any at all.)
-Kevin
Accidents "happen"; success, however, is planned and executed.