Batch Archive [Version 2.1.0001]
Copyright (c) 2018 TheHacker. All Rights Reserved

C:\Users\TheHacker>

Read Mode
Default

How to make 'Simple Digital Clock' only with 'Notepad' in Windows? | The Digital Clock Project v.1.0 | Advance Batch | By Gls

How to make 'Simple Digital Clock' only with 'Notepad' in Windows? | The Digital Clock Project v.1.0 | Advance Batch | By Kvc

The Digital Clock Project: Clock is an amazing Measuring Gauge that humans have ever created. It can measure the ultimate Dimension of Universe - Which affects almost everything in the universe - THE TIME. And, we all are bound within its boundaries! But, That's not our concern in this article. But, It is in the concern of our life. So, we should use Time as Wisely as possible. Isn't it?




Although, We are here to learn this simple Method to - Create a Simple Digital Clock with Using Only Notepad. All You need to do is to write these 10 Lines in Your Notepad. And, Your Simple and Sexy Digital Clock is ready to be used. You can also, Change this simple Trick to modify the Color of your clock, and much more. You can also download the full Code to Analyze this simple but effective Digital clock in Your Computer.


Almost all of my previous articles were a bit more technical - and talks more about technical terms. So, After getting this amazing feedback from My Good friend Sudha Rani - I'm changing my style to improve the quality. And, User experience! So, Basic and New Users can also Understand what I'm trying to Say. Now, No more talks. Let's jump directly into the main Thing - for which we are here.
"Time is - What a Clock Reads!"
-A. Einstein

Simple Digital Clock only with Notepad:

You can easily make real working Digital Clock by writing only few lines. These few lines are as Follows. But, keep one thing in mind that - You can't be able to copy the code directly from the article (as we've disabled the text selection From Our Pages). So, Keep calm! And read the article completely to the end. You'll get a download link there 😇🙂.


The Code:

------------------------------------------------------------------------------------------------------------------------------------------------------
@Echo off
CD files
Mode 80,25
Title Digital Clock

:Loop

Set _Time=%Time:~0,-3%
CLS
call typo Pixcel.fo 18 7 aa %_Time%
timeout /t 1 >Nul
Goto :Loop
------------------------------------------------------------------------------------------------------------------------------------------------------


Important Things before Using it:

This code will directly run from Your "Notepad". All You need to do is to Save the file with .Bat File Extension, instead of .txt. Otherwise, This trick will not work. And, you also need to make a folder named "Files" In which you'll Put the Typography Function for this beautiful output. You can download it from the corresponding link. But, In this tutorial - you don't need to make extra efforts. Everything else is done in the Final Download link @ Bottom.


How to make 'Simple Digital Clock' only with 'Notepad' in Windows? | The Digital Clock Project v.1.0 | Advance Batch | By Gls
Windows Explorer view

Explanation of Code:

This method of Using Notepad directly (without any compiler etc. to compile the code first) to Code and Run is called "Batch programming". The File usually contains, *.Bat Extension - instead of *.txt. This method uses cmd.exe to execute these Codes line by line, one after the other. And, The code is as simple as Your Imagination! 
  • In First 4 Lines:
    "@Echo off
    CD Files
    Mode 80,25
    Title  Digital Clock"

    We are, Setting up the Output Window's Size (Mode 80,25) and the Title of the window (Title  Digital Clock).
  • And, In the Last lines:
    ":Loop
    Set _Time=%Time:~0,-3%
    CLS
    call typo Pixcel.fo 18 7 aa %_Time%
    timeout /t 1 >Nul
    Goto :Loop"

    We are creating a small Group / Loop (Goto :Loop) To continuously update the Time on the Screen (call typo Pixcel.fo 18 7 aa %_Time%). But, Before Printing the new time - we need to Erase the previous one (CLS). And, the Process repeats itself after each 1 second. (timeout /t 1 >Nul).

    Note: 
    You can Change the color of the time output by changing the Text in Yellow (aa) In the Code. Try 'FF' for White, 'CC' For Red...etc. Explore by Your own! 😁

Although, I have also completed a 10 min challenge - Create a Digital Clock with Notepad. in the following video. You can also watch and understand the reason behind the working of these lines. The logic behind them, and how to think complex while making a computer understand about your requirements. I hope You'll Like the way I explain things.



[Video]

Please, Show your response through the comments (Comment field at end). Doesn't matter - if you'll like my article and efforts or not. I will be very happy to read them. You can also ask your doubts in the comments. Get your Files from the link below. And, Enjoy the Life. Thanks for your time. Happy Coding!



Keep Learning, Keep Sharing...
Be Happy, Spread Happiness....

No comments:

Powered by Blogger.