Jump to content
xisto Community
Sign in to follow this  
sammaye

Limiting Usage Of Variable Combination combination of names no more than twice

Recommended Posts

Ok I have a program which prints out match lists. There are 4 games for 4 match lists will be printed out.

The problem I have is that when I print a match list out once or twice they are all the same combination of names. I need a combination of names to be able to only be used twice and not 4 times.

I.e. of how it comes out at mo

Match list 1

brad VS charlie


Match list 2

brad VS Charlie

match list 3

Brad VS Charlie

match list 4

brad VS charlie


I.e. of how it should be


match list 1

brad VS charlie

match list 2

Brad VS helen

Match list 3

Brad VS charlie

match lsit 4

Brad VS egga

each of the match lists would be on sperate pages and would have 18 names in total to them this is the code I have so far produced for it:

dim stryellowused as stringstrYellowUsed = String(18, "0")For m = 1 To 4For i = 1 To 72   For j = 1 To 72      If green_array(i, 2) <> yellow_array(j, 2) And Mid(strYellowUsed, j, 1) = "0" Then         'yellow_array(j, 2) differs from green_array(i, 2) and hasn't been selected before         Printer.Print green_array(i, 1), "Vs", yellow_array(j, 1)         Print EndDoc         'Set flag to prevent yellow_array(j, 2) being selected again         Mid(strYellowUsed, j, 1) = "1"         'Exit the "For j = 1 to 18" loop so that we can process the next green_array element         Exit For      End If   Next jNext iPrinter.NewPageNext m

But this produces only one set of the results I want and four blank pages...
the thing I cant get around is how to stop one combination of names appearing in more than two games I tried using a falg like the stryellowused but it was no use...does anyone have any ideas..I was thinking that the entire row the would be printed out neds to be stored and have a variable added to it like 1 to process wehter its been used once but Im not a vb programmer and I dont really like vb lol...

PLZ help this has been bugging me for so long

thanks,

sammaye

Notice from BuffaloHELP:
Edited title. Using "Need Help! Urgent!" as title is unacceptable. Last caution note.

Edited by BuffaloHELP (see edit history)

Share this post


Link to post
Share on other sites

I have made some progress due to help form vbcity but still no one seems to be able to make it right, not even the professional programmers lol..but I thought is there some way I can put in a variable which will grab the pair of names used which a 1 or 0 can be added (1 and 0 for falgging) in the same way as stryellowused has been used. So the method I have thought up of is to use a strused to grab each pair of names that has been used and store them in a variable which can have a 1 or 0 added to it to make sure that the names dont appear again...does anyone have any ideas has how to go about this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.