How would I make lines etc in console mode (I'm using Microsoft VC++)
How would I make lines etc in console mode (I'm using Microsoft VC++)
Last edited by speedy; 10-25-2001 at 08:40 AM.
This should work for horizontal lines. Where \xCD is the hex value for = in the ascii table. You would need to watch for overflow though.
#include <iostream.h>
int main()
{
int line;
for(line = 1; line <= 10; line++)
cout << "\xCD";
return 0;
}
I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P
hey thanks!
NP I've been working on that very thing myself. I've got a crude method of drawing lines as well, but it needs work in 32 bit compilers like VC 6. It causes the blue screen of death... likely cause is the regs or data type for the pointer, but I'm working on it. It *works* ok in 16 bit compilers though.
#include <iostream.h>
int main()
{
int line;
char *xrow, *ycol;
xrow = 0;
ycol = 0;
for(line = 1; line <=20; line++)
{
_asm
{
xor bh,bh
mov dh,BYTE PTR xrow
mov dl,BYTE PTR ycol
mov ah,2
int 10h
mov dl,'.' // or \xXX hex code for ascii
mov ah,02
int 21h
}
xrow = xrow + 1; // adjust increment of row
ycol = ycol + 1; // adjust increment of col
}
return 0;
}
I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P