Remove Comments - User Manual

Remove Comments - User Manual

17 June 2022, 18:36
Vladimir Toropov
0
1 336

When creating an application, the developer must do what is necessary to protect his work from code hackers. If you don't want the ideas in your code to be known to everyone, make it harder for the hacker to do his job.

This can be done by completely removing all comments from the program code. It's not easy to work with code written by someone else. Moreover, working with code written without any comments is even more difficult.

How can you do it? My name is Vladimir Toropov. I suggest you use the Remove Comments MT4 app or the Remove Comments MT5 app. These programs allow you to work with all your code at once. With the help of them, you can clear all files of your project from comments with one click of a button. Let's see how it works.

CONTENTS

1. How to choose a folder for your project in the Remove Comments app

2. How to clean up the project code in the Remove Comments app

3. What does the Remove Comments app do exactly

4. Other Features of the Remove Comments app

5. Runtime errors

1. How to choose a folder for your project in the Remove Comments app

Let's say you're working in MetaEditor and you've finished coding and error checking. Now you have a fully working code that needs to be compiled and submitted to the customer or published in the MQL5 Market.

If you are writing an Expert Advisor code, then you are working in the EXPERTS directory. If you are creating an indicator, it means that your files are in the INDICATORS directory.

Fine. Let the source files of the project remain there. They will be safe in this folder. First, we will copy the project folders and files to the folder where we will clean up the code.

The Remove Comments app provides two options for this. This can be the common FILES folder of all MetaTrader terminals or the FILES folder of your working terminal.

Let's copy the project files. To do this, go to MetaEditor - top menu "File" - "Open Data Folder". Or in the same menu "Open Common Data Folder". Both options are equivalent. You can choose any one.

After that, open MetaTrader and attach the Remove Comments app to any price chart. If you have copied your project to the common FILES folder of all terminals, you will see them in the list of folders and files:


If you copied your files to the FILES folder of your working terminal, then select Terminal Files from the drop-down list. Then your project will be displayed in the list of folders and files:

Once you have seen your project's files and folders in the Remove Comments application window, you can work with them.

2. How to clean up the project code in the Remove Comments app 

Select the necessary folders and files in the list with the mouse to clean their code from comments. You can select any number of files and folders. Next, click Remove:


The program will show you which files and folders you are going to delete comments from. And the app will ask you to confirm your actions:


Click OK. The program will do all the work and show you the results:


This completes the program. After that, double-click to open the main file of your project, the code of which has just been cleaned up. Compile the file.

Your project's source code is now where it was. And the cleaned up code and the compiled file are in the folder where the Remove Comments application was running.

3. What does the Remove Comments app do exactly

When you click OK, the following will happen. The application will remove all comments from the code of all files that you have selected. If you also select folders, the program will remove comments from all files it finds in those folders two levels deep.

This is what it means. Let's say your project looks like the one shown in the picture. There is a main file (Main file). And there is the main folder of the project (Main folder). This folder contains files and folders. And there are files in those folders too. If you select Main file and Main folder, then all these files will be processed:


At the same time, the Remove Comments application processes files of the following types according to the same rules:

  • mq5,
  • mq4,
  • mqh,
  • txt.

The application does not touch the rest of the file types and does not show them in its list of files.

4. Other Features of the Remove Comments app

You can choose what exactly to remove from the code by checking the Comments and Empty Lines checkboxes on the application panel:


You may change the contents of the working folder after launching the application. After that, click the Refresh button on the Remove Comments application panel. This will show you the current set of folders and files in the list:


When this is done, you can work with the list of files and folders.

5. Runtime errors

1. When you click the Remove button, if both the Comments and Empty Lines checkboxes are not checked on the application window, the program will warn you:


Please select what exactly to remove from the code and continue by clicking the Remove button.

2. If no file or folder is selected, when you click the Remove button, the application will display a warning:


Please select the files or folders you want to clean up and continue by clicking the Remove button.

3. If you do not update the current list of folders and files with the Refresh button after deleting, renaming or moving them, then clicking the Refresh button will lead to the warning:


Please refresh the list of files and folders with the Refresh button and continue with the Remove button.

Download the Remove Comments MT5 application from the official product page in the MQL5 Market. The version for Remove Comments MT4 is also available on its official page. Both versions of the application have identical functions and work with both MQL4 and MQL5 code.


Share it with friends: