Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

The ULTIMATE method to get user input !!

Secret_DoomSecret_Doom Member Posts: 116
Hi there everyone!

I'm posting this to inform that I've developed the ultimate method to get user input by batch. This is it:

www.secretdoom.hpg.com.br/us/faq.html#input.bat

I'm talking about a method that work with ANY language of DOS and does NOT require ANY external applications (I had developed a multi-language method before, but that one required EDLIN)
I think that is unique, I mean, I have never seen such a method anywhere.

The only problem is that it displays an error message that I couldn't avoid, but it is supressed by a CLS right after it, so that's not big trouble.

I've tryed to make such a thing for years, and now it's finally done!

I've tested it under Win9x. If anyone could test it for me under Win2K, WinNT or WinXP it would be great, thanks.

Well, that's it.
Just wanted to publish my work

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br

Comments

  • Secret_DoomSecret_Doom Member Posts: 116
    Hi again.
    Forget what I said about the error message being displayed. I've made some modifys on the batch and solved the problem. Here goes the adress again:

    http://www.secretdoom.hpg.com.br/us/faq.html#input.bat

    The server's got some problems, so this is the batch:



    [green]
    ::input.bat
    @echo off

    REM ====================================================
    REM == This is the ultimate method to get user input, ==
    REM == which is NOT based on user's DOS language, and ==
    REM == does NOT require any external applications, ==
    REM == such as EDLIN.EXE. ==
    REM ====================================================
    REM == ** AUTHOR ** ==
    REM == Secret_Doom - Leonardo Pignataro ==
    REM == www.batch.hpg.com.br ==
    REM == secret_doom@hotmail.com ==
    REM ====================================================

    echo. |date |find ":" > $$out.txt
    fc $$out.txt nul /n |find "1:" |find "1:" /n > $$out.bat
    echo SHIFT> [1].bat
    echo SET IPTWORD=%%1>> [1].bat
    for %%z in (9 8 7 6 5 4 3 2 1) do echo IF "%%%%z"=="" SET IPTPOS=%%z>> [1].bat
    call $$out.bat
    echo set input=> %iptword%.bat
    echo :loop>> %iptword%.bat
    echo if not "%%input%%"=="" set input=%%input%% %%%iptpos%>> %iptword%.bat
    echo if "%%input%%"=="" set input=%%%iptpos%>> %iptword%.bat
    echo shift>> %iptword%.bat
    echo if not "%%%iptpos%"=="" goto loop>> %iptword%.bat
    for %%z in ($$out.txt [1].bat) do if exist %%z del %%z
    SET IPTPOS=

    echo Type in input
    fc con nul /lb1 /n |date |find "1:" > $$out.bat
    call $$out.bat
    echo Your input was "%input%"

    for %%z in ($$out.bat %iptword%.bat) do if exist %%z del %%z
    SET IPTWORD=
    [/green]



    It's better to view on the URL to avoid line wrapping.

    -- Secret_Doom - Leonardo Pignataro --

    secret_doom@hotmail.com
    www.batch.hpg.com.br
  • Secret_DoomSecret_Doom Member Posts: 116
    Hello AGAIN!
    It seems the hurry is enemy of the good work.
    I've posted the wrong batch. THIS is it:

    [green]
    ::input.bat
    @echo off

    REM ====================================================
    REM == This is the ultimate method to get user input, ==
    REM == which is NOT based on user's DOS language, and ==
    REM == does NOT require any external applications, ==
    REM == such as EDLIN.EXE. ==
    REM ====================================================
    REM == ** AUTHOR ** ==
    REM == Secret_Doom - Leonardo Pignataro ==
    REM == www.batch.hpg.com.br ==
    REM == secret_doom@hotmail.com ==
    REM ====================================================

    echo SET STRING=> $$one.tmp
    echo. |date |find ":" > $$two.tmp
    REM > $$scr.tmp
    REM == Thanks to Laurence Soucy for the following line ==
    FOR %%v in (f100LFF''20 l102 w q) do ECHO %%v>>$$scr.tmp
    debug $$one.tmp < $$scr.tmp > nul
    copy /b $$one.tmp+$$two.tmp $$out.bat > nul
    call $$out.bat
    echo SET IPTWORD=%%1> $$out.bat
    for %%z in (9 8 7 6 5 4 3 2 1) do echo IF "%%%%z"=="" SET IPTPOS=%%z>> $$out.bat
    call $$out.bat %string%
    echo set input=> %iptword%.bat
    echo :loop>> %iptword%.bat
    echo if not "%%input%%"=="" set input=%%input%% %%%iptpos%>> %iptword%.bat
    echo if "%%input%%"=="" set input=%%%iptpos%>> %iptword%.bat
    echo shift>> %iptword%.bat
    echo if not "%%%iptpos%"=="" goto loop>> %iptword%.bat
    for %%z in (STRING IPTPOS) do SET %%z=
    for %%z in ($$out.bat $$one.tmp $$two.tmp $$scr.tmp) do if exist %%z del %%z

    echo Type in input
    fc con nul /lb1 /n |date |find "1:" > $$out.bat
    call $$out.bat
    echo Your input was "%input%"
    for %%z in ($$out.bat %iptword%.bat) do if exist %%z del %%z
    set iptword=
    [/green]

    Sorry about that.
    The previous batch is also good, but won't work out of windows.
    I'm gonna say again: it's better to see this batch at www.secretdoom.hpg.com.br/us/faq.html#input.bat for avoiding line wrapping.

    -- Secret_Doom - Leonardo Pignataro --

    secret_doom@hotmail.com
    www.batch.hpg.com.br

  • Secret_DoomSecret_Doom Member Posts: 116
    NEWS:
    I've been informed that the batch only works on Win9x and under.

    I've also been informed that FC.EXE, FIND.EXE and DEBUG.EXE are NOT considered internal commands, though they are onto the Dos6.22 help.

    That's it.

    -- Secret_Doom - Leonardo Pignataro --

    secret_doom@hotmail.com
    www.batch.hpg.com.br
  • Secret_DoomSecret_Doom Member Posts: 116
    Hi all.
    I've posted messages in many DOS forums about that batch file I've done. In one of the forums (actually a news group, alt.msdos.batch), I've learned a few things... (though not by a very happy way, because the guys at that newsgroup are experts, but unfortunately not so polite)

    - There is no "ULTIMATE" method, since there can be always a better method. I've really screwed up saying that my batch where the ultimate method, it IS NOT THE ULTIMATE METHOD.

    - My batch DOES use external apps: FC.EXE, FIND.EXE and DEBUG.EXE are considered external apps, though they are all present at the DOS6.22 help command... (I took that command as a base to say that my batch where clear of external apps)

    - The special thing that my batch could do can be replaced by a very simple debug script. So below is the input method using such a debug script, It's better then my batch...

    AUTHOR: Todd Vargo ( tv@birdlover.com )

    [code]::input.bat
    @echo off
    echo Type in input
    echo.> $$out.bat
    fc con nul /lb1 /n |find "1:" >> $$out.bat
    echo e100 'set input='> $$out.dat
    echo w>> $$out.dat
    echo q>> $$out.dat
    debug.exe $$out.bat < $$out.dat > nul
    call $$out.bat
    echo Your input was "%input%"
    for %%z in ($$out.bat $$out.dat) do if exist %%z del %%z[/code]

    You may also check that batch at the place where was my batch:

    http://www.secretdoom.hpg.com.br/us/faq.html#input.bat

    The batch above doesn't include error checking for = < > | characters. This version of it has it:

    http://www.secretdoom.hpg.com.br/us/faq.html#input2.bat

    Both this batch and my batch still aren't SO good, because of the following line:
    fc con nul /lb1 /n |find "1:" >> $$out.bat
    That's a critical line for the batch, and WinNT/2K won't recognize the CON and NUL devices.

    Anyway, the batch above is very good when talking about Win9x and DOS

    -- Secret_Doom - Leonardo Pignataro --

    secret_doom@hotmail.com
    www.batch.hpg.com.br

Sign In or Register to comment.