Solved

Vertical Scroll

Posted on 2004-08-03
5
202 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
Comment Utility
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
Comment Utility
How can i know about those console functions?
0
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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 tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now