Re: Opening and writinging text into text files.
From: rossum (rossum48_at_coldmail.com)
Date: 10/16/04
- Next message: rossum: "Re: "Reverse" heapify"
- Previous message: Otto Wyss: "Re: I want to "move up" from MFC..."
- In reply to: Callum Ginty: "Opening and writinging text into text files."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 16 Oct 2004 22:54:30 +0100
On 14 Oct 2004 05:33:03 -0700, callumginty@gmail.com (Callum Ginty)
wrote:
>ok heres the problem,
>1. Design a program to:
>• Open a text file,
>• Display the contents to the user,
>• Sort the list with regards to A+ to E-,
>• Update the display,
>• Save the sorted list to a text file.
[snip data file]
>now i have no idea on how we are to do this, it is a revision question
>for one of my ipt tests, and it needs to be done in VB 6,
>
>please help!!
No I won't do your homework, however here are some hints to get you
started.
First read the question: you have to design a program to do five
things in order. To me that would suggest that you need to have four
or five functions and then call them in order. The pseudocode would
be something like:
begin
read data from file
if (data not read) then abort with message endif
display data in original order
sort data by grade
redisplay data in sorted order
save sorted data to disk
if (data not saved) then abort with message endif
end
The data from the file will need to go into some kind of object. Look
through VB for an object that can hold the data and that comes with
built-in functions to load from disk, save to disk, display on screen
and sort. Or at least one that does as many as possible of them.
Each built-in function is less work for you to do later.
Try getting each of these functions to work separately, then put them
together. First just open the file and display its contents in the
original order. The start building on that by adding the sort, the
second display and the save to disk in turn. Test your program after
you add each new function to make sure that it still works.
If you get into problems, post what you have done here, or on a VB
specific newsgroup, with an explanation of the problem you are having.
The more work you show, the more help you are likely to get.
rossum
-- The ultimate truth is that there is no Ultimate Truth
- Next message: rossum: "Re: "Reverse" heapify"
- Previous message: Otto Wyss: "Re: I want to "move up" from MFC..."
- In reply to: Callum Ginty: "Opening and writinging text into text files."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|