Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


I'm starting to distill myself...


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-14-2007, 01:43 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,314
Default I'm starting to distill myself...

this is driving me KKRRAZY!!!

I have started a new game project, in wich to keep control of things, I am defining the row/col count of a table control, according to user difficulty selection....

I start by using a for...next cycle to delete the existing rows/cols of the table and then add row/col according to user selection...so far so good, well not so...If there is no rows or cols in the table before user selection (i.e: when he app is first started) it works fine, but if there is already a number of rows/cols I keep getting an "index canot be negative" sort of error...

I added msgboxs to each of my for next loops and it seems ok....
Im first deleting rows and then collumns, shoul I invert?
Both counts start from "0" Right?
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #2 (permalink)  
Old 09-14-2007, 02:00 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 638
Default

Hi Cableguy,

Quote:
Originally Posted by Cableguy View Post
Both counts start from "0" Right?
Yes, you're right!

To solve your problem, I think some posted code would be nice because your description sounds good so we might take a look at your current solution to find out the problem...


specci48
Reply With Quote
  #3 (permalink)  
Old 09-14-2007, 02:06 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

I'll give my guess.
You're using a For loop to delete the rows:
For i = 0 to Table1.RowCount
'Remove row i
Next

That is a wrong solution! As you are removing each row, row #i becomes row #i-1...
You should do something like:
For i = 0 To Table1.RowCount
'Remove Row 0
Next

BTW, why don't you use Table1.Clear?
Reply With Quote
  #4 (permalink)  
Old 09-14-2007, 04:45 PM
Junior Member
 
Join Date: May 2007
Posts: 17
Post delete col and rows

you can go in the reverse order of the for next
deleting the last one all the way down....
Reply With Quote
  #5 (permalink)  
Old 09-14-2007, 06:11 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,314
Default

Quote:
Originally Posted by Erel View Post
I'll give my guess.
BTW, why don't you use Table1.Clear?
Right to the point as usual, Erel.

That was exactly what I was trying...

Quote:
Originally Posted by moharj View Post
you can go in the reverse order of the for next
deleting the last one all the way down....
I also tried that aproach and it error even more often....

The clear property has some how iluded me as I started exactly by seaching for that aproach instead of "manually" delete the rows/cols...

And they say I'm an Expert, yah, right...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoid starting a program after a given time Arrie Questions & Help Needed 2 05-31-2008 10:06 AM
Starting question Gale Johnson Bug Reports 2 07-30-2007 10:32 PM


All times are GMT. The time now is 06:11 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0