OVH Cloud OVH Cloud

Array's Problem

4 réponses
Avatar
jack
Hi Folks,

I am new to vb6 and programing,My question is i have 2 arrays i want to
store big numbers from firstarray which i enterd through text box. i
Know how to copy one array to another but i tried for sorting first
array and store in secod array after that second array valus must shown
in listbox,is there any easy steps to solve my program.

The below code is like which i writen


Option Explicit
Dim firstarray(5) As Integer
Dim secondarray(5) As Integer
Dim index As Integer
Dim listarray As Integer
Dim secondarrayindex As Integer
Dim arraycount As Integer
Dim big As Integer
Dim removeindex As Integer
Private Sub Command1_Click()


firstarray(index) = Text1.Text
listarray = firstarray(index)
index = index + 1
secondarray(index) = listarray
secondarrayindex = secondarrayindex + 1
arraycount = secondarray(index)
secondarray(index) = removeindex

If arraycount > big Then
big = arraycount
End If

List1.AddItem big

End Sub

Private Sub Form_Load()
index = 0

End Sub

4 réponses

Avatar
Jean-marc
> Hi Folks,

I am new to vb6 and programing,My question is i have 2 arrays i want to
store big numbers from firstarray which i enterd through text box. i
Know how to copy one array to another but i tried for sorting first
array and store in secod array after that second array valus must shown
in listbox,is there any easy steps to solve my program.



Hello Jack,

It seems that you're not an english native speaker,
which btw is fine because you're here in the french
Microsft Visual Basic group :-)

So, I'll continue in french, hope this is your mother's
tongue. If not, just let us know.

Bon, je n'ai pas bien compris ce que tu veux faire.
Tu entres des nombres un par un en utilisant une textbox
et tu stockes ces nombres dans le premier tableau. Ce qui
est moins clair, c'est la suite.

Veux tu trier le premier tableau et mettre le résultat du tri
dans le second?

Faut il ensuite afficher le second (donc le résultat du tri) dans
la listbox?

Si tu peux donner qq explications, tu trouveras certainement une
répinse rapide :-)

Bonne soirée - hope this helps ;o)

--
Jean-marc Noury (jean_marc_n2)
Microsoft MVP - Visual Basic
mailto: remove '_no_spam_' ;
FAQ VB: http://faq.vb.free.fr/

"jack" a écrit dans le message de news:

Avatar
LE TROLL
Hello, here it is not english forum, here it is french forum, please, you to
go in english forum, thank you, bye :o)

--
Site de MES LOGICIELS
http://irolog.free.fr
Site éditeur MES ROMANS édités
Le serpent
http://www.manuscritdepot.com/a.joseph-attila-pusztay.1.htm
Le Gaulois
http://manuscritdepot.com/a.joseph-attila-pusztay.2.htm
mon adresse EMail
http://irolog.free.fr/ecrire/index.htm
------------------------------------------------------------------------------------
"jack" a écrit dans le message de news:

Hi Folks,

I am new to vb6 and programing,My question is i have 2 arrays i want to
store big numbers from firstarray which i enterd through text box. i
Know how to copy one array to another but i tried for sorting first
array and store in secod array after that second array valus must shown
in listbox,is there any easy steps to solve my program.

The below code is like which i writen


Option Explicit
Dim firstarray(5) As Integer
Dim secondarray(5) As Integer
Dim index As Integer
Dim listarray As Integer
Dim secondarrayindex As Integer
Dim arraycount As Integer
Dim big As Integer
Dim removeindex As Integer
Private Sub Command1_Click()


firstarray(index) = Text1.Text
listarray = firstarray(index)
index = index + 1
secondarray(index) = listarray
secondarrayindex = secondarrayindex + 1
arraycount = secondarray(index)
secondarray(index) = removeindex

If arraycount > big Then
big = arraycount
End If

List1.AddItem big

End Sub

Private Sub Form_Load()
index = 0

End Sub



Avatar
ecappa
Even if it is French here, you can still have a look here
:http://killervb.com/SortedList.aspx
A great sort list classes writen by KillerVB...

Hope it will be helpfull.

"LE TROLL" a écrit :

Hello, here it is not english forum, here it is french forum, please, you to
go in english forum, thank you, bye :o)

--
Site de MES LOGICIELS
http://irolog.free.fr
Site éditeur MES ROMANS édités
Le serpent
http://www.manuscritdepot.com/a.joseph-attila-pusztay.1.htm
Le Gaulois
http://manuscritdepot.com/a.joseph-attila-pusztay.2.htm
mon adresse EMail
http://irolog.free.fr/ecrire/index.htm
------------------------------------------------------------------------------------
"jack" a écrit dans le message de news:

> Hi Folks,
>
> I am new to vb6 and programing,My question is i have 2 arrays i want to
> store big numbers from firstarray which i enterd through text box. i
> Know how to copy one array to another but i tried for sorting first
> array and store in secod array after that second array valus must shown
> in listbox,is there any easy steps to solve my program.
>
> The below code is like which i writen
>
>
> Option Explicit
> Dim firstarray(5) As Integer
> Dim secondarray(5) As Integer
> Dim index As Integer
> Dim listarray As Integer
> Dim secondarrayindex As Integer
> Dim arraycount As Integer
> Dim big As Integer
> Dim removeindex As Integer
> Private Sub Command1_Click()
>
>
> firstarray(index) = Text1.Text
> listarray = firstarray(index)
> index = index + 1
> secondarray(index) = listarray
> secondarrayindex = secondarrayindex + 1
> arraycount = secondarray(index)
> secondarray(index) = removeindex
>
> If arraycount > big Then
> big = arraycount
> End If
>
> List1.AddItem big
>
> End Sub
>
> Private Sub Form_Load()
> index = 0
>
> End Sub
>





Avatar
Le pape
Hi there,

If you want to sort the first array, you can try to use a bubble sort
routine to achieve this...

I can get one to you if required, but you can also find an excellent
example on http://vbnet.mvps.org/ Get to the Code library and pick the
Sort menu which will redirect you to a series of sorting routines...

HTH

Philippe (not a native english speaker...)

jack a écrit :
Hi Folks,

I am new to vb6 and programing,My question is i have 2 arrays i want to
store big numbers from firstarray which i enterd through text box. i
Know how to copy one array to another but i tried for sorting first
array and store in secod array after that second array valus must shown
in listbox,is there any easy steps to solve my program.

The below code is like which i writen


Option Explicit
Dim firstarray(5) As Integer
Dim secondarray(5) As Integer
Dim index As Integer
Dim listarray As Integer
Dim secondarrayindex As Integer
Dim arraycount As Integer
Dim big As Integer
Dim removeindex As Integer
Private Sub Command1_Click()


firstarray(index) = Text1.Text
listarray = firstarray(index)
index = index + 1
secondarray(index) = listarray
secondarrayindex = secondarrayindex + 1
arraycount = secondarray(index)
secondarray(index) = removeindex

If arraycount > big Then
big = arraycount
End If

List1.AddItem big

End Sub

Private Sub Form_Load()
index = 0

End Sub