Help Please : Weird things happening with printing text in graphics mode using Turbo C++ 
Author Message
 Help Please : Weird things happening with printing text in graphics mode using Turbo C++

Hi, please help.

Ive added a phone book to an MSDos invoicing program. It gives name and
number only.

When you first start the program and go the the phone book, it works fine.
But when you go to another section of the program, and then leave that to go
to the phone book, some of the information is missing. Below is an
excerpt...

outtextxy(listwin.p[0].x+15,listwin.p[0].y+y,refnum);               //
prints fine
outtextxy(listwin.p[0].x+60,listwin.p[0].y+y,name);                 // does
not appear!
outtextxy(listwin.p[0].x+360,listwin.p[0].y+y,number);           // prints
fine

(Ignore the coordinate references).

It prints the refnum and the number, but not the name!

Also, headings (ie "Ref" , " Name" , and "Number"  suddenly disappear!

The total program size is quite large (240K), so could it be down to a lack
of core memory at the time of printing causing a font to not be loaded? But
it doesn't work whatever font I use, and a call to coreleft() informs me I
still have lots of core remaining!, and why print the first and last parts
of the line, and not the middle?

Please help, as Im going bald pulling my hair out!

The above excerpt is as it stands, with no font/charsize/etc changes being
made between the outtextxy() calls.

And, if i may be a pain, I need to sort a list of customers names into
alphabetical order. I have a book, (Practical C++ Programming, Steve
Oualline, Reilly & Assoc) that shows me how to do it using binary trees, but
this is in C++. I am a bit unsure about referencing, so is there anyway a
binary tree can be implemented in C without using reference pointers?

Basically, I need to sort out sales accounts details. The tree needs to hold
Name and Acc Number. Once the tree has been filled, I need to read it,
putting the Acc Numbers into an Integer array.

Any other info needed to help me I can provide.

Many thanks in anticipation.
Mike

PS: Anybody know of a good hair restorer? (somebody told me Pascal was good
for hair, but Im not so sure!)



Mon, 16 Jul 2001 03:00:00 GMT  
 Help Please : Weird things happening with printing text in graphics mode using Turbo C++

: Hi, please help.

: Ive added a phone book to an MSDos invoicing program. It gives name and
: number only.

: When you first start the program and go the the phone book, it works fine.
: But when you go to another section of the program, and then leave that to go
: to the phone book, some of the information is missing. Below is an
: excerpt...

: outtextxy(listwin.p[0].x+15,listwin.p[0].y+y,refnum);               //
: prints fine
: outtextxy(listwin.p[0].x+60,listwin.p[0].y+y,name);                 // does
: not appear!
: outtextxy(listwin.p[0].x+360,listwin.p[0].y+y,number);           // prints
: fine

: (Ignore the coordinate references).

: It prints the refnum and the number, but not the name!

: Also, headings (ie "Ref" , " Name" , and "Number"  suddenly disappear!

: The total program size is quite large (240K), so could it be down to a lack
: of core memory at the time of printing causing a font to not be loaded? But
: it doesn't work whatever font I use, and a call to coreleft() informs me I
: still have lots of core remaining!, and why print the first and last parts
: of the line, and not the middle?

At a guess, somewhere you're leaking or overwriting memory.  If your
compiler doesn't have tools to check memory usage, then you'll have
to trim the program down until you've localised the fault.  There's
not much that can be discovered from the lines you've posted: the
problem was almost certainly set up elsewhere in the code, and those
lines are just the trigger.

: Please help, as Im going bald pulling my hair out!

: The above excerpt is as it stands, with no font/charsize/etc changes being
: made between the outtextxy() calls.

: And, if i may be a pain, I need to sort a list of customers names into
: alphabetical order. I have a book, (Practical C++ Programming, Steve
: Oualline, Reilly & Assoc) that shows me how to do it using binary trees, but
: this is in C++. I am a bit unsure about referencing, so is there anyway a
: binary tree can be implemented in C without using reference pointers?

If you want to sort in C++, the STL is probably the place to start.
You'll have to ask in comp.lang.c++ for more information.  In C, you
probably want to start with qsort(), which is part of the library.

You can implement a (form of) binary tree in an array, without pointers,
by storing the children of node a[n] in a[2n] and a[2n+1].  If you do
this, you can implement a neat and fairly quick form of heapsort without
more than one node's worth of extra space.  Most books on algorithms
discuss heap sorts.

Will



Mon, 16 Jul 2001 03:00:00 GMT  
 Help Please : Weird things happening with printing text in graphics mode using Turbo C++
: Hi, please help.

: Ive added a phone book to an MSDos invoicing program. It gives name and
: number only.

: When you first start the program and go the the phone book, it works fine.
: But when you go to another section of the program, and then leave that to go
: to the phone book, some of the information is missing. Below is an
: excerpt...

: outtextxy(listwin.p[0].x+15,listwin.p[0].y+y,refnum);               //
: prints fine
: outtextxy(listwin.p[0].x+60,listwin.p[0].y+y,name);                 // does
: not appear!
: outtextxy(listwin.p[0].x+360,listwin.p[0].y+y,number);           // prints
: fine

: (Ignore the coordinate references).

: It prints the refnum and the number, but not the name!

: Also, headings (ie "Ref" , " Name" , and "Number"  suddenly disappear!

: The total program size is quite large (240K), so could it be down to a lack
: of core memory at the time of printing causing a font to not be loaded? But
: it doesn't work whatever font I use, and a call to coreleft() informs me I
: still have lots of core remaining!, and why print the first and last parts
: of the line, and not the middle?

At a guess, somewhere you're leaking or overwriting memory.  If your
compiler doesn't have tools to check memory usage, then you'll have
to trim the program down until you've localised the fault.  There's
not much that can be discovered from the lines you've posted: the
problem was almost certainly set up elsewhere in the code, and those
lines are just the trigger.

: Please help, as Im going bald pulling my hair out!

: The above excerpt is as it stands, with no font/charsize/etc changes being
: made between the outtextxy() calls.

: And, if i may be a pain, I need to sort a list of customers names into
: alphabetical order. I have a book, (Practical C++ Programming, Steve
: Oualline, Reilly & Assoc) that shows me how to do it using binary trees, but
: this is in C++. I am a bit unsure about referencing, so is there anyway a
: binary tree can be implemented in C without using reference pointers?

If you want to sort in C++, the STL is probably the place to start.
You'll have to ask in comp.lang.c++ for more information.  In C, you
probably want to start with qsort(), which is part of the library.

You can implement a (form of) binary tree in an array, without pointers,
by storing the children of node a[n] in a[2n] and a[2n+1].  If you do
this, you can implement a neat and fairly quick form of heapsort without
more than one node's worth of extra space.  Most books on algorithms
discuss heap sorts.

Will



Mon, 16 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Weird thing happening with member variables

2. Help - weird problem using DLL (things already defined)

3. Print variables on screen using graphic mode

4. I need the game PACMAN in graphic mode (C) please HELP

5. WEIRD WEIRD Help Please a.s.a.p.:head pointers

6. Print a text file in text mode to the printer

7. Help please: White background in text mode (Borland Turbo C)

8. Urgent DB help needed, sql querying with recordset, strange things happening

9. help about waiting for another thing to happen...

10. Urgent DB help needed, sql querying with recordset, strange things happening

11. Drawing graphic tiles with transparency using MFC, Need Help Please

12. problem in building NT service using ATL wizard in release mode..Please help

 

 
Powered by phpBB® Forum Software