This time, I use instruction COLOR to enhance QBASIC sreen but when saving results in a folder with instruction OPEN " ",#1,"WHATEVER"
I get all lines in BLACK. Could the solution be to save the results directly on WORD but is possible?
Many thanks in advance for help.
SAVING COLORS
COLOR is only for text/graphics displayed on the screen. When you write text to the file, it's just text--bytes of data that are decoded as ASCII characters.
I have no idea how the word file format works, but one possible solution would be to have your program write HTML files. Have it write tags around the text that have attributes that specify the color. Other than that, I can't think of an easy way to save text with colors. Check this link for some info on how HTML works: http://www.w3schools.com/html/default.asp
I have no idea how the word file format works, but one possible solution would be to have your program write HTML files. Have it write tags around the text that have attributes that specify the color. Other than that, I can't think of an easy way to save text with colors. Check this link for some info on how HTML works: http://www.w3schools.com/html/default.asp
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
You cannot print a color to ANY file period! Whatever you print to the screen is irrelevant.
You want fancy fonts, save the file as RTF or DOC and change it there.
You want fancy fonts, save the file as RTF or DOC and change it there.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Save colors.....
This question was in my mind for a long time. Identical issue is to print directly from basic to printer. I know it works when changing several commands but I never tried....and the third one is to stop screens page after page, to have time to read first results.Only possIbility I see is to use view print.Right?
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
The best way to print a file and save paper and ink is to just copy it to a file first. Then open the file in a text editor to view the results before deciding to print it. A good idea when testing programs.
You can use SHELL to open the file in Notepad or another text editor.
SHELL "START Notepad " + filename$
You can print it from Notepad if you like the text. If not, delete it! The QB program will be mininized to the taskbar however and fullscreen programs will need to change SCREEN MODES before creating a new screen to view.
If program was in fullscreen 0: SCREEN 12: SCREEN 0
If program was in any other mode: SCREEN 0: SCREEN originalmode
Notepad needs no program path, while other programs may.
You can use SHELL to open the file in Notepad or another text editor.
SHELL "START Notepad " + filename$
You can print it from Notepad if you like the text. If not, delete it! The QB program will be mininized to the taskbar however and fullscreen programs will need to change SCREEN MODES before creating a new screen to view.
If program was in fullscreen 0: SCREEN 12: SCREEN 0
If program was in any other mode: SCREEN 0: SCREEN originalmode
Notepad needs no program path, while other programs may.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
colors saved
thak you this will help me.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Your welcome!
To directly Print a file using Notepad use the /P option
SHELL "CMD /C START /min Notepad /P " + filename$
In NT, XP or 2000
Ted
To directly Print a file using Notepad use the /P option
SHELL "CMD /C START /min Notepad /P " + filename$
In NT, XP or 2000
Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0