New topic: 

Add new row on last row

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

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        Rivo          Post subject: Add new row on last rowPosted: Tue 
Feb 26, 2013 10:29 pm                         
Joined: Tue Aug 29, 2006 4:04 am
Posts: 493
Location: Indonesia                Dim o as integer
For o=listbox1.listcount downto 0
  if o<listbox1.listcount then
  'Listbox1.Cell(o,2)=Listbox1.Cell(o,2)+"*"
  ListBox1.AddRow ""
  listBox1.cell(listBox1.lastindex,2)="Disc 10%"
  dim a,b as Double
  dim c,d as Double
  // harga x diskon , d=harga-(hrga x diskon
  a=CDbl(ListBox1.Cell(Listbox1.LastIndex, 6))
  b=10
  c=(a*b)/100*-1
  listBox1.cell(listBox1.lastindex,5)=format(c,"-###,##0")
  end if
next


I was trying to add a discount on a last row, but it print discount all item on 
last row.
What I need is every I click the button to add new row, it automatically add 
new row on last.

the result what I had now is,


Apple   10,000
orange   5,000
disc 10%  100
disc 10%  50

but what I'm expected is ,

Apple   10,000
disc 10%  100
orange   5,000
disc 10%  50

any helps..?

thanks

Regards,
Rivo   
                             Top                npalardy          Post subject: 
Re: Add new row on last rowPosted: Tue Feb 26, 2013 10:46 pm                    
   Real Software Engineer          
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7738
Location: Canada, Alberta, Near Red Deer                Rivo wrote:Dim o as 
integer
For o=listbox1.listcount downto 0
  if o<listbox1.listcount then
  'Listbox1.Cell(o,2)=Listbox1.Cell(o,2)+"*"
  ListBox1.AddRow ""
  listBox1.cell(listBox1.lastindex,2)="Disc 10%"
  dim a,b as Double
  dim c,d as Double
  // harga x diskon , d=harga-(hrga x diskon
  a=CDbl(ListBox1.Cell(Listbox1.LastIndex, 6))
  b=10
  c=(a*b)/100*-1
  listBox1.cell(listBox1.lastindex,5)=format(c,"-###,##0")
  end if
next


I was trying to add a discount on a last row, but it print discount all item on 
last row.
What I need is every I click the button to add new row, it automatically add 
new row on last.

the result what I had now is,


Apple   10,000
orange   5,000
disc 10%  100
disc 10%  50

but what I'm expected is ,

Apple   10,000
disc 10%  100
orange   5,000
disc 10%  50

any helps..?

thanks

Regards,
Rivo

Dont "add row" as that just adds to the end of the list
You probably need to "insert" rows      
_________________
Norman Palardy (Real Software)
––––––––––––––––––––––––––––––––––––––––––––––––––
Real Studio Developer Conference - April 23 - 26, 2013
http://www.realsoftware.com/community/realworld.php  
                             Top                Rivo          Post subject: Re: 
Add new row on last rowPosted: Tue Feb 26, 2013 11:14 pm                        
 
Joined: Tue Aug 29, 2006 4:04 am
Posts: 493
Location: Indonesia                thanks..
its solved 


regards,
Rivo   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 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