Re: Opening and writinging text into text files.

From: rossum (rossum48_at_coldmail.com)
Date: 10/16/04


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


Relevant Pages

  • Re: working on Apple ][ emulator, need volunteers
    ... but this design became particularly locked ... is needed or useful, only logic simulation. ... I had a thought - if imaging was possible on the bare Apple][and you ... to fully characterize a disk using an Apple II and the Disk][ ...
    (comp.emulators.apple2)
  • Re: VB Circle Method Seems to be Seriously Flawed
    ... The best display accuracy you can hope for is +- 1 Pixel. ... > small changes once you're close to the final design. ... > modeling and all are displayed at the same time in the picture box at the ... >> probably know, the underlying objects can be very accurate, and should ...
    (microsoft.public.vb.general.discussion)
  • Mystery CLKDLL, IBUFG, BUFG modules in verilog src (ISE 6.3.03i)
    ... I am using ISE 6.3.03i from Xilinx to load the design onto the ... module seven_seg (CLK, PUSH, DIP, DISPLAY, LED); ... // Register and debounce push buttons and switches ...
    (comp.arch.fpga)
  • Re: How can I recover a (large) file that I have started to COPY over (rather than delete) ?
    ... ship wrote: ... And thus copying data from disk to disk remains a very dangerous ... to design an operating system to perform the same activity whenever ... why don't you design an OS to do exactly what you are asking being ...
    (microsoft.public.windowsxp.general)
  • Re: Validate Two Date Fields
    ... Thanks Allen however aftern placing some text in the Validation Text property ... > Whatever message you wish to display, you can place in the Validation Text ... > property of the table (Properties box in table design view.) ... > changing the sort order, closing the form, closing Access, pressing ...
    (microsoft.public.access.formscoding)