|
-
May 25th, 2004, 09:24 AM
#1
Thread Starter
Hyperactive Member
See / edit an array
Hi guys...
I'm a beginner in VB.. my version is 6
I'm trying to display an array, but I don't know how
I would also like to edit the values of the array while in exe mode...
I don't How to do it... Can you guys help me???
-
May 25th, 2004, 09:40 AM
#2
Lively Member
VB Code:
dim x(0 to 2) as integer
x(0)=1
x(1)=2
x(2)=45
for i = LBOUND(x) to ubound(x)
msgbox x(i)
next
very handy: [vbcode][/vbcode]
VB.NET - VB6 - VBA - ASP - RPG(AS/400) - C++ - java - SQL
look in the help, many probs can be solved that way.
I know, i'm to lazy too.
PLEASE PUT RESOLVED IF RESOLVED!!
-
May 25th, 2004, 09:56 AM
#3
Thread Starter
Hyperactive Member
well... I'm a beginner but not that mutch of a beginner...
now really.. I'm didn't explained very well what I wanted...
I want to be able to see as if in a label the values I had inserted or manipulated in the array, and I would also liked to edit them..
-
May 25th, 2004, 10:00 AM
#4
Lively Member
and now in english
sorry, but your sentence is not well constructed, i am not english myself, maybe it's that :s
very handy: [vbcode][/vbcode]
VB.NET - VB6 - VBA - ASP - RPG(AS/400) - C++ - java - SQL
look in the help, many probs can be solved that way.
I know, i'm to lazy too.
PLEASE PUT RESOLVED IF RESOLVED!!
-
May 25th, 2004, 10:06 AM
#5
Thread Starter
Hyperactive Member
I'll try my best...
It's like this:
I have an array (ex:test(1 to 100) as integer) and I would like to see all of the values of the array in a Label (or whatever) while executing the program ...
I would also like to change the values in the label (or Whatever) and the program automaticly changes the value in the array...
I'm trying to do my best here ... If you don't understand . please say..
-
May 25th, 2004, 11:13 AM
#6
Hello
You've got the array¿
If you want to display the info inside the array:
label1.Caption = CStr(test(0))
label2.Caption = CStr(test(1))
Is that what you are after¿¿
Hannes
VB.NET MVP 2008 - Present
-
May 25th, 2004, 11:22 AM
#7
Thread Starter
Hyperactive Member
That works if you only want to display, and even so it only works for a small array...
the problem is I can't edit the values.. and subsequently change the values in the array (inside the program)...
other problem.. that could partialy be solved if I could insert in to a list ... is to show all the array in one object, with no limits (I could insert values, thus inserting in the array), or wiht a very high limit...
maybe this is a bit tough... but is necessary for my project to work!!!..
-
May 25th, 2004, 11:37 AM
#8
try this then:
VB Code:
'this should load tha array into a combo box
Dim i as integer
For i = 0 to UBound(test)
combo1.AddItem CStr(test(i))
Next i
VB.NET MVP 2008 - Present
-
May 25th, 2004, 11:44 AM
#9
Thread Starter
Hyperactive Member
Actually I can't try it right now...
but ... by the way what does the cstr() do??..
..and Will I be able to insert values in the combo box thus inserting in the array??..
-
May 25th, 2004, 11:48 AM
#10
The CStr converts the Integers to strings.
VB.NET MVP 2008 - Present
-
May 25th, 2004, 12:32 PM
#11
try putting the array values into a text box with multiline property true like this
assume your array is s()
Code:
textbox.text = ""
for i = LBound(s) to UBound(s)
textbox.text = s(i) & vbcrlf
next i
the text box will allow you to edit the values, then in a button click event, put the values back into the array using the split function
Code:
s=split(textbox.text,vbcrlf)
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
May 26th, 2004, 03:12 AM
#12
Thread Starter
Hyperactive Member
But what I'm trying to use is a 2 dimension array, does this also work with that ... is it possible to have more then 1 colum in the text box??
-
May 26th, 2004, 03:42 AM
#13
Frenzied Member
What about using a flexgrid control instead?
There is code in the codebank on how to write to it.
-
May 26th, 2004, 09:02 AM
#14
Thread Starter
Hyperactive Member
can you give me the link??...
I can't find it anywere!!!
-
May 26th, 2004, 09:08 AM
#15
Another possibility would be to use two list boxes. The first list box holds the first dimension of the array, and when you double-click on one item, the second list box gets filled with the second dimension that corresponds to that first dimension. I think the tree view could do that, too, but I don't have much experience with that.
The flexgrid control would be most obvious, but being able to edit in it cleanly can take some trickery that might be more than you want.
-
May 26th, 2004, 09:22 AM
#16
Thread Starter
Hyperactive Member
the two (or more) list boxes idea seemes great... how can I do it(in code.. please!!)?
I'm trying to build a 6 column display (list box or whatever)..
and what about that flexgrid control everybody talks about?? Where can I find it??..
However dificult.. I just want to learn!!!...
-
May 26th, 2004, 09:55 AM
#17
Originally posted by Shaggy Hiker
Another possibility would be to use two list boxes. The first list box holds the first dimension of the array, and when you double-click on one item, the second list box gets filled with the second dimension...
nice!
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
May 27th, 2004, 03:25 AM
#18
Thread Starter
Hyperactive Member
come on guys ...
can you please give me the code (functions) for the flexgrid control or the 6 colums text box ...
PS: F.C.Porto Rules!!... Were EUROPEAN CHAMPIONS!!!!...
-
May 27th, 2004, 04:33 AM
#19
Frenzied Member
-
May 28th, 2004, 03:55 AM
#20
Thread Starter
Hyperactive Member
I used the first code, and it is great... You guys RULE!!!... (the second I couldn't make it work... neither could I understand it)
thanks a lot...
however there is still a little setback: I can't insert new cells while in execution mode, and neither can I save the changes...
I'm thinking to save the new value in the flexgrid_click sub function, when the user presses <enter> however I haven't had much success...
can you guys give a little push
(If possible in code )
-
May 28th, 2004, 10:18 AM
#21
Thread Starter
Hyperactive Member
....
is anybody out there???...
....
come on.. I know you know how to do it...
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
|