MVVS: MV Basic for Visual Studio

 View Only

 Compile settings

Rob Buist's profile image
PARTNER Rob Buist posted 05-05-2023 15:57

Our program uses a pre-compile routine which modifies the code before running the BASIC command to create the object code. Since Rocket MVVS appears to call the BASIC command when compiling, I'm wondering if there might be a way to call our pre-compile routine instead of BASIC.

We're in the process of adopting Git and this would help us take full advantage of Rocket MVVS.

Thanks in advance for any ideas.

Chao Han's profile image

Hi, Rob.

Thanks for asking this question, currently you can not involve other subroutine when compiling BASIC programs in the VS Code side, but is that possible to provide more details about this pre-compile routine?

I would like to have a better understanding for this and do some research first, maybe we can put this into an enhancement request in future release, thanks.

Best Regards.

Rob Buist's profile image

Hi Charles,

Here's some additional information on our pre-compile routine.  We have several source code files such as IM.SRCE. Our pre-compile routine is actually called "COMPILE". If I wish to compile the IM.PL.BUILD routine, we enter the command COMPILE IM.SRCE IM.PL.BUILD instead of BASIC IM.SRCE IM.PL.BUILD. I raised my question since the two commands are very similar.

The COMPILE routine executes the BASIC command, but that's after the source routine is moved to another file, PREC, which has an associated object code PREC.O file. If we use the BASIC command, an error is raised because we don't have an associated IM.SRCE.O file.

Besides moving the program to a new file, we have an internal system in which all data files have a four-character identifier, such and ENTY, and each dictionary item a three-character identifier, such as NAM. Within our source code programs, these appear as ENTY$NAM whenever this field is used in the program. The COMPILE routine translates these references to the actual field number in the PREC version of the code prior to executing BASIC. The pre-compile routine also updates a cross-reference record which contains a listing of all programs which use this field. The cross-reference is very helpful when finding the program source of data issues.

Since its release, I've been using Rocket MVVS to modify our programs on the server, via mapped network drive, which I understand is an unintended use of the program. After making changes, I compile and debug using Dynamic Connect. As we adopt Git, it would be helpful if we could compile directly from Visual Studio Code. If not, we could look into other options such as SFTP which was mentioned recently in this forum.


SS&C Technologies

John Green's profile image
PARTNER John Green

We are in the same boat. Our pre-compiler does a whole bunch of code processing before using BASIC to do the compilation. I have this working from VS Code via a hack that replaces the BASIC verb with our own program.
- Copy BASIC verb to UVBASIC
- Catalog PCBASIC (PC=pre-compiler) as BASIC
- PCBASIC (when its executed as BASIC) looks at the call stack
-- when uvcs is in the call stack we assume its VS code executing BASIC, so we invoke the pre-compiler and this in turn executes BASIC (which is now PCBASIC)
-- so when the precompiler is in the call stack we invoke UVBASIC (the standard BASIC verb)
(:( confuses me every time I try to explain it)

It would be better if we can simply define the command(s) to execute in VS Code configuration with arbitrary command line parameters.

It would also be great if we could extend the functionality used to evaluate code in VS Code so that it could include some of the pre-compiler logic. Symbols from $INSERT files are recognized - it would be great if we could extend the logic that resolves the $INSERT content so that pre-compiler generated symbols are recognized. I know that's a stretch but, for us at least, it closes a gap in VS Code today.

Chao Han's profile image

Hi, Rob.

Thanks for the information and I just had quick chat with engineers, we have logged an enhancement request for this and will do some more investigation later, thanks.

Best Regards.