Skip to main content

Hi All,

Recently we are investigating that how to implement BASIC compilation in VS Code extension. I want to share our ideas, and we are very appreciate if you can provide suggestions and ideas.

(The following content is just our initial ideas and design prototypes.)

The main use of compilation is to find out the errors or warnings after code change. User can choose to sync the source code to U2 server or not. If yes, source code and objective code on sever would be overwritten after compilation.

Before using compilation, user needs connect to a U2 server. And we will provide 2 methods to compile BASIC programs.

1. Compile BASIC programs through VS Code task. 
User can run VS Code default build task to start compilation. We can provide a target files list in the task configuration file, so that multiple BASIC program files in current account folder could be built together.


2. Compile modified BASIC programs.
User can right click a file in the editor to display context menu and select "Test compile BASIC program".

Then user can select modified files for compilation.

Restriction:
1. Must connect to a U2 server for compilation, because we need the BASIC compiler on server.
2. For complex BASIC program INCLUDE structure, we may not handle it well. If a BASIC program INCLUDEs some other files, user need make sure the included files can be found on U2 server.
3. Currently, you could not customize the compilation arguments, but this is in our plan.

I'd love to hear from anyone who has thoughts on this discussion, if you have any suggestion or ideas, please let us know. @Walter Kiess @Jeff Teter

Thanks!

------------------------------
Yunpu Zhao
Software Engineer
Rocket Software
Dalian China
------------------------------​​​​

Hi All,

Recently we are investigating that how to implement BASIC compilation in VS Code extension. I want to share our ideas, and we are very appreciate if you can provide suggestions and ideas.

(The following content is just our initial ideas and design prototypes.)

The main use of compilation is to find out the errors or warnings after code change. User can choose to sync the source code to U2 server or not. If yes, source code and objective code on sever would be overwritten after compilation.

Before using compilation, user needs connect to a U2 server. And we will provide 2 methods to compile BASIC programs.

1. Compile BASIC programs through VS Code task. 
User can run VS Code default build task to start compilation. We can provide a target files list in the task configuration file, so that multiple BASIC program files in current account folder could be built together.


2. Compile modified BASIC programs.
User can right click a file in the editor to display context menu and select "Test compile BASIC program".

Then user can select modified files for compilation.

Restriction:
1. Must connect to a U2 server for compilation, because we need the BASIC compiler on server.
2. For complex BASIC program INCLUDE structure, we may not handle it well. If a BASIC program INCLUDEs some other files, user need make sure the included files can be found on U2 server.
3. Currently, you could not customize the compilation arguments, but this is in our plan.

I'd love to hear from anyone who has thoughts on this discussion, if you have any suggestion or ideas, please let us know. @Walter Kiess @Jeff Teter

Thanks!

------------------------------
Yunpu Zhao
Software Engineer
Rocket Software
Dalian China
------------------------------​​​​
We keep our INCLUDES in a separate folder INC.BP (DIR type file).  Can we create a task list to compile related programs that reside in the BP file?

------------------------------
David Green
Computer Programmer
DAG Consulting
------------------------------

Hi All,

Recently we are investigating that how to implement BASIC compilation in VS Code extension. I want to share our ideas, and we are very appreciate if you can provide suggestions and ideas.

(The following content is just our initial ideas and design prototypes.)

The main use of compilation is to find out the errors or warnings after code change. User can choose to sync the source code to U2 server or not. If yes, source code and objective code on sever would be overwritten after compilation.

Before using compilation, user needs connect to a U2 server. And we will provide 2 methods to compile BASIC programs.

1. Compile BASIC programs through VS Code task. 
User can run VS Code default build task to start compilation. We can provide a target files list in the task configuration file, so that multiple BASIC program files in current account folder could be built together.


2. Compile modified BASIC programs.
User can right click a file in the editor to display context menu and select "Test compile BASIC program".

Then user can select modified files for compilation.

Restriction:
1. Must connect to a U2 server for compilation, because we need the BASIC compiler on server.
2. For complex BASIC program INCLUDE structure, we may not handle it well. If a BASIC program INCLUDEs some other files, user need make sure the included files can be found on U2 server.
3. Currently, you could not customize the compilation arguments, but this is in our plan.

I'd love to hear from anyone who has thoughts on this discussion, if you have any suggestion or ideas, please let us know. @Walter Kiess @Jeff Teter

Thanks!

------------------------------
Yunpu Zhao
Software Engineer
Rocket Software
Dalian China
------------------------------​​​​
We have a customized way of cataloging, would you be able to execute a custom catalog command?

------------------------------
David Green
Computer Programmer
DAG Consulting
------------------------------
We have a customized way of cataloging, would you be able to execute a custom catalog command?

------------------------------
David Green
Computer Programmer
DAG Consulting
------------------------------
Hi David, 

Thanks for your response!

For your first question, we will consider how to support multiple build tasks or sub tasks.
For the second question, currently, we could not handle catalog commands, but we hope to support it in the future release.

Thanks

------------------------------
Yunpu Zhao
Software Engineer
Rocket Software
Dalian China
------------------------------

Hi All,

Recently we are investigating that how to implement BASIC compilation in VS Code extension. I want to share our ideas, and we are very appreciate if you can provide suggestions and ideas.

(The following content is just our initial ideas and design prototypes.)

The main use of compilation is to find out the errors or warnings after code change. User can choose to sync the source code to U2 server or not. If yes, source code and objective code on sever would be overwritten after compilation.

Before using compilation, user needs connect to a U2 server. And we will provide 2 methods to compile BASIC programs.

1. Compile BASIC programs through VS Code task. 
User can run VS Code default build task to start compilation. We can provide a target files list in the task configuration file, so that multiple BASIC program files in current account folder could be built together.


2. Compile modified BASIC programs.
User can right click a file in the editor to display context menu and select "Test compile BASIC program".

Then user can select modified files for compilation.

Restriction:
1. Must connect to a U2 server for compilation, because we need the BASIC compiler on server.
2. For complex BASIC program INCLUDE structure, we may not handle it well. If a BASIC program INCLUDEs some other files, user need make sure the included files can be found on U2 server.
3. Currently, you could not customize the compilation arguments, but this is in our plan.

I'd love to hear from anyone who has thoughts on this discussion, if you have any suggestion or ideas, please let us know. @Walter Kiess @Jeff Teter

Thanks!

------------------------------
Yunpu Zhao
Software Engineer
Rocket Software
Dalian China
------------------------------​​​​
Like David, our updated standard is to keep INCLUDE files in a separate library. However, with a 30+ year old library, there are lots of opportunities to overcome. We have put together a front end for compiling that checks the component to see if there is the string "PROGRAM", "SUBROUTINE" or "FUNCTION" or a blank line in line 1. If any of these conditions exist, the program is compiled. If the compile is successful, HTML documentation based on the program header and tags (if included) is produced. If the first line has the word "INCLUDE" in the line (therefore, "! INCLUDE" & "* INCLUDE" would be detected), it is not compiled but is still documented. The program also recognizes other source types (paragraphs, procs, Python, etc.) and recognizes the comment mark based on the file type. The document header is similar in format on all source code types, so the documentation library can easily be searched across all libraries. The document header includes documentation, syntax, parameters, warnings and to do lists.

A related point is the need to go to the definition of a variable or equated item if it is in an INCLUDE, whether in the same file or a different file.

Long term, it would also be helpful to be able to <CTRL><CLICK> on multiple programs (whether in the explorer window or in library folders, then right click and compile those items selected. The terminal window would be the logical place to see the result of the compile (similar to what was shown above) with hot links to go to lines that failed due to errors.

------------------------------
Jeff Teter
Woodforest National Bank
The Woodlands, TX
------------------------------
Like David, our updated standard is to keep INCLUDE files in a separate library. However, with a 30+ year old library, there are lots of opportunities to overcome. We have put together a front end for compiling that checks the component to see if there is the string "PROGRAM", "SUBROUTINE" or "FUNCTION" or a blank line in line 1. If any of these conditions exist, the program is compiled. If the compile is successful, HTML documentation based on the program header and tags (if included) is produced. If the first line has the word "INCLUDE" in the line (therefore, "! INCLUDE" & "* INCLUDE" would be detected), it is not compiled but is still documented. The program also recognizes other source types (paragraphs, procs, Python, etc.) and recognizes the comment mark based on the file type. The document header is similar in format on all source code types, so the documentation library can easily be searched across all libraries. The document header includes documentation, syntax, parameters, warnings and to do lists.

A related point is the need to go to the definition of a variable or equated item if it is in an INCLUDE, whether in the same file or a different file.

Long term, it would also be helpful to be able to <CTRL><CLICK> on multiple programs (whether in the explorer window or in library folders, then right click and compile those items selected. The terminal window would be the logical place to see the result of the compile (similar to what was shown above) with hot links to go to lines that failed due to errors.

------------------------------
Jeff Teter
Woodforest National Bank
The Woodlands, TX
------------------------------
Hi Jeff, 
Thanks for your response! Your ideas and suggestions are very helpful! I really like the idea to select multiple files by Ctrl + click. We will consider your ideas during our development work.

Thanks!

------------------------------
Yunpu Zhao
Software Engineer
Rocket Software
Dalian China
------------------------------