Search found 100 matches
- 24 Mar 2017 23:48
- Forum: DOS Batch Forum
- Topic: Arithmetic Operation
- Replies: 7
- Views: 6007
Re: Arithmetic Operation
Or you might try this method to remove zeroes from the beginning. @echo off call :rezero 000000000000000000000000000000250045644500000690000 _out echo %_out% pause>nul :rezero [Digit] [Variable to store output] if not defined _rzer setlocal&set "_rzer=%~1"&set "_over=%~2"...
- 14 Mar 2017 01:47
- Forum: DOS Batch Forum
- Topic: How to center align text.
- Replies: 30
- Views: 28390
Re: How to center align text.
There is at least one bug Aacini which is if the line has more length than '%cols%-1' the remaining part is removed. Yes, exactly as shown in the original request: ——————————now,I want it to be this way in the cmd (align center ?) ::SKIPPED If you compare the longest line, the one that start with &...
- 13 Mar 2017 22:59
- Forum: DOS Batch Forum
- Topic: How to center align text.
- Replies: 30
- Views: 28390
Re: How to center align text.
I'm not surprised with the Aacini's result. His scripts are usually the fastest I've seen. I even had not found any use of his discovery until I read his script. I'm going to update my alignment utility(again) with his script. @Sounak@9434, please note that if a character is a digit or an operator ...
- 13 Mar 2017 06:54
- Forum: DOS Batch Forum
- Topic: Save/Load Help
- Replies: 8
- Views: 6298
Re: Save/Load Help
fugitive wrote:if you input # @ $ ? ,you find # gtr 5 too!Maybe you could use this code :
In my pc a string is detected as 0.
Code: Select all
@echo off
set answer=#
if # geq 5 echo WHAT
if # leq 5 echo NOOO
pause>nul
- 12 Mar 2017 23:05
- Forum: DOS Batch Forum
- Topic: How to center align text.
- Replies: 30
- Views: 28390
Re: How to center align text.
I did not expect that you are so interested in this issue, once again,I expressed gratitude to everyone. And I learned from Sounak@9434 a wonderful idea.Change a little as follows: @echo off&setlocal enabledelayedexpansion for /f "tokens=*" %%a in (poem.txt) do (set "s=%%a" ...
- 12 Mar 2017 21:34
- Forum: DOS Batch Forum
- Topic: How to center align text.
- Replies: 30
- Views: 28390
Re: How to center align text.
I'm at the third position at least. I'm not surprised with the Aacini's result. His scripts are usually the fastest I've seen. I even had not found any use of his discovery until I read his script. I'm going to update my alignment utility(again) with his script. @Aacini: Maybe help me about the righ...
- 11 Mar 2017 11:14
- Forum: DOS Batch Forum
- Topic: How to center align text.
- Replies: 30
- Views: 28390
Re: How to center align text.
Hi, you can center a string at specified length using this tip: @echo off & setlocal EnableDelayedExpansion :: size of box or windows (specified length) set sizemax=70 set s=blablablablablabla for /L %%# in (1,2,!sizemax!) do if "!s:~%sizemax%,1!" == "" set "s= !s! &quo...
- 11 Mar 2017 03:29
- Forum: DOS Batch Forum
- Topic: Batch Maze Game:(Another Major speed improvement)
- Replies: 11
- Views: 13073
Re: Batch Maze Game
Fixed a few bugs.
The latest version now works fine.
And I checked generating display and echoing is taking 75% of time and getting input and processing is taking 25% of time on average on high width and length.
Have to work more on speeding up the script.
Till then, Enjoy
Sounak
The latest version now works fine.
And I checked generating display and echoing is taking 75% of time and getting input and processing is taking 25% of time on average on high width and length.
Have to work more on speeding up the script.
Till then, Enjoy
Sounak
- 10 Mar 2017 23:24
- Forum: DOS Batch Forum
- Topic: Batch Maze Game:(Another Major speed improvement)
- Replies: 11
- Views: 13073
Re: Batch Maze Game
Hi, einstein1969 can you add a timeout for completing a maze ? (this is very difficult) After brainstorming for ideas for Half an hour I finally made it. I updated the archive to version 1.1 Hope you would like it. For pure batch game you can use neorobin's maze generator I would be working on it. B...
- 10 Mar 2017 05:54
- Forum: DOS Batch Forum
- Topic: Batch Maze Game:(Another Major speed improvement)
- Replies: 11
- Views: 13073
Batch Maze Game:(Another Major speed improvement)
Hello, everyone. This time I'm not here for a problem but for a little batch game. I call it Maze_Game.bat ::Changelog ::V:2.0 HOTFIX Fixed a bug where Congratulation is not being displayed after finishing a level V:2.0 (Another Major Speed Improvement+bugfix) Optimized input and analysis process fo...
- 09 Mar 2017 19:59
- Forum: DOS Batch Forum
- Topic: How to center align text.
- Replies: 30
- Views: 28390
Re: How to center align text.
Or you can use my align.bat utility. Align.zip A well explained and commented code, a test file and a documentation is provided. In your case use this code. ::Replace filename.txt with the file you want for /f "tokens=*" %%a in (filename.txt) do call align.bat /m "%%a" Or, Just i...
- 08 Mar 2017 21:14
- Forum: DOS Batch Forum
- Topic: Setup a batch macro by calling a different file
- Replies: 11
- Views: 9235
Re: Setup a batch macro by calling a different file
@aGerman: Cool, Beautiful method Steffen. @penpen: You have a point penpen. In your way the source can be used in many differant ways. But lets see, if We want to add everything in a single file (Means, creating those macroes and loadmacros.bat by redirection) a simple macro would become like this. ...
- 08 Mar 2017 11:19
- Forum: DOS Batch Forum
- Topic: Setup a batch macro by calling a different file
- Replies: 11
- Views: 9235
Re: Setup a batch macro by calling a different file
@penpen:Cool method penpen. Just one questions. 1)Do I need to have one separate file for each macros? Meaning 3 files for '@strlen' & '@align' and one 'Package.txt'? @jeb: Maybe you meant this one . I tested it on my macro script and it failed as it only set the last line ') else setlocal enabl...
- 08 Mar 2017 09:42
- Forum: DOS Batch Forum
- Topic: Setup Dictionary in batch
- Replies: 2
- Views: 3315
Re: Setup Dictionary in batch
@Aacini: Thanks Aacini. Both of your script worked beautifully. By The Way, You can not use Delayed Expansion in the FOR /F "!options!" string. I tried to avoid delayed expansion inside "options" script and still it fails. @echo on set count=1 setlocal enabledelayedexpansion set ...
- 08 Mar 2017 07:42
- Forum: DOS Batch Forum
- Topic: Setup Dictionary in batch
- Replies: 2
- Views: 3315
Setup Dictionary in batch
This is my third request in this week, wow. Anyway this time I want to set a dictionary data type in batch which........is not possible by default. So I was thinking about some workaround and thought about assigning the values as variables. I have a sample script here that takes items from one scrip...