www.digitalmars.com         C & C++   DMDScript  

D - modified andy friesen's console

reply "Carlos Santander B." <carlos8294 msn.com> writes:
Hi, I translated disp.h and used it as a way to control the console adding
some functions to Andy's Console class. I include the modified console.d
(with formatter.d), disp.d and a fairly simple test.d. Enjoy.

-------------------------
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.478 / Virus Database: 275 - Release Date: 2003-05-06


begin 666 console.zip

MC90[>!='&E5Q<(JJ;$ <`2Z0N&YCQ?%4KH$ Q-V9D$U=7'GW_\P;SQ\SG=$'
MIM!=T.HVS_+L`\V!39UQO&3?>;9Y6;VM0HN>BP:JLKV6K;\HS\MV<R7V.',!
M-8 *9'73,%CC-'\`>GL0,6L=$6E'8RV75+VG^L Y8<#YBTAU"B)OV :WG]X$


M+U!+`P04````" !X=Z0N#H%S/!H%``")#P``"P```&9O<FUA='1E<BYDI5=;
M3QL[$'Y'XC],(R$V)5T(M.>6PT-U"D<\'$ E51\HJLSN)'&[6:]LAX"B]+>?
M&:_W3 IM+:$L]LPW]QE;SC.E+1BK93H=;6_)_'^-4[S/JO^CT-A8JMJ&2HU*

M[ `,DJQX5)VN\\\UB^8/F5JB3>, F E]?</H`^!OB ;NT%BA[:4R7466,YD 
M! 4!_,W,88+IU,[Z37WDA.GT=4%[`\?'$+6(>&FT"YV60D=-"DP,=GD*XKV]
M&KD'>C4<M0P6B12&+".N-/)>)CO[(7_!66KYEY <0Y0(8^!4Z;FP%G49I/V7



MJ PGS#Y)E+"$"YDBFOKYZ\F;\)!)3ILD`*?LUUA.I34#L$L%,49R+A* LHG0
M>)"7^_EO65X.M1+ T_WSQ,7V*J] VM_?=_[)S06K(!.:PYO&D).2!A^1Y*+X
MFCN?LFF),%4U[;EN/L_1BK,TQOM1/6Z,?_'NXJ\B0>>*$D>F.3;Y?0")_$KR



MVY:Y;IL<4PE0SW9:CSC(5X*RE$MX*O2MF"+U_"3!R%(_X%VKU>(VP;"-X[.B
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JC

M#R8I7S[%!.BJ*.?1Y.GQ93[^-IX_C;]-1N,',-<-]-\O^J>9R^QA?G\[!?=2
M+OV+W&4Q&XWGT\EL7'(9N+/,U._T]N^BBPZ4>4UFS^/9T^0Y=S)>E_E$=S+.


MR?H_E6:/(*TH+ECL6S$*`YGC8]\LK N(>K5PD.S=HH*E+Q=6L2I-=^R*-_<)
MT!V;X^TB6"2HGL=V&/QS_J^!33^R;S!-<^BE<Z2VX$6MT*XO[5R=K#MD
M!JF?65%^%!VN0SV8'TLU/^_&9DPFMKY;O/Q>H+ML9RT?O,3,>DC35U];''/L


M<+1?(1G]=:T^NTK I6>D?JV7RCO\!U!+`0(4`!0````(`.VBIBXX^/OTZP``
M``\"```&``````````$`( "V 0````!T97-T+F102P$"% `4````" !X=Z0N
M#H%S/!H%``")#P``"P`````````!`" `MH$/`0``9F]R;6%T=&5R+F102P$"
M% `4````" !)HJ8N\>!+_BP&``!Y$0``"0`````````!`" `MH%2! ``8V]N
M<V]L92YD4$L!`A0`% ```` `S**F+LW  *]:! ``'0T```8``````````0` 
C`+:!I0P``&1I<W N9%!+!08`````! `$`- ````C$0``````
`
end
May 06 2003
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
Interesting.  I would have liked this 10 years ago.

I know not everyone is pushing the limits of computing.  I myself am well
behind the forefront.  But DOS is _d_e_a_d_.  CGA, gone.  VGA, gone.  Now
there is PalmPilot, CE, XP, OS/X, and PS/2.

Everyone has to start somewhere, and I wish you the best of luck.  I myself
wrote many of these same classes.

What I am trying to do (probably unsuccessfully) is give you a tip:   Get
out of DOS and learn technology that is useful today.  Learn how to draw
polygons in DirectX or draw TrueType fonts in Windows.  Learn about the
hardware but don't deal with it directly.  Use tools such as dialog editors
that are available to you to make things easier.

We write console tools in my line of work, but *only* batch processors,
nothing interactive, and any output that's not just raw text is gonna be
HTML or XML or something, not ASCII art and blinking block text.  Most of
the tools we make end up with GUI front ends because the artists like it
that way, but we need command line support for making tools be able to
automatically call each other.  But these are only tools;  they don't have
to be pretty.  If you want pretty you make a nice GUI interface, something
pleasing to the eye and easy to use with a mouse.

I'm sorry this probably came off harsh.  Probably elsewhere in the world,
perhaps even parts of US where people are getting old hand-me-down
computers,  DOS might still have a strong following.  I remember the simpler
days of programming where there weren't any "Windows certified" stickers and
you were almost guaranteed to get a program that actually worked when you
bought one.  The days when you had complete control over the machine, and
over what you made the machine do.

Video game console programming is a lot like that nowadays, but much harder
to program and more is expected of you.  You get alot of control but you
still have to make the publisher and the console maker happy before they'll
let you distribute.

Well D is a good choice for language for tinkering.  ;)

Sean



"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:b99nds$11qe$1 digitaldaemon.com...
 Hi, I translated disp.h and used it as a way to control the console adding
 some functions to Andy's Console class. I include the modified console.d
 (with formatter.d), disp.d and a fairly simple test.d. Enjoy.

 -------------------------
 Carlos Santander
May 06 2003
next sibling parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
Ok, no problem at all. In fact, I was expecting something like this.
A couple of comments embedded...

"Sean L. Palmer" <palmer.sean verizon.net> escribiσ en el mensaje
news:b9a4qs$1fiu$1 digitaldaemon.com...
| Interesting.  I would have liked this 10 years ago.
|
| I know not everyone is pushing the limits of computing.  I myself am well
| behind the forefront.  But DOS is _d_e_a_d_.  CGA, gone.  VGA, gone.  Now
| there is PalmPilot, CE, XP, OS/X, and PS/2.
|

PalmPilot: I don't have. CE: I don't have. XP: I have. OS/X: I don't have.
PS/2: I don't have. Past experience in any of those: I don't have.

| Everyone has to start somewhere, and I wish you the best of luck.  I
myself
| wrote many of these same classes.
|
| What I am trying to do (probably unsuccessfully) is give you a tip:   Get
| out of DOS and learn technology that is useful today.  Learn how to draw
| polygons in DirectX or draw TrueType fonts in Windows.  Learn about the
| hardware but don't deal with it directly.  Use tools such as dialog
editors
| that are available to you to make things easier.

Thanks for the tip. Maybe I'm just young and dumb... lol.

|
| We write console tools in my line of work, but *only* batch processors,
| nothing interactive, and any output that's not just raw text is gonna be
| HTML or XML or something, not ASCII art and blinking block text.  Most of
| the tools we make end up with GUI front ends because the artists like it
| that way, but we need command line support for making tools be able to
| automatically call each other.  But these are only tools;  they don't have
| to be pretty.  If you want pretty you make a nice GUI interface, something
| pleasing to the eye and easy to use with a mouse.
|

I know where the world is going, and I myself have done a lot of GUI
interfaces (not with DirectX or things like that), but only using RAD tools.
Now, I want to spend some time in D, but there is no RAD for D yet. I know
how dig works and I understand it, but it seems a bit too complicated yet.
Add that to my heavy DOS past, and you get my particular interest in having
(at least for me) a quite complete set of functions for the console.

| I'm sorry this probably came off harsh.  Probably elsewhere in the world,
| perhaps even parts of US where people are getting old hand-me-down
| computers,  DOS might still have a strong following.  I remember the
simpler

Actually, globalization and all that stuff have made that we do what we do
just like you guys do. I mean, we also use the tools that you have
available. So please, don't say that again.

| days of programming where there weren't any "Windows certified" stickers
and
| you were almost guaranteed to get a program that actually worked when you
| bought one.  The days when you had complete control over the machine, and
| over what you made the machine do.
|
| Video game console programming is a lot like that nowadays, but much
harder
| to program and more is expected of you.  You get alot of control but you
| still have to make the publisher and the console maker happy before
they'll
| let you distribute.
|
| Well D is a good choice for language for tinkering.  ;)
|
| Sean
|
|

—————————————————————————
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.478 / Virus Database: 275 - Release Date: 2003-05-07
May 06 2003
parent reply Helmut Leitner <helmut.leitner chello.at> writes:
"Carlos Santander B." wrote:
 Ok, no problem at all. In fact, I was expecting something like this.
 A couple of comments embedded...
Don't let get anyone in your way. If you want a Console, fine. I think a portable Console should be part of a standard library. Although it won't help D to get the touch of a modern language. -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
May 07 2003
parent "Carlos Santander B." <carlos8294 msn.com> writes:
"Helmut Leitner" <helmut.leitner chello.at> escribiσ en el mensaje
news:3EB97573.5CCFE8C7 chello.at...
|
|
| "Carlos Santander B." wrote:
| > Ok, no problem at all. In fact, I was expecting something like this.
| > A couple of comments embedded...
|
| Don't let get anyone in your way. If you want a Console, fine.
| I think a portable Console should be part of a standard library.
| Although it won't help D to get the touch of a modern language.
|
| --
| Helmut Leitner    leitner hls.via.at
| Graz, Austria   www.hls-software.com

I thought of some other reason.
Eventually, it's expected for D to become (also) a beginners language.
However, unless a RAD tool is done (and really well done), GUI development
will still be a bit painful (even with dig available. Sorry Burton). So
they'll want to use console functions, at least for a start. You can say
c.stdio is available, but eventually (just before they start to play with
dig) they'll want their programs to look fancy and everything. Well, now
they have just what they need.
I know I must be overlooking some issues, but I still think I have a point.
And Helmut, thanks for that.
BTW, I've repeated it a couple of times: I think a RAD would be very useful.
Anyone has something in their mind?

-------------------------
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.478 / Virus Database: 275 - Release Date: 2003-05-06
May 07 2003
prev sibling parent reply John Reimer <jjreimer telus.net> writes:
Sean L. Palmer wrote:
 Interesting.  I would have liked this 10 years ago.
 
 I know not everyone is pushing the limits of computing.  I myself am well
 behind the forefront.  But DOS is _d_e_a_d_.  CGA, gone.  VGA, gone.  Now
 there is PalmPilot, CE, XP, OS/X, and PS/2.
Shame on you, Sean. Since when did writing a console level tool, one of the most ubiquitous of interfaces, ever amount to a waste of time. It certainly isn't so much a waste that it warrants discouraging someone like that. True, DOS is a relic of the past, but the past seems to have a stubborn way of sticking around in the present . Need I mention Linux and the BSDs, decendents of the decades old UNIX, (technology people are still using today *gasp*) where console level interfaces are still a way of life (eg, NCURSES) in installation, setup, and configuration (amoung others). Many interfaces to embedded hardware systems still depend on console level tools, too. You know? Last I checked, I'm still using D from the CLI!
 Everyone has to start somewhere, and I wish you the best of luck.  I myself
 wrote many of these same classes.

 What I am trying to do (probably unsuccessfully) is give you a tip:   Get
 out of DOS and learn technology that is useful today.  Learn how to draw
 polygons in DirectX or draw TrueType fonts in Windows.  Learn about the
 hardware but don't deal with it directly.  Use tools such as dialog editors
 that are available to you to make things easier.
 
 We write console tools in my line of work, but *only* batch processors,
 nothing interactive, and any output that's not just raw text is gonna be
 HTML or XML or something, not ASCII art and blinking block text.  Most of
 the tools we make end up with GUI front ends because the artists like it
 that way, but we need command line support for making tools be able to
 automatically call each other.  But these are only tools;  they don't have
 to be pretty.  If you want pretty you make a nice GUI interface, something
 pleasing to the eye and easy to use with a mouse.
And that is exactly the point: not all systems are GUI based. Computerdom has such a wide ranging field of applications, and game developing is just one little part of it (okay big part of it :-). That happens to be the software development world in which you currently reside. Sure, technology is ever advancing, but the console interface is one common denominator that just doesn't go away.
 I'm sorry this probably came off harsh.  Probably elsewhere in the world,
 perhaps even parts of US where people are getting old hand-me-down
 computers,  DOS might still have a strong following.  I remember the simpler
 days of programming where there weren't any "Windows certified" stickers and
 you were almost guaranteed to get a program that actually worked when you
 bought one.  The days when you had complete control over the machine, and
 over what you made the machine do.
 
 Video game console programming is a lot like that nowadays, but much harder
 to program and more is expected of you.  You get alot of control but you
 still have to make the publisher and the console maker happy before they'll
 let you distribute.
 
Sean, you are a smart fella and definitely someone from whom I could learn much, but, really, you're a little too practical sometimes to see outside your frame of reference ;-). Later, John PS. Carlos, implementing the disp.h interface was one of the first little projects I did years ago when I was learning C. Translating it to D sounds like a fun, educational use of the language. Nice job :-)
May 08 2003
parent reply "Walter" <walter digitalmars.com> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:b9dg2b$1rsr$1 digitaldaemon.com...
 Since when did writing a console level tool, one of
 the most ubiquitous of interfaces, ever amount to a waste of time.
I've been using the same text editor since 1985. I've ported it to DOS, DOS32, Win32, Amiga, Sun News, Vax, BSDunix, linux, etc. One of the first things I do with a new machine is figure out how the console works so I can port microemacs to it. Disp.h kind of grew out of those ports. Once every couple years or so, I try a new editor. Soon to return to microemacs. The commands run a deep groove in my brain <g>.
May 11 2003
parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"Walter" <walter digitalmars.com> escribiσ en el mensaje
news:b9m9ur$2v3m$1 digitaldaemon.com...
|
| I've been using the same text editor since 1985. I've ported it to DOS,
| DOS32, Win32, Amiga, Sun News, Vax, BSDunix, linux, etc. One of the first
| things I do with a new machine is figure out how the console works so I
can
| port microemacs to it. Disp.h kind of grew out of those ports.
|

I tried to use my disp.d on linux. However the linker complained about the
functions. Apparently it didn't know where to find their implementations.
Where can I find it?

—————————————————————————
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.478 / Virus Database: 275 - Release Date: 2003-05-06
May 11 2003
parent "Walter" <walter digitalmars.com> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:b9mecg$2jv$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> escribiσ en el mensaje
 news:b9m9ur$2v3m$1 digitaldaemon.com...
 |
 | I've been using the same text editor since 1985. I've ported it to DOS,
 | DOS32, Win32, Amiga, Sun News, Vax, BSDunix, linux, etc. One of the
first
 | things I do with a new machine is figure out how the console works so I
 can
 | port microemacs to it. Disp.h kind of grew out of those ports.
 |

 I tried to use my disp.d on linux. However the linker complained about the
 functions. Apparently it didn't know where to find their implementations.
 Where can I find it?
Under linux, microemacs uses curses. It would be simple to do a disp.d for curses, but I've never done it.
May 11 2003