MVVS: MV Basic for Visual Studio

 View Only

 includeFiles array

John Green's profile image
PARTNER John Green posted 05-11-2022 02:04
Is it possible to have the includeFiles act as a hierarchy. For example,
 
   
"includeMapping": [
        {
            "includeFile":"INCLUDEFILES",
            "fileName":"INCLUDEFILES_DEV"
        }
        {
            "includeFile":"INCLUDEFILES",
            "fileName":"INCLUDEFILES_PROD"
        }
    ]

And in my code I can write:
$INCLUDE INCLUDEFILES STDREADER

In the example above MV Basic would look for the "STDREADER" code in the INCLUDEFILES_DEV file first and when its not there it will look in INCLUDEFILES_PROD. This aligns with our source control process (check-out to _DEV, check-in to _PROD) and the way our pre-compiler works.

My experiments indicate that MV Basic assumes each object in the includeFiles array has a unique value for the includeFile member and so it stops searching when it finds one.

Thanks
Christian Bristow's profile image
ROCKETEER Christian Bristow
In short, no. I have tested this too and currently each includeFile entry has to be unique as seen in the Include documentation Example 3 >here<
I will communicate with you directly via a support ticket on our options.
Sean Hannam's profile image
Sean Hannam
Hi

Is it not possible to tackle this a different way?

In your code have the following
$INCLUDE INCLUDEFILES  INCLUDEFILES_DEV
$INCLUDE INCLUDEFILES  INCLUDEFILES_PROD

Wrap your DEV include with:
$IFNDEF INCLUDEFILES_DEV_INCLUDED
$DEFINE INCLUDEFILES_DEV_INCLUDED
...
...
$ENDIF

Then wrap your PROD in the same 
$IFNDEF INCLUDEFILES_DEV_INCLUDED
$DEFINE INCLUDEFILES_DEV_INCLUDED
...
...
$ENDIF

This way if your dev include has already been 'included' it will skip including your prod.






John Green's profile image
PARTNER John Green
@Sean Hannahan, I'm not sure this helps direct the search MV Basic ​extension for VS Code will perform to find the correct INCLUDE file at edit time. Am I missing something?