Sorting in VB

mechboard

Baseband Member
Messages
21
I want to produce a report of mymovie collection. Which fields would I use, and which would be the data types of each of those fields?


I also want to create a flowchart and pseudo-code for generating a report that prints all of the movies, with all movies made by the same director on one page, as well as the number of movies by each director.



Please check for me if the pseudo-code bellow is correct

Moviecollection()
Movietype= “”

If Director = Tom Jackson then
Movietype = “Action”
Else
If Director = Bill Adams
Movietype= “Comedy”
Else
If Movietype = Action then
Director = “Tom Jackson”
Else
If Movietype= Comedy Then
Director = “Bill Adams”
Else
Movietype = “Drama”
Endif
EndIf
EnfIf
EndIf

Return
 
You should use

Code:
 Else If
instead of having it on the separate lines.

Other than that, I can't see any immediate problems, but my VB is a little rusty.
 
thanks guys

Don't you think I need int, since I have to count numbers of movies a director made
 
there is a problem...

the second line of your code you clear movie type, but later you check movie type.

you code should start something like

Moviecollection(Movietype, Director)

do if statements.

then shove the movie type and director into an array

ret[1]=movie type
ret[2]=Director

then return the variables

return ret


Your pseudo code assume te use of global variables this is generally a bad paractise.
 
Back
Top Bottom