English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to write a program in C language (in graphics mode). As an output that gives a rectangular box & this box must be containing two fields ‘Name:’ & ‘ID:’ so its enable me to give my name & id on this field. I know that after running program cursor is blink top of the windows but I want to blink it inside the rectangular box. So please help me to write this code.

2007-01-27 06:53:50 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

Does "in graphics mode" mean using the windows gui or in a console app using graphic characters?

I assume you mean a console app because the gui would automatically give you this stuff.

You need to write it using a cursor control library or perhaps if it's simple enough, just know the ascii terminal control codes. Search the web for ASCII/VT100 cursor control commands (I've listed a couple of them) and then write your output using those escape sequences.

For example, you output routines would do the following:

1) Clear the display
2) Write a line at position x,y
3) write characters down the sides of the box
4) write the bottom line
5) write the prompts at specific positions

Then your input routine would
1) place the cursor at the beginning of the name entry and accept x characters
2) Validate data and display message a x,y if needed
3) Place the cursor at beginning of ID entry
4) validate and write message as needed.

I've done something similar, although not in C, but the concept is the same.

2007-01-27 15:44:48 · answer #1 · answered by BigRez 6 · 0 0

frankly, I dont know if there is a uniform way of doing this. but I can suggest a quick and dirty hack to do this use something like system("shutdown -r") on windows/linux etc. These will invoke the native OS calls to do what you want. Its also really ugly. I am hoping someone else gives you a better way to solve this problem!

2016-05-24 05:57:44 · answer #2 · answered by Andra 4 · 0 0

fedest.com, questions and answers