Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How to...

    i have 3 label and i want to combine all possible combinations wath is the right way?

    the condition is:

    1) all label have caption =blank or empty
    2) labe1 caption is filled label2 caption is filled label3 caption is no blank
    3) label1 caption is balnk label2 caption ecc...
    ...
    9)...

    i think the combination are 9 (3*3) or not?

    case selcet? or...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    There are 2^3 = 8 possibilities. You could use nested If-statements:

    Code:
    If Label1.Caption = "" Then
      If Label2.Caption = "" Then
    	If Label3.Caption = "" Then
    	  ...
    	Else
    	  ...
    	End If
      Else
    	If Label3.Caption = "" Then
    	  ...
    	Else
    	  ...
    	End If
      End If
    Else
      If Label2.Caption = "" Then
    	If Label3.Caption = "" Then
    	  ...
    	Else
    	  ...
    	End If
      Else
    	If Label3.Caption = "" Then
    	  ...
    	Else
    	  ...
    	End If
      End If
    End If

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='771610' date='21-Apr-2009 21:49']There are 2^3 = 8 possibilities. You could use nested If-statements:

    Code:
    If Label1.Caption = "" Then
      If Label2.Caption = "" Then
    	If Label3.Caption = "" Then
    	  ...
    	Else
    	  ...
    	End If
      Else
    	If Label3.Caption = "" Then
    	  ...
    	Else
    	  ...
    	End If
      End If
    Else
      If Label2.Caption = "" Then
    	If Label3.Caption = "" Then
    	  ...
    	Else
    	  ...
    	End If
      Else
    	If Label3.Caption = "" Then
    	  ...
    	Else
    	  ...
    	End If
      End If
    End If
    [/quote]

    wow! but this is a lesson of ststistic calculation...

    I can test tomorrow in my office.
    Tks as usual for the patience.
    Sal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •