| | |
Need tips for a command line gui
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
I'm doing a project for college. It's not too complicated but it involves a lot of data access on a linked list. Does anyone have any tips for designing an intuitive command line gui? I'm doing things like:
It's a bit more complicated but you get the idea. I've seen command line tools with checkmarks and such and I think they'd be very useful but unfortunately I can't find info on those anywhere.
C Syntax (Toggle Plain Text)
while (current !=NULL) for (i=1;i<10;i++) printf("%d *Name: %s\n",i,current->data.name); current=current->Next; switch (get_char()) case '1' : *Access item one* case '2' : *Access item two* case '3' : *Access item three* ... case '0' : break; //displays more items
It's a bit more complicated but you get the idea. I've seen command line tools with checkmarks and such and I think they'd be very useful but unfortunately I can't find info on those anywhere.
Last edited by Crushyerbones; May 21st, 2008 at 7:04 pm.
Display and UI are linked. Sorting (an underlying algorithm) is not.
The best CUIs provide maximum data display and minimum query display.
For example, your program may run something like this (bold represents user input):
Etc.
The best CUIs provide maximum data display and minimum query display.
For example, your program may run something like this (bold represents user input):
% a.out Crush Yer Bones's College Project Mr. Teacher Algorithms, Spring 2008 Enter 'help' for help. > help add Add a record to the database delete Remove a record from the database help Enter 'help help' for how to use the help list List all records by title/sort criterion open Open a database file quit Quit save Save changes to the database search Search for a specific record sort Change the criterion used to sort and list the records view View an individual record > help help Enter 'help' followed by the command for which you want more specific information. For example: help view displays how to use the 'view' command. > help view View an individual record. Use it by entering view [OPTIONS] where the OPTIONS are one or more of the following: INDEX The integer index of the record to view NAME The name of the record to view ... If you fail to specify any required options you will be prompted to enter them. > view Enter the record index (ENTER if unknown)> 0 Valid record numbers are 1 to 7. Enter the record index (ENTER if unknown)> > list 1. Annette Johansen 5. Peter Moon 2. Billy Tsu 6. Roark Murphey 3. Miriam Leigh 7. Seanaed Murphey 4. Nuala El-Sayed >
The main purpose of this project is to print a list of items based on their distance to the user's position. To make it easier to locate a particular item I was hoping for easy ways to add/remove displayed parameters (like display name and distance/names only and sort by name/display name and email adress and sort by email).
I have no idea on how to do that except by using a massive amount of conditionals.
I have no idea on how to do that except by using a massive amount of conditionals.
![]() |
Similar Threads
- General Tips for Mac OS X (Mac tips 'n' tweaks)
Other Threads in the C Forum
- Previous Thread: Save file in C?
- Next Thread: malloc fails after 7000 to 8000 loops - available memory is 1GB
| Thread Tools | Search this Thread |
Tag cloud for C
#include ansi array arrays asterisks binarysearch calculate centimeter changingto char command convert copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic fflush file fork forloop framework functions getlasterror givemetehcodez grade graphics gtkgcurlcompiling hacking hardware histogram homework inches include incrementoperators input iso kernel km lazy linked linkedlist linux linuxsegmentationfault list lists locate logical_drives looping loopinsideloop. lowest match matrix microsoft motherboard mysql number opendocumentformat opensource owf pattern pdf performance pointer posix problem probleminc process program programming radix recursion recv research reversing scanf scripting segmentationfault sequential shape socket socketprograming spoonfeeding standard string strings structures student systemcall testing threads turboc unix user variable voidmain() wab windows.h windowsapi







They also happen to be very closely linked together.