Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Limiting Usage Of Variable Combination, combination of names no more than twice
sammaye
post Dec 30 2005, 05:44 PM
Post #1


Member [Level 2]
*****

Group: Members
Posts: 87
Joined: 12-March 05
From: somewhere in the UK...if only I knew
Member No.: 4,419



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:

CODE
dim stryellowused as string

strYellowUsed = String(18, "0")


For m = 1 To 4
For 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 j
Next i
Printer.NewPage
Next 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.


This post has been edited by BuffaloHELP: Dec 30 2005, 07:04 PM
Go to the top of the page
 
+Quote Post
sammaye
post Jan 1 2006, 02:42 PM
Post #2


Member [Level 2]
*****

Group: Members
Posts: 87
Joined: 12-March 05
From: somewhere in the UK...if only I knew
Member No.: 4,419



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics


 



- Lo-Fi Version Time is now: 12th October 2008 - 05:23 PM