1.

Solve : Color Menu Issues?

Answer»

Here's my color menus, i'm just having trouble.. it won't do what I want...
I'm using DOS 6.22, I'm trying to get this program done, i've been working my *censored* off to finish it.. i just can't.


Menu.bat

Code: [Select]@echo off
:MENU
cls
echo/
echo/
echo/
echo/
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Main Menu ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º 1: FKey and Functions º
echo º º
echo º 2: Open Dos Text Editor º
echo º º
echo º 3: List of Macros º
echo º º
echo º 4: About the Programs Designer º
echo º º
echo º 5: Adjust The Color Menus º
echo º º
echo º 6: Exit to Command PROMPT º
echo º º
echo º º
echo º º
echo º º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo/
echo/
echo/
echo/


CHOICE /C:123456 What Would You Like To Do?
IF ERRORLEVEL 6 GOTO 6
IF ERRORLEVEL 5 GOTO 5
IF ERRORLEVEL 4 GOTO 4
IF ERRORLEVEL 3 GOTO 3
IF ERRORLEVEL 2 GOTO 2
IF ERRORLEVEL 1 GOTO 1

:1
CLS
FKEY
ECHO/

:2
CALL EDIT
CLS
GOTO MENU
ECHO/

:3
CLS
MACROS
ECHO/

:4
CLS
ABOUT
ECHO/

:5
MAINCOL
ECHO/


:6
QUIT
ECHO/
MAINCOL.BAT
Code: [Select]@echo off
:fkeymenu
echo
[0;m
cls
echo/
echo/
echo/
echo/
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ CHOOSE TEXT COLOR ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º º
echo º 1:
[30;47mBLACK
[0;m º
echo º º
echo º 2:
[31;40mRED
[0;m º
echo º º
echo º 3:
[32;40mGREEN
[0;m º
echo º º
echo º 4:
[33;40mYELLOW
[0;m º
echo º º
echo º 5:
[34;40mBLUE
[0;m º
echo º º
echo º 6:
[35;40mMAGENTA
[0;m º
echo º º
echo º 7:
[36;40mCYAN
[0;m º
echo º º
echo º 8:
[37;40mWHITE
[0;m º
echo º º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo/
echo/
echo/
echo/

CHOICE /C:12345678
IF ERRORLEVEL 8 GOTO 8
IF ERRORLEVEL 7 GOTO 7
IF ERRORLEVEL 6 GOTO 6
IF ERRORLEVEL 5 GOTO 5
IF ERRORLEVEL 4 GOTO 4
IF ERRORLEVEL 3 GOTO 3
IF ERRORLEVEL 2 GOTO 2
IF ERRORLEVEL 1 GOTO 1

:1

[30;47m
CLS
COLMEN2
ECHO/

:2

[31;m
CLS
COLMEN2
ECHO/

:3

[32;m
CLS
COLMEN2
ECHO/

:4

[33;m
CLS
COLMEN2
ECHO/

:5

[34;m
CLS
COLMEN2
ECHO/

:6

[35;m
CLS
COLMEN2
ECHO/

:7

[36;m
CLS
COLMEN2
ECHO/

:8[37;m
CLS
COLMEN2
ECHO/

COLMEN2.BAT

Code: [Select]@echo off
:menu
cls
echo/
echo/
echo/
echo/
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍ CHOOSE BACKGROUND COLOR ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º º
echo º 1: [;40mBLACK[;m º
echo º º
echo º 2: [;41mRED[;m º
echo º º
echo º 3: [;42mGREEN[;m º
echo º º
echo º 4: [;43mYELLOW[;m º
echo º º
echo º 5: [;44mBLUE[;m º
echo º º
echo º 6: [;45mMAGENTA[;m º
echo º º
echo º 7: [;46mCYAN[;m º
echo º º
echo º 8: [;47mWHITE[;m º
echo º º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo/
echo/
echo/
echo/

CHOICE /C:12345678
IF ERRORLEVEL 8 GOTO 8
IF ERRORLEVEL 7 GOTO 7
IF ERRORLEVEL 6 GOTO 6
IF ERRORLEVEL 5 GOTO 5
IF ERRORLEVEL 4 GOTO 4
IF ERRORLEVEL 3 GOTO 3
IF ERRORLEVEL 2 GOTO 2
IF ERRORLEVEL 1 GOTO 1

:1
[;40m
CLS
MENU
ECHO/

:2
[;41m
CLS
MENU
ECHO/

:3
[;42m
CLS
MENU
ECHO/

:4
[;43m
CLS
MENU
ECHO/

:5
[;44m
CLS
MENU
ECHO/

:6
[;45m
CLS
MENU
ECHO/

:7
[;46m
CLS
MENU
ECHO/

:8
[;47mCLS
MENU
ECHO/

Where does it bot perform as expected and how?Quote

Where does it bot perform as expected and how?


I can send you a copy of the whole bootable disk... ..

none of that color menu works....

from the main menu, if 5 is chosen should go to "Maincol.bat"... after a choice is picked there, should change the font color and go to "Colmen2.bat" once a choice there is selected it should go back to the menu with those COLORS defined, in use... however ... it ALWAYS goes back the the main menu after execution... and runs in normal dos White on black.Do you have the file ANSI.SYS?

Do you have a line in the CONFIG.SYS like this:

DEVICE=C:\DOS\CONFIG.SYS

Also, "[32;40mGREEN" Is not a MS-DOS sentence. To see colors, you need to print the code of the color onto the screen:

ECHO (Esc)[32;40mGREEN


You can read here:

http://www.evergreen.edu/biophysics/technotes/program/ansi_esc.htm

To see how to write the (ESC) character (and more information of your interest)
Quote
Entering the {ESC} Character:
* In DOS: Press and hold the <Alt> key, then type 27 on the keypad.
* In Windows: Press and hold the <Alt> key, then type 0027 on the keypad.
* Exceptions: Sometimes the above keystrokes do not work. Try one of the following methods:
o In MS-DOS EDITOR and QBASIC, type any one of these:
+ <Ctrl>P, <Alt>027
+ <Ctrl>P, <Ctrl>[
+ <Ctrl>P, <Esc>
...
...

For the sentence prompt, you have the metacharacter $e:

PROMPT $e[1;37;44mQuote
Do you have the file ANSI.SYS?

Do you have a line in the CONFIG.SYS like this:

DEVICE=C:\DOS\CONFIG.SYS

Also, "[32;40mGREEN" Is not a MS-DOS sentence. To see colors, you need to print the code of the color onto the screen:

ECHO (Esc)[32;40mGREEN




You can read here:

http://www.evergreen.edu/biophysics/technotes/program/ansi_esc.htm

To see how to write the (ESC) character (and more information of your interest)
Quote
Entering the {ESC} Character:
* In DOS: Press and hold the <Alt> key, then type 27 on the keypad.
* In Windows: Press and hold the <Alt> key, then type 0027 on the keypad.
* Exceptions: Sometimes the above keystrokes do not work. Try one of the following methods:
o In MS-DOS EDITOR and QBASIC, type any one of these:
+ <Ctrl>P, <Alt>027
+ <Ctrl>P, <Ctrl>[
+ <Ctrl>P, <Esc>
...
...

For the sentence prompt, you have the metacharacter $e:



PROMPT $e[1;37;44m

I have both Config.sys and Ansi.sys on my disk... as for the escape character i use ctrl P and then esc.. however when going from dos 6.22 to XP it didn't read those.


Discussion

No Comment Found