Useful software gone?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
phillid
Posts: 109
Joined: 03 Apr 2010 20:27
Location: Wellington, New Zealand
Contact:

Useful software gone?

#1 Post by phillid » 29 Dec 2011 18:39

Hello, all. I posted http://www.dostips.com/forum/viewtopic.php?f=3&t=1119&p=3868 and also http://www.dostips.com/forum/viewtopic.php?f=3&t=1032

I got pointed to lingubender.com, which was fine at the time, but now it's not there, I just get an 'Account Suspended' message. Does anyone have the source code for 'coltext.exe'?

Thanks for any help


--Phillid


(EDIT: Spelling mistake in 'which')

aGerman
Expert
Posts: 4721
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Useful software gone?

#2 Post by aGerman » 30 Dec 2011 07:45

I can't find the source code of the tool though but I remember it was compiled with only a few lines of dirty C++.
However, if you would tell me the syntax of the old tool I could write it new within some minutes.

Regards
aGerman

taripo
Posts: 228
Joined: 01 Aug 2011 13:48

Re: Useful software gone?

#3 Post by taripo » 30 Dec 2011 07:59

you really should put coltext.exe in the subject title.

phillid
Posts: 109
Joined: 03 Apr 2010 20:27
Location: Wellington, New Zealand
Contact:

Re: Useful software gone?

#4 Post by phillid » 30 Dec 2011 15:34

aGerman: I'm not actually going to use it for batch scripting, I was interested to see which lines of code did the colouring, because I'm writing a C program for DOS that uses colour etc, although I've got a feeling coltext.exe used windows.h, so it wouldn't be suitable for DOS?

Anyway, here's the syntax from what I remember:

Code: Select all

coltext [background][foreground]<.> "Hello, world!"


Where background and foreground are values from 0 to F. the '.' was optional. If included, it place a new line character at the end of the line of text. "Hello, world!" is obviusly just the text to display in the colour ;)

aGerman
Expert
Posts: 4721
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Useful software gone?

#5 Post by aGerman » 30 Dec 2011 17:15

phillid wrote:aGerman: I'm not actually going to use it for batch scripting, I was interested to see which lines of code did the colouring, because I'm writing a C program for DOS that uses colour etc, although I've got a feeling coltext.exe used windows.h, so it wouldn't be suitable for DOS?


OK, in this case I only can confirm your fears. I used the SetConsoleTextAttribute function. It's a WINAPI and not applicable for DOS. I'm afraid I can't help.

Regards
aGerman

Cat
Posts: 32
Joined: 11 Nov 2011 12:04

Re: Useful software gone?

#6 Post by Cat » 01 Jan 2012 04:16

You could try using this instead:

Code: Select all

call :coltext 74 "hello" & call :coltext 47 "world" /n
::...
:coltext
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do set "DEL=%%a"
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1
if "%3"=="/N" echo\
if "%3"=="/n" echo\
exit /b

However, this is painfully slow.

phillid
Posts: 109
Joined: 03 Apr 2010 20:27
Location: Wellington, New Zealand
Contact:

Re: Useful software gone?

#7 Post by phillid » 02 Jan 2012 00:06

@Cat: Cheers for that, but as I said I'm not actually using batch, I'm writing a program written in C for DOS. I was going to use a function out of coltext.exe's code in my own code. :)
@aGerman: I thought that would be the case. I ended up finding a compiler-specific funciton, but the only flaw to this is that I wouldn't bother with open source, because I'd get noobs contacting me who are using a different comiler and saying that it's not compiling.

Oh well, thanks for that anyway :)

--Phillid

Post Reply