|
-
Apr 28th, 2003, 07:04 AM
#1
Thread Starter
PowerPoster
[Resolved]Reorganising Arrays...
Well, I need to reorganise my arrays by being able to insert data in at the start, and push everything down which I have done with the following code,
VB Code:
Public RndTracker(19) As String
Public TempArray(19) As String
'---
IntCurrindex = tempint 'temp int is a random integer
For i = 0 To UBound(RndTracker)
If i = 0 Then
Temparray(0) = IntCurrindex
Temparray(1) = RndTracker(0)
ElseIf i > 0 Then
Temparray(i) = RndTracker(i - 1)
End If
Next i
'Copy back
For i = 0 To UBound(Temparray)
RndTracker(i) = Temparray(i)
Next i
The above code works well, but, I want to be able to go back through the array and reorganise it again.. which is where I've managed to get myself confused.
Basically I would need to remove the first item, and then replace it with the second item in the array, and I guess just make the last item in the array zero?
Should be an easy one for you guys (I hope), also just want to check that is the best way of doing it. 
Thanks in advance.
Last edited by Pc_Madness; Apr 29th, 2003 at 01:55 AM.
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
|