Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: if with enter  (Read 1984 times)

0 Members and 1 Guest are viewing this topic.

dakota

  • Guest
if with enter
« on: May 11, 2006, 10:21:42 PM »
how do i make this

IF enter_key is hit (
echo you hit enter
) ELSE (
goto :start
)

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: if with enter
« Reply #1 on: May 12, 2006, 05:47:54 AM »
I'm not aware of a way to do this in batch code. REXX and VBScript have methods (charin(), and charAt(index) respectively) that you might put in a function. In general you have to convert each character you read from stdin to hex or decimal, check if it's the enter key, and then continue with your script.

Other script languages most likely also have functions to accomplish this.

Batch language is extremely limited and was not designed for scripting in any real sense. If you have a Windows machine, Google for script languages and choose one you like. Windows also comes with two free script languages, VBscript and JScript. Check the Help and Support on your machine for more info.

Good luck. 8-)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein