An official Batch Programming blog! To Solve the daily problems with windows and fixing them with little notepad scripts. Unlock the Hidden Secrets of Windows, Learn to crack Software via CMD & Make your own Programming tools. Understand to Manipulate your PC via CMD.

Line Function v.1.0 | By Kvc

Line Function: Hey ! guys we are again back with another awesome plugin for batch programming. It can be said another step towards the GUI approach in batch programming, as now you can print a proper line from one point to the other in the cmd console window.

Line Function v.1.0 | By Kvc

The line function v.1.0 is not completely created by Kvc. But the modification and setup are done by Kvc. And also fixed few bugs of the time limit and inefficient output on the console screen. Now the function is properly managed and created, it displays the required line on console screen in almost no time.

Explorer View

The line Function v.1.0 used the Bresenham‘s algorithm for achieving the goal of printing a proper line without flaws on the console. The function calculates all the possible positions of pixels (characters in this case) on the console.

And then we are printing the specified character in given color on those positions using ‘Batbox.exe’ plugin. Which is responsible for the tremendous speed and response time of the function.

The functions seem to be working perfectly in all of our tests, but if in any case, it shows a flaw or error, you can comment about it below this post. But we hope that your comments will be about, how fast and awesome this function is. 

Line Function

The function simply prints a line of required properties (including starting pt, ending pt, printing character, line color) by simply using an awesome plugin of batch programming, which is ‘Batbox.exe’.

which means that you only need to keep batbox.exe file with this line.bat function, in the same folder/directory where your main batch file is residing.

Also Read:  Free HotSpot Creator VER.2.0 | By Kvc

Then you are ready to go. Your program will become tremendously advanced and smaller (simple) and the whole project file’s size will increase only by 5 KBs (some 4.6 KB). This is the advantage of creating functions that you can use them whenever you want in your program.

So now, let’s talk about its usage and output on the console. The following image will help you a little in finding the usage of line function ver.1.0 by kvc, or you can also see this help message by simply typing ‘Line /?’ in your cmd console window.

As you can see that using this function is very easy and you only need to specify necessary information to the function as the starting point of the line, ending point. You may or may not have to specify the character and color of the line, these depend on your requirement.


You can also print line only by specifying the first 4 parameters, and in this case, this line function will take ‘o’ as a default character and ‘07’ as a default color code. The following image may clarify your remaining doubts… So, let’s have a look.

A Look

But you can also print the line using any of your required characters. You either need to specify the character in the 5th parameter or the ASCII code of the character, which you want to print a line with. And also you can provide the color of the line in the 6th parameter.

If you want code of the line instead of directly printing it on the console. You just need to specify the 7th parameter as a variable and the code of the resultant variable will be saved into the same-named variable.

Also Read:  Box function v.3.0 by Kvc

This code can be executed directly using a batbox.exe file. Or you can save it in a text file to use it later in any of your batch programs.

With Different Character

Instead of printing using a backslash (/), you can also print the line using any other character or color. For example, as I’ve printed the same line with the same color but this time I’m using forward slash (\) instead of the backslash (/). And the output has no effect but only change in the character by which the line will get printed.

A Preview

At last, if you really like our work in the field of batch programming, feel free to leave your precious reviews/feedbacks below in the comment field below. We’ll love to see your reactions to our work, Thanks for your time. Till then, as we always say.

Keep learning, keep sharing…

Be happy, spread happiness…


Next Post

Previous Post

Leave a Reply

© 2020 TheBATeam

Theme by Anders Norén