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.

Create GUI Lines with Characters In CMD | Line Function 1.0 | By Kvc

Line Function: Just finished-up creating another Awesome Function that will definitely make your batch programming experience easier. Take this as another step towards getting creative in your  CLIGUI APPROACH In your batch scripts, as now you can create GUI lines with characters in cmd from one point to the other within the cmd console window.

The line function 1.0 is created by Kvc (but, we have used an already existing algorithm). Also fixed few bugs (time limit issue and inefficient output on the console screen). Now the function is properly managed and created to flawlessly display the required line on console screen in almost no time.

CREATE GUI LINES WITH CHARACTERS IN CMD | LINE FUNCTION 1.0 | BY KVC
Line Function v.1.0 | By Kvc

GUI LINES WITH CHARACTERS IN CMD – Line Function 1.0

The Line function v.1.0 Uses Bresenham’s algorithm for achieving the goal of creating GUI lines with characters in cmd 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’ plugin. Which is responsible for the tremendous speed and response time of the function.

LINE FUNCTION 1.0 | BY KVC
Explorer View

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

USAGE – Using Line Function 1.0 by Kvc

The function simply prints a line of required properties (including starting pt, ending pt, printing character, line color) by simply using ‘Batbox’ plugin as one of its dependencies. which means, that you only need to keep batbox.exe file with this line.bat function file, in the same folder/directory – where your main batch file is residing.

Also Read:  Remove Shortcut Virus From Laptop with CMD | Shortcut Virus Remover 2.0

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 CMD 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 1.0 - Help
Line Function 1.0 – Help

As you can see that – The usage of this function is very easy and you can also see the Examples provided in the Help Menu. You may or may not – have to specify the character and color of the line, these depend on your requirements.

Features – Line Function 1.0

You can also print line only by specifying only the first 4 parameters, and in this case – this 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.

CREATE GUI LINES WITH CHARACTERS IN CMD
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.

Fetch Code of Line – Instead of showing on CMD

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 line – will be saved into the same -named variable. This code can be executed directly using batbox plugin, Or you can save it in a text file to use it later in any of your batch programs.

CREATE GUI LINES WITH CHARACTERS IN CMD | LINE FUNCTION 1.0 | BY KVC
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.

LINES WITH CHARACTERS IN CMD | LINE FUNCTION
A Preview with Forward Slash (\)

From Editor’s Desk

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.

HASH Code - For Verification - (SHA-256)
bd187bb71d2015383a49485c551314eb587edcceed0dddc68c2f6790ad80d087

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

TheBATeam

Download Link

Next Post

Previous Post

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2020 TheBATeam

Our Core Values   /   Terms & Conditions   /   Privacy Policy   /   Why Register?

Theme by Anders Norén