Read Mode
Default

Line Function v.1.0 | By Kvc

Line Function v.1.0 | By Kvc
Line Function v.1.0 | By Kvc
Hey hello 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. The line function v.1.0 is not completely created by Kvc, but the modification and setup is done by Kvc. And few bugs of time limit and inefficient output on the console screen are fixed by kvc. Now the function is properly managed and created, it displays the required line on console screen in almost no time.

Line Function v.1.0 | By Kvc
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. 

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. 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 advantages 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.

Line Function v.1.0 | By Kvc
Help Menu
As you can see that using this function is very easy and you only need to specify necessary information to the function like, starting point of the line, ending point. You may or may not have to specify character and color of the line, these depends on your requirement. You can also print line only by specifying 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.

Line Function v.1.0 | By Kvc
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 line with. And also you can provide 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 7th parameter as a variable and the code of the resultant variable will be saved into the same named variable. This code can be executed directly using batbox.exe file, or you can save it in a text file to use it later in any of your batch program.

Line Function v.1.0 | By Kvc
With Different Character
Instead of printing using back slash (/), you can also print the line using any other character or color. For example, as I’ve printed the same line with same color but this time I’m using forward slash (\) instead of the back slash (/). And the output has no effect but only change in the character by which line will get printed.

A Preview
At last, we only have to say this much that, 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 about our work… Thanks for your time. Till then, as we always say…


Keep learning, keep sharing…
Be happy, spread happiness…


#TheBATeam

No comments:

Powered by Blogger.