|
-
Jul 12th, 2000, 06:12 AM
#1
Thread Starter
Fanatic Member
Ok heres the problem.
I have a combobox and the Values for it are stored at a url.
What i need to know is how to add items to the combo box. But see...i know how to do that.
Code:
Combobox1.AddItem Inet1.OpenURL ("url", icString)
but the problem is, the values that i need are lined up like so:
Need
Need1
Need2
.
.
Does anyone know how i would go about adding those words to the combobox?
Thank you,
D!m
[Edited by Dim on 07-12-2000 at 07:22 AM]
-
Jul 12th, 2000, 06:35 AM
#2
_______
<?>
is this of any use...not sure when and how you are
accessing the values..
Private Sub Command1_Click()
Dim x As Integer, i As Integer
For i = 0 To 11
Combo1.AddItem i
If i = x Then
List1.AddItem i
x = x + 2
End If
Next
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 12th, 2000, 06:51 AM
#3
Thread Starter
Fanatic Member
Ok, maybe i'll explain it better this time.
I have a remote file with text in it.
Thing
1
Thing1
2
Thign2
3
Thing3
.
.
.
What i want is to add every first value to a combobox.
I can add all of then to one line by using
Combo1.AddItem iNet1.Open("url", icString)
That adds all the values to one line thought, and i need only Thing1,Thing2, Thing3 added.
Hope that explains it better.
I can also get it so Only Thing1 Thing2 Thing3 Appear in the html file and have 1,2,3 in another.
So it will be:
Thing1
Thing2
Thing3
.
.
.
Any way i can add those things to the ComboBox?
[Edited by Dim on 07-12-2000 at 07:56 AM]
-
Jul 12th, 2000, 07:04 AM
#4
_______
<?>
'this is the principal of the matter
'this will load every second record
'you just have to adapt your code
Private Sub Command1_Click()
Dim x As Integer, i As Integer
x = 1
For i = 1 To 11
Combo1.AddItem i
If i = x Then
List1.AddItem i
x = x + 2
End If
Next
End Sub
Ie..
open file
i = 1
x = 1
while not eof(#1)
if i = x then
additem yourstring from your file
x = x + 2
etc...will give thing,thing1,thing2..as you
are incrementing by 2
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 12th, 2000, 07:10 AM
#5
Frenzied Member
I think you need to read the page into a string and then spilt the string up into the parts you require and add them to the comobox.
Without having some indication of what the url contains, I can't really help you any more than that.
although if the page is a plain list of words with <BR> seperating them...
Code:
Dim words() As String
Dim i As Integer
Dim strtemp As String
Dim strURL As String
Inet1.AccessType = icUseDefault
strURL = "http://graffiti.virgin.net/dms.mbs/words.htm"
strtemp = Inet1.OpenURL(strURL, icString)
words = Split(strtemp, "<BR>")
For i = 0 To UBound(words)
Combo1.AddItem words(i)
Next
-
Jul 12th, 2000, 07:11 AM
#6
Thread Starter
Fanatic Member
I'm sorry it must be too early in the morning.
Does this look right? It's adding numbers to the combo box though...i'm so lost
Code:
Dim x As Integer, i As Integer
x = Inet1.OpenURL("url", icString)
For i = 1 To 99
Combo1.AddItem i
If i = x Then
List1.AddItem i
x = x + 2
End If
Next
-
Jul 12th, 2000, 07:13 AM
#7
Frenzied Member
oh I nearly forgot!
Split() is a VB6 function
If you are using VB5 take a look at this:
http://support.microsoft.com/support.../Q188/0/07.ASP
-
Jul 12th, 2000, 07:20 AM
#8
_______
<?>
I think it's too early for me too
this won't work..
Dim x As Integer, i As Integer
x = Inet1.OpenURL("url", icString)
For i = 1 To 99
Combo1.AddItem i
If i = x Then
List1.AddItem i
x = x + 2
End If
Next
send me the file via email and I'll play with it..
type out one line of exactly what you want in the combo
box as well
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 12th, 2000, 07:21 AM
#9
Thread Starter
Fanatic Member
The url is linking to a php file witch just lists the things
Thing1
Thing2
Thing3
Would i replace "<br>" with Chr$(13)?
I need this asap please.
The url is something like
http://www.mcdonalds.com/getftp.php?...request=stores
Thanx
-
Jul 12th, 2000, 07:25 AM
#10
Frenzied Member
Yes. Try it and see!
The link you posted didn't find a file.
-
Jul 12th, 2000, 07:33 AM
#11
Thread Starter
Fanatic Member
omg i'm like gonna pass out here.
I have
Code:
Dim words() As String
Dim i As Integer
Dim strtemp As String
Dim strURL As String
Inet1.AccessType = icUseDefault
strURL = "http://www.mcdonalds.com/getftp.php?access=allow&request=stores"
strtemp = Inet1.OpenURL(strURL, icString)
words = Split(strtemp, Chr$(13))
For i = 0 To UBound(words)
Combo1.AddItem words(i)
Next
It still add the values all to one line in the combo box.
I've tried puting Chr$(13) in quotes and it still add everything to one line.
Someone come to my rescue PLZ, i'm dieing here.
Ps. I can't show the real url.
Thank you
-
Jul 12th, 2000, 07:38 AM
#12
Thread Starter
Fanatic Member
ok nm, i got that going, i just replaced Chr$(13) with <BR>
now that's all working fine. Thank you very much Mark. I will be (most likely) posting a similar post in a couple hours, and maybe you can help me with that one also.
Thank you,
D!m
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|