» Site Navigation | | | » Advertisement | | | » Recent Threads | | | | | | | Jtdusk 10-09-2008 01:32 PM Today 07:08 AM 28 Replies, 319 Views | | | |  | |  | Need a Visual Basic Command |  |
12-09-2007, 02:10 PM
|
#1 (permalink)
| Resident Psychopath.
Join Date: Nov 2006 Location: fewmitz@live.com Posts: 4,921 Rep Power: 15 | Need a Visual Basic Command Okay in Javascript there was a command you could use where you could take a string and an integer and use them in a for loop (or whatever else you want) and use it to sort like an object. Like: Code: For i = 0 to 10
If [command I don't remember]("txt" & i).value = 1 then
msgBox("text box number " & i " is equal to 1)
End If
Next So you could sort through a series of objects and compare them. But I don't remember what the command was called in Javascript and I need it in VB. So does anyone know of a command that would allow me to do something similar?
If you need further elaboration, let me know, I feel my explanation was lacking.
__________________
When life gives you lemons, get a new God.
| |
| |
12-09-2007, 02:28 PM
|
#2 (permalink)
|
Join Date: Feb 2007 Posts: 3,413 Rep Power: 19 | Ummm something like this? Code: For i = 1 To 1000000
Label1.Caption = i
Next What are you trying to do? | |
| |
12-09-2007, 03:30 PM
|
#3 (permalink)
| Resident Psychopath.
Join Date: Nov 2006 Location: fewmitz@live.com Posts: 4,921 Rep Power: 15 | The exact opposite actually.
If I have a list of items. lbl1, lbl2, lbl3, etc etc
How would I use a For loop to check to see if they're equal to a number, string, char, etc.
I'm aware I could just use an assload of If Statements, but I can't because of the way I want to use it.
__________________
When life gives you lemons, get a new God.
| |
| |
12-10-2007, 03:32 AM
|
#4 (permalink)
| Underground
Join Date: Sep 2006 Location: Denmark Age: 18 Posts: 237 Rep Power: 7 | Just put them in a list box and call it like this. Quote:
Dim x as integer
For x = 0 to lstString.ListCount - 1
If lstString.List(x) = "Blah" then
'code
ElseIF lstString.List(x) = "BlahBlah" Then
'code
Else
'code
End If
Next x
| That should work | |
| |
12-10-2007, 07:05 AM
|
#5 (permalink)
|
Join Date: Feb 2007 Posts: 3,413 Rep Power: 19 | Ohh, I know what you mean. But I don't know how you could do that.
Best bet is do what Cheesie said.
Or do IF's. | |
| |
12-10-2007, 12:10 PM
|
#6 (permalink)
| Resident Psychopath.
Join Date: Nov 2006 Location: fewmitz@live.com Posts: 4,921 Rep Power: 15 | Blech, I really didn't wanna use lists, but I guess I have to.
__________________
When life gives you lemons, get a new God.
| |
| |
12-10-2007, 03:38 PM
|
#7 (permalink)
| Underground
Join Date: Sep 2006 Location: Denmark Age: 18 Posts: 237 Rep Power: 7 | why.. .lists are good. | |
| |
12-10-2007, 04:11 PM
|
#8 (permalink)
| Resident Psychopath.
Join Date: Nov 2006 Location: fewmitz@live.com Posts: 4,921 Rep Power: 15 | That doesn't make me want to use them D=
__________________
When life gives you lemons, get a new God.
| |
| |
12-10-2007, 04:53 PM
|
#9 (permalink)
| Underground
Join Date: Sep 2006 Location: Denmark Age: 18 Posts: 237 Rep Power: 7 | why dont you want to use them then? | |
| |
12-10-2007, 06:01 PM
|
#10 (permalink)
| Resident Psychopath.
Join Date: Nov 2006 Location: fewmitz@live.com Posts: 4,921 Rep Power: 15 | No reason in particular, it would just make the program I'm eventually gonna make .2% easier.
__________________
When life gives you lemons, get a new God.
| |
| |  | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |