Jul 7, 2008

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

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > VB Programming

free web hosting

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

sammaye
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.

 

 

 


Reply

sammaye
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

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. combination of names - 93.85 hr back.
  2. grammar usage - brad & i versus brad & me - 265.77 hr back.
  3. two combination of names - 302.74 hr back.
  4. combination names - 302.74 hr back.
  5. match all combination of name - 499.89 hr back.
Similar Topics

Keywords : limiting usage variable combination combination names

  1. Variable Definition - (6)



Looking for limiting, usage, variable, combination, combination, names

Searching Video's for limiting, usage, variable, combination, combination, names
advertisement



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



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE