-
Dim A As Integer
-
Dim B As Integer
-
B = 0
-
-
Dim LArray() As String = {"a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z"}
-
Dim SArray() As String = {"`, ~, !, @, #, $, %, ^, &, *, (, ), [, {, ], }, \, |, ;, :, ', /, ?, ., >, <"}
-
Dim LSArray() As String = {"a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z,`,~,!,@,#,$,%,^,&,*,(,),[,{,],},\,|,;,:,',/,?,.,>,<"}
-
If letterbox.Checked = True Then A = B + 1
-
end if
-
If symbolbox.Checked = True Then A = B + 10
-
end if
-
If A = 1 Then TextBox3.Text = LArray(Int(Rnd() * 25))
-
end if
-
If A = 10 Then TextBox3.Text = SArray(Int(Rnd() * 25))
-
end if
-
If A = 11 Then TextBox3.Text = LSArray(Int(Rnd() * 50))
-
end if
-
The End If is underlined and said it needs a preceding 'If'
It does have one but for some reason it isn't recognizing it and I think I need brackets or parenthesis somewhere but I'm new to VB(thus the newb stuff) and I'm just making random stuff to help me learn it.
And for those wondering, it randomly generates a letter, a symbol, or a letter/symbol.
Please Help, Jack-O-VB
1 1043
Not quite. An IF statement can be constructed in two ways. The single-line version is simply - If Condition Then DoSomething
The multi-line version is - If Condition Then
-
DoSomething
-
...
-
End If
In your case you need to either remove the End If, or split the "DoSomething" code onto a separate line. the choice is yours.
Side note: in checking multiple values of A in that way, you should check out the Select Case statement.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: matt |
last post by:
I have an image randomizer that was working fine. I added five images to it
today, and none of the new five are ever called. Here's the script:
<!-- Begin
var theImages = new Array()
...
|
by: x muzuo |
last post by:
Hi guys,
I have got a prob of javascript form validation which just doesnt work
with my ASP code. Can any one help me out please.
Here is the code:
{////<<head>
<title>IIBO Submit Page</title>...
|
by: Craig Keightley |
last post by:
Please help, i have attached my page which worksin IE but i cannnot get the
drop down menu to fucntion in firefox. Any one have any ideas why?
Many Thanks
Craig
...
|
by: Jason |
last post by:
Hi,
I was wondering if any could point me to an example or give me ideas on how
to dynamically create a form based on a database table? So, I would have a
table designed to tell my application...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |