New topic: 

list numbering

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

         Page 1 of 1
   [ 5 posts ]                 Previous topic | Next topic          Author  
Message        Rivo          Post subject: list numberingPosted: Wed May 22, 
2013 5:23 am                         
Joined: Tue Aug 29, 2006 4:04 am
Posts: 512
Location: Indonesia                Hi,
I want to put number on listbox based from listbox.listcount

dim i as integer
dim b as double
b=0
for i=0 to listBox1.listcount-1
  Listbox1.cell(i,0)=b+1
next


I dont know why its not working.
Any Helps.?


Thanks

Regards,
Rivo   
                             Top                pixe656          Post subject: 
Re: list numberingPosted: Wed May 22, 2013 5:31 am                         
Joined: Wed May 20, 2009 11:02 am
Posts: 423                What's the error you are getting?

Does the listbox have the rows you are trying to populate (you need to "addrow" 
first).

Pixe      
_________________
Using RS2011r4.3 on Windows7.  
                             Top                JeremK          Post subject: 
Re: list numberingPosted: Wed May 22, 2013 6:31 am                         
Joined: Thu Apr 10, 2008 6:03 am
Posts: 292
Location: Paris-La Défense, France                Hello,

Seeing your code, as you do not increment the "b" variable you should get a "1" 
on each row.

You could use the following code:

dim i as integer

for i=0 to listBox1.listcount-1
  Listbox1.cell(i,0)=i+1
next
      
_________________
Check my Website for high quality custom controls and classes (no plugins) for 
Windows, Mac OS and Linux 
REALBasic 2012 R2 on Win 7 & Mac OS X  
                             Top                DaveS          Post subject: 
Re: list numberingPosted: Wed May 22, 2013 8:11 am                              
   
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4899
Location: San Diego, CA                dim i as integer

for i=0 to listBox1.listcount-1
  Listbox1.cell(i,0)=STR(i+1)
next
      
_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                JeremK          Post subject: 
Re: list numberingPosted: Wed May 22, 2013 8:35 am                         
Joined: Thu Apr 10, 2008 6:03 am
Posts: 292
Location: Paris-La Défense, France                Thanks for the correction 
DaveS     
_________________
Check my Website for high quality custom controls and classes (no plugins) for 
Windows, Mac OS and Linux 
REALBasic 2012 R2 on Win 7 & Mac OS X  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 5 posts ]      
-- 
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