Read Mode
Default

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

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 Kvc
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 6 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....

21 comments:

  1. Great article for beginner coders!

    ReplyDelete
    Replies
    1. :) Couldn't Make it Easier than This. We hope they'll find the concept easier.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. We are Quite sure that it is not your own creation. Because, We've already seen this project and We think The real Creator is 'Carlos'.

      We really admire their work in batch programming. And, Can't accept the stolen work. You are reducing your own reputation by doing such thing. We can Stop accepting your entries in TheBATeam, if you continue doing this.

      Do give the credits where, it is pending.
      http://www.dostips.com/forum/viewtopic.php?style=29&t=5028

      Delete
    4. This comment has been removed by the author.

      Delete
    5. This comment has been removed by the author.

      Delete
    6. so the date function i will delete and i will talk to that person and will not put it back online because others happens this :(

      Delete
    7. This comment has been removed by the author.

      Delete
    8. but if you want to see source whith out date look here ---> https://pastebin.com/NFHhExrD
      than you see it is making on other way

      Delete
    9. This comment has been removed by the author.

      Delete
    10. Well if you have stolen or not, just don't keep on spamming the comment box. And the pastebin code contains a lot of flaws or 'script laggers'.
      1)Who uses "for /f "tokens=1" %%u in ('echo %time%') do set t=%%u"
      %time% is a system variable unless you set it by set command. Just use "set t=%time%" or better directly use %time%.
      2)Flashes man flashes, your code flashes too much. Just define the total output to a single variable and then echo it. Flashes will get down to a minimum. I used the same method in my lilgui.bat(of maze game) so during display of the window flashes are the least.

      Fix this problems and keep something in mind. The last thing you want to lose as a human is your pride and reputation. Don't use batch scripts without giving credit to the creator. Batch scripts can not be compiled and thus everyone gives them out as 'open source' with a trust that if someone uses it, they would give credit to them. Break this trust and you are breaking the batch programming community. I'm not saying there are not exceptions but still.... I hope you understood. Give credits to them who deserve. Just say it frankly
      "Stolen(borrowed) from someone" or "Edited version of someone's code"

      Sincerely,
      Sounak

      //EDIT: Fixed a few errors in my last post

      Delete
    11. This comment has been removed by the author.

      Delete
    12. This comment has been removed by the author.

      Delete
  2. Really awesome! You are great.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Its a Shame that the download link contains viruses

    ReplyDelete
    Replies
    1. We are not working hard to infect other people with some cheap tricks. As, if your Anti-virus is Not working fine - That's not Our fault. Some of them assume all the batch files as viruses.

      :) We are using and creating all the programs with good intentions. Because, Throwing others down, would never take anyone on the top. One need to work hard. And, If you can't trust us. Please watch the video carefully. And, Look at the plugins. We are executing the same file in our system. :)

      It's a shame that - people still don't know, How to identify people. :)

      #NoHardFeelings
      #TheBATeam

      Delete
    2. Well here is the virustotal page showing a 4/58 detection ratio. It's upto you now if you want to believe the 4 or the 58.

      Delete
    3. virustotal see all files what it not know as virus

      Delete
    4. Virustotal said 4 antivirus detected it as virus and 48 detected it as a regular program

      Delete
    5. Most anti-viruses find some executables as suspicious, mainly batbox.
      This is because batbox is written in assembly (so, uses something like NASM) which is often used for viruses because of very small executable size (so, it will be easier to inject to a software) and likewise for better low-level access.
      So, some anti-viruses do not find a regular GCC head in executable so, finds them suspicious.

      If you want to be sure than batbox is safe, you can have the source code of darkbox here : http://batch.xoo.it/t2243-Commande-Externe-Batbox-v1-0.htm (behind "Code Source" spoiler)

      There is the same issue (even worse) for darkbox as you can see here (latest version, non-upstream) : https://www.virustotal.com/en/file/1c2b5b9d43e6c0dbcef78d63df5f9670f36ca0d9e8f245b5391d990941c7f2d5/analysis/1495720713/
      In comparison with muss-libc-static linux version (which do almost the same thing, just for Linux) : https://www.virustotal.com/en/file/e195c2be09dbd8fff7de1968a26ff22d7bbadad2f036587b75b7410f9fe334c9/analysis/1495720845/

      Delete

Powered by Blogger.