What needs to be changed or added for the following code to work? I program mostly in Java now, and I've forgotten alot of my Visual Basic.
Option Explicit
Private Sub cmdEncode_Click()
Dim key1 As String
Dim key2 As String
key1 = UCase(txtKey1.Text)
key2 = UCase(txtKey2.Text)
If ValidateKey(key1, "Validating key 1...", "Key 1 not valid!") = False Then
Exit Sub
End If
If ValidateKey(key2, "Validating key 2...", "Key 2 not valid!") = False Then
Exit Sub
End If
Dim i As Integer
For i = 1 To Len(key1)
ProgressBar.Value = i
Dim x As Integer
For x = 0 To i - 1
If lblKey1(x).Caption <> Mid(key1, i, 1) Then
lblKey1(i - 1).Caption = Mid(key1, i, 1)
End If
Next x
Next i
End Sub
Private Function ValidateKey(ByVal key As String, ByVal status As String, ByVal error As String) As Boolean
Dim check(Len(key)) As String
Dim i As Integer
lblStatus.Caption = status
ProgressBar.Min = 1
ProgressBar.Max = Len(key)
For i = 1 To Len(key)
ProgressBar.Value = i
Dim x As Integer
For x = 0 To i - 1
If check1(x) <> Mid(key, i, 1) Then
check1(i - 1) = Mid(key, i, 1)
Else
ProgressBar.Value = 0
lblStatus.Caption = error
ValidateKey = False
Exit Function
End If
Next x
Next i
ValidateKey = True
End Function
This throws the following error:
Quote
Compile error:
Constant expression required
When you follow the debug it takes you to these lines:
Private Function ValidateKey(ByVal key As String, ByVal status As String, ByVal error As String) As Boolean
Dim check(Len(key)) As String
It highlights the function with yellow and then selects the text "key" in "Len(key)" as the source of the error.
Poor UI design is unacceptable from a company the size of MS.
The UI team needs an overhaul.
To whom else might be be having this same issue, I found the following tool that DOES work for this missing setting:
https://www.wintools.info/index.php/advanced-system-font-changer#google_vignette
It's MY computer, and I want to be able to make it look the way I WANT! I OWN IT! NOT MS!
That is Arc System Works who are known for having fantastic visuals. It looks better than any Capcom fighting game involving Marvel, that's for sure. I can't be certain but I believe it might be the first 4v4 standard fighting game? If you mean you are tired of seeing Marvel characters you might have a point.
Question
Delox
What needs to be changed or added for the following code to work? I program mostly in Java now, and I've forgotten alot of my Visual Basic.
This throws the following error:
When you follow the debug it takes you to these lines:
It highlights the function with yellow and then selects the text "key" in "Len(key)" as the source of the error.
Link to comment
https://www.neowin.net/forum/topic/398028-vb6-boolean-function/Share on other sites
15 answers to this question
Recommended Posts