Re: IF/THEN Structure Issues - "Error: Too Many Continuations" PLS
- From: "J. M. Aloye" <J. M. Aloye@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 18 Jul 2005 08:49:11 -0700
Hal,
Your boolean array suggestion sounds viable. However, how do I actually get
the numbers from my list into the boolean array from a syntax standpoint?
So far, I have the following code associated with a button on my form...
-------------------------------------------------------------------------------------
Dim MyArrayForCheckingNums() As Boolean -
//I need to initialize this array to contain the 1000 numbers from my list.
How do I do that?
Private Sub CheckTextBox1aForNum_Click()
Dim TxtBoxVal As Integer
Dim NumInTextBoxExistOnList As Boolean
Dim TxtBoxValSearch As Integer
Dim NumOnListFound as Boolean
NumOnListFound = False
TxtBoxValSearch = Val(txtPos1a.text)
For TxtBoxVal = 0 To UBound(MyArrayForCheckingNums)
If MyArrayForCheckingNums (TxtBoxVal) = TxtBoxValSearch Then
NumOnListFound = True
Exit For
End If
End Sub
----------------------------------------------------------------------------
If I can get this piece of code to work properly, then I can enlarge it to
handle all six of my text boxes.
Thanks alot of any suggestions of advice you may have on this issue.
- J. M. Aloye
"Hal Rosser" wrote:
>
> "J.M.Aloye" <JMAloye@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:EAD7E2B4-62BF-4821-85F7-C9EBC3325336@xxxxxxxxxxxxxxxx
> > I have a hardcopy list of 1000 numbers (integers).
> >
> > The numbers on my hardcopy list themselves remain constant as do the
> number
> > of "integer numbers" on the list. It will always contain the same 1000
> numbers
> >
> > Looking at my Visual Basic 6 SP6 Form, I have 6 text boxes that contain
> > integer numbers. Each of the 6 boxes may contain a different number and
> the
> > numbers may or may not be equal to one of the numbers on the 1000 number
> > list.
> >
> > I need a piece of code that will allow me to check the number in each of
> my
> > text six boxes to see if the number contained in each is the same as one
> of
> > the integers on my hardcopy list.
> >
> > I originally tried to use an "If/Then structure with the "OR"
> >
> > If (txt1.text = "7" OR txt1.text ="27" OR txt1.text ="42" ......... ) Then
> > bla bla
> > Else bla bla
> > END IF
> >
> > However since I have 1000 numbers on my list, I receive an error in Visual
> > Basic 6 while I am typing in my code
> >
> > If (txtPos1a.Text = "2" & vbCrLf _
> > & "" Or txtPos1a.Text = "5") & vbCrLf _
> > & "" Or txtPos1a.Text = "7" & vbCrLf _
> > {{{{ Approximately 15 Lines of Similar Looking Code Here But Cut For
> Brevity
> > }}}
> > & "" or txtPos1a.Text = "97" & vbCrLf _
> > & "" or txtPos1a.Text = "101" & vbCrLf -------->> I receive the error
> when
> > continuing to enter code here
> >
> > The VB 6 Error Message I receive says "Error: Too Many Continuations"
> >
> > Is there another structure that will allow me to accomplish my goal? Am I
> > doing something incorrect? Please help me out! What code must I write that
> > will allow me to determine if the number in my text box is one of the 1000
> > numbers on my hardcopy list? Any help, advice, suggestions will be greatly
> > appreciated.
> >
> > --
> > Sincerely,
> > J.M.Aloye
>
> Use an array of type "Boolean" .
> The largest number is the size of the array.
> If the number is on your list, set that element to True.
> There will be no need to search for the number, just use it as an array
> index.
> For searching, just check if that element is true or not.
>
>
>
>
.
- References:
- IF/THEN Structure Issues - "Error: Too Many Continuations" PLS Hel
- From: J.M.Aloye
- Re: IF/THEN Structure Issues - "Error: Too Many Continuations" PLS Hel
- From: Hal Rosser
- IF/THEN Structure Issues - "Error: Too Many Continuations" PLS Hel
- Prev by Date: Re: Simple but Confusing Shell() Problem
- Next by Date: Getting NULL reading Excel in ADO
- Previous by thread: Re: IF/THEN Structure Issues - "Error: Too Many Continuations" PLS Hel
- Next by thread: RE: IF/THEN Structure Issues - "Error: Too Many Continuations" PLS Hel
- Index(es):
Loading