Move cursor to *any position* using just ECHO commandCirothUngol wrote: ↑25 Aug 2018 16:25
Off topic, is there also a quick and efficient native solution for locating the cursor at specific location in the console window?
I strongly suspect that the only satisfactory solution will be an external one, but I'm looking at native alternatives anyway. ^_^
Color Function 21 22 23c
Moderator: DosItHelp
Re: Color Function 21 22 23c
Re: Color Function 21 22 23c
@Carlos
I just came across your OUT.EXE. Awesome! Thanks for sharing.
However, I did encounter an issue. I need to pass a variable to OUT.EXE so it is echoed in a particular color. The variable is a path. OUT.EXE strips the "\" slashes.
Example:
Variable is: %pathToFile%
Line of code:
The code above outputs the following:
C:UsersjohnDesktopfolder
It should be:
C:\Users\john\Desktop\folder
Is there anyway to work around this?
=======================
UPDATE: I found a solution.
=======================
Change:
To:
I just came across your OUT.EXE. Awesome! Thanks for sharing.
However, I did encounter an issue. I need to pass a variable to OUT.EXE so it is echoed in a particular color. The variable is a path. OUT.EXE strips the "\" slashes.
Example:
Variable is: %pathToFile%
Line of code:
Code: Select all
"%filesFolder%\out.exe" 09 "%pathToFile%\r\n"
C:UsersjohnDesktopfolder
It should be:
C:\Users\john\Desktop\folder
Is there anyway to work around this?
=======================
UPDATE: I found a solution.
=======================
Change:
Code: Select all
"%filesFolder%\out.exe" 09 "%pathToFile%\r\n"
Code: Select all
"%filesFolder%\out.exe" 09 "%pathToFile:\=\\%\r\n"
Re: Color Function 21 22 23c
@Carlos
Hi,
The download link to out.exe is broken.
Currently, I have a version with this md5 checksum:
24ac932a11eab64ead2ddeb16b6eccaa
Can someone confirm this is the last version?
Hi,
The download link to out.exe is broken.
Currently, I have a version with this md5 checksum:
24ac932a11eab64ead2ddeb16b6eccaa
Can someone confirm this is the last version?
Re: Color Function 21 22 23c
Here is a tip to display exclamation marks if used
Test it
Code: Select all
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
Code: Select all
@Echo Off
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
set err=0C
set ok=0A
set n=0F
set out=out.exe
set "test=some path"
echo TO DISPLAY EXCLAMATION MARKS
echo.
echo Use double ^ with echo but only one with out.exe ^^!
echo.
%out% %n% "\ttest normal^!" %err% "\ttest err^!" %ok% "\ttest ok^!\n\n"
%out% %n% "\tDisplay exclamtion marks : " %err% "^!test^!\n"
echo.
pause
Re: Color Function 21 22 23c
Yes that's the usual way. It has nothing to do with out.exe but with unquoted and quoted strings.
Steffen
Code: Select all
@echo off &setlocal EnableDelayedExpansion
echo ^^!
echo "^!"
pause
Re: Color Function 21 22 23c
Hello.
@jeffshead: sorry for the late reply, your solution was right, because the \ character is used as the escape sequence character.
@fred_gaou, I cannot remember what was the last version of out.exe, but I deprecated it because you can achieve the same functionality using my bg program v3.9se using this syntax:
You also can print the exclamation character using the escape sequence \21
Documentation (only for the print function of bg):
https://web.archive.org/web/20180926041 ... .com/p/bg/
I hope you can use bg.exe instead of old out.exe
@jeffshead: sorry for the late reply, your solution was right, because the \ character is used as the escape sequence character.
@fred_gaou, I cannot remember what was the last version of out.exe, but I deprecated it because you can achieve the same functionality using my bg program v3.9se using this syntax:
Code: Select all
bg print A "Hello " C "\01"
Documentation (only for the print function of bg):
You can download it from internet wayback archive :BG Print color text ...
::print text in HEXADECIMAL color without new line to end. You can repeat arguments.
::the text recognize the next oem escape sequences:
\r print a carriage return
\n print a newline
\\ print \
\Number HEXADECIMAL ascii number code from 00 to FF.
Example: \01 is face character
Example: \41 is A
Note 2: You can repeat arguments.
Example: BG.exe Print A "Text in color A" B "Text in color B"
https://web.archive.org/web/20180926041 ... .com/p/bg/
I hope you can use bg.exe instead of old out.exe
Re: Color Function 21 22 23c
@Carlos
I saw the bg tool. I liked to work with out but I will give bg a try and test its other functions. Thanks
I saw the bg tool. I liked to work with out but I will give bg a try and test its other functions. Thanks
Re: Color Function 21 22 23c
"█"
How to use this symbol for the color functions?
cmd /u
color 0b
@echo █
It doesnt display... Help?
And are there any simple beginners game tutorial in colour like the
https://www.youtube.com/watch?v=sJy1sgvKDhU on youtube?
I would like to try out.
(Im new here, Shara... I hope outside links as refference are okay. TQ)
How to use this symbol for the color functions?
cmd /u
color 0b
@echo █
It doesnt display... Help?
And are there any simple beginners game tutorial in colour like the
https://www.youtube.com/watch?v=sJy1sgvKDhU on youtube?
I would like to try out.
(Im new here, Shara... I hope outside links as refference are okay. TQ)
Re: Color Function 21 22 23c
nonstandard characters require use of the appropriate codepage to display. which can be changed via the code page command:SharaStar wrote: ↑23 Oct 2020 15:14"█"
How to use this symbol for the color functions?
cmd /u
color 0b
@echo █
It doesnt display... Help?
And are there any simple beginners game tutorial in colour like the
https://www.youtube.com/watch?v=sJy1sgvKDhU on youtube?
I would like to try out.
(Im new here, Shara... I hope outside links as refference are okay. TQ)
Code: Select all
CHCP n
Depending on what if any external exe's you intend to use, they may or may not support printing of non standard characters - you'll have to track down their readme's or view their helpfile.
Getting a bit off topic ...
Not that I haven't wasted by own fair share of time coding useless batch games, Why not start with something like ruby - https://try.ruby-lang.org/
Or if coding games is omething you would like to get into seriously, Unity? Plenty of tutorials out there.
Re: Color Function 21 22 23c
Actually it's a missmatch between the console codepage and the codepage the script was saved. If you change the codepage of the console to UTF-8 you have to make sure the script is saved in UTF-8 (without BOM), too.T3RRY wrote: ↑24 Oct 2020 07:30nonstandard characters require use of the appropriate codepage to display. which can be changed via the code page command:where n is the number of the required codepage. 65001 is the general option used for unicode characters.Code: Select all
CHCP n
It's rather the nature of a console window which limits it for displaying graphics. Consoles are textual interfaces. They are divided into character cells like a quad ruled paper. Each of these character cells can hold exactly one character with a specified foreground and background color, and you can't partition a character cell any further. So, using a console for graphics is rather a missuse. The only possibility to get proper graphics into a console is the way misol101 is doing it. But he just doesn't care about the quad ruled paper at all. He treats it as a canvas, takes a brush and covers everything with a layer of oil paint. (Figuratively speaking.) Nothing you could even do using any regular console application.T3RRY wrote: ↑24 Oct 2020 07:30Getting a bit off topic ...
Not that I haven't wasted by own fair share of time coding useless batch games, Why not start with something like ruby - https://try.ruby-lang.org/
Or if coding games is omething you would like to get into seriously, Unity? Plenty of tutorials out there.
Steffen