New topic: 

For ... Next Loop Question

<http://forums.realsoftware.com/viewtopic.php?t=30616>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       rbasic20091005153           Post subject: For ... Next Loop 
QuestionPosted: Fri Oct 23, 2009 12:39 am                               
Joined: Sat Apr 04, 2009 5:10 pm
Posts: 355              Hola,

I have a Listbox with several columns.  This listbox shows information on movie 
tracks.  

Quote:Column 2: Folderitem.DisplayName
Column 5: Folderitem.AbsolutePath

Every time the user imports a movie file, a new row or new rows will be 
inserted.  If a movie clip contains two tracks, two rows will be inserted at a 
time.  And they share the same Folderitem.AbsolutePath.

Column 6 is blank.  And I want to fill it with numbers.  If tracks come from 
the same movie, then they have to have the same number, starting with 0.  It 
appears that it's just the matter of filling blank fields on Column 6 with the 
same number.  And I have the following code.

Code:Dim k As Integer
For k=0 to Listbox1.ListCount-1
  If Listbox1.Cell(k,6)="" Then
  Listbox1.Cell(k,6)="0"
  Elseif Listbox1.Cell(k,6)="0" Then
  Listbox1.Cell(k,6)="1"
  Elseif Listbox1.Cell(k,6)="1" Then
  Listbox1.Cell(k,6)="2"
  Elseif Listbox1.Cell(k,6)="2" Then
  Listbox1.Cell(k,6)="3"
  Elseif Listbox1.Cell(k,6)="3" Then
  Listbox1.Cell(k,6)="4"
  ...
  End if
Next k

This code is not terribly bad except that fields on Column 6 will be updated 
with numbers in a descending order every time a new file is imported like

Quote:3
3
2
1

  I want to have numbers in an ascending order.  What am I doing wrong?

Thank you for your advice.

Tom     
_________________
Mac OS X 10.5.6/REALBasic 2008 R5.1
I say 'no' to MBS plug-ins.  I boycott them.  
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to