Solved

Vertical Scroll

Posted on 2004-08-03
5
234 Views
Last Modified: 2010-05-18
Does anybody have code for this?,

I'm doing a 16-bit (DOS) C program for reading a file with 2 fields pipe separated, and show them like

Key     Des
    1     One
    2     Two
    3     Three
and so on

I want to know how i can "scroll" the list if i've got more lines that maximum i can display at once.
Thanks
0
Comment
Question by:VisionC
  • 3
5 Comments
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 200 total points
ID: 11710334
If you want to make a plain terminal-style app, just put a message every 24 lines:

printf("Key\tDescription\n");
for (int i=0; i<maxElement; i++)   /* assuming some variable names */
{
         if ( (i+1)%24==0 ) {
              printf("Press any key to continue...");
              getch();
              printf("\n");
         }
         printf("%i\t%s\n", i, yourArray[i] );
}

If you want a more sophisticated user interface, use console functions that Turbo C gives you.

good luck,
Jaime.            
0
 

Author Comment

by:VisionC
ID: 11710373
How can i know about those console functions?
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11710464
Sorry, there are many years since I stop developing in Turbo C (about 15), but all information is in Turbo C Help.
See help about <conio.h> funtions.
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 200 total points
ID: 11710489
If you want to download Turbo C for free, go to:
http://community.borland.com/article/0%2C1410%2C20841%2C00.html
0
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 11711209
You could always just pipe the output to the MORE command on DOS.

C:> yourcmd | more

http://support.microsoft.com/?kbid=227449

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
rhel6 C system() call to zip to archive has problems 25 248
Line meaning 9 90
Using ANSI C how to Read a .csv file 10 110
Adjust the codes 3 30
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question