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.


table addRow problem


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-2008, 03:15 PM
Newbie
 
Join Date: May 2007
Posts: 7
Default table addRow problem

please help
I have a table whith 4 colums, the first is sting the other numbers
Code:

Sub Button4_Click
Form1.Show
table1.AddCol(cString,"Item",85)
table1.AddCol(cNumber,"Quant.",40)
table1.AddCol(cNumber,"P.Unit.",50)
table1.AddCol(cNumber,"P.Parc.",50)
End Sub

Sub btnGravar_Click
Nome=tbNome.text ' item
Quantidade=tbQuantidade.Text 'Quant.
PrecoUnidade=tbPrecoUnidade.Text 'P.Unit.
precoParcial=tbQuantidade.Text*tbPrecoUnidade.Text 'P.Parc.
table1.AddRow(Nome,Quantidade,PrecoUnidade,precoPa rcial)
End Sub

it works fine on Run mode in IDE, but dont work compiled to Pc or to PPC
error:
An error ocurred on sub_btngravar_click
Input string was not in correct format
Reply With Quote
  #2 (permalink)  
Old 05-16-2008, 03:29 PM
Junior Member
 
Join Date: Apr 2008
Location: Germany - Hessen
Posts: 23
Send a message via ICQ to Rallig
Default

Perhaps it is not the solution of this problem but I see a space in:

table1.AddRow(Nome,Quantidade,PrecoUnidade,precoPa rcial)


Greeting
Rallig
Reply With Quote
  #3 (permalink)  
Old 05-16-2008, 03:54 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,346
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

I can't see anything wrong with the code (apart from the extra space) but that error is what you will get if any of the textboxes that are to be assigned to numeric table columns contain values that do not represent a valid number.
Reply With Quote
  #4 (permalink)  
Old 05-16-2008, 03:55 PM
Newbie
 
Join Date: May 2007
Posts: 7
Default

hi!!
the space is a copy paste error

correction:
Sub Button4_Click
Form1.Show
table1.AddCol(cString,"Item",85)
table1.AddCol(cNumber,"Quant.",40)
table1.AddCol(cNumber,"P.Unit.",50)
table1.AddCol(cNumber,"P.Parc.",50)
End Sub

Sub btnGravar_Click
Nome=tbNome.text ' item
Quantidade=tbQuantidade.Text 'Quant.
PrecoUnidade=tbPrecoUnidade.Text 'P.Unit.
precoParcial=tbQuantidade.Text*tbPrecoUnidade.Text 'P.Parc.
table1.AddRow(Nome,Quantidade,PrecoUnidade,precoPa rcial)
End Sub
Reply With Quote
  #5 (permalink)  
Old 05-16-2008, 03:57 PM
Newbie
 
Join Date: May 2007
Posts: 7
Default

((
i corected the text, but the space apears again
???

table1.AddRow(Nome,Quantidade,PrecoUnidade,precoPa rcial)
Reply With Quote
  #6 (permalink)  
Old 05-16-2008, 04:06 PM
Newbie
 
Join Date: May 2007
Posts: 7
Default

space again

?????

table1.AddRow(Nome,Quantidade,PrecoUnidade,precoPa rcial)



i insert in the text box data in correct format
Reply With Quote
  #7 (permalink)  
Old 05-16-2008, 04:15 PM
Newbie
 
Join Date: May 2007
Posts: 7
Default

in IDE there is no space in "precoParcial"
Reply With Quote
  #8 (permalink)  
Old 05-17-2008, 05:25 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,820
Default

Can you upload your source code file?
Reply With Quote
  #9 (permalink)  
Old 05-19-2008, 11:33 AM
Newbie
 
Join Date: May 2007
Posts: 7
Default

Hi Erel...

the code file you requested
Attached Files
File Type: zip Lista_compras.zip (7.6 KB, 5 views)
Reply With Quote
  #10 (permalink)  
Old 05-19-2008, 01:20 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,346
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

The problem is with "lblTotal.Text". It is blank by default which the optimising compiler cannot convert to a number and so errors. Set the text to "0" and it works.

You didn't show this line in your code snippet "precototal=lblTotal.Text+precoParcial"
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
Addrow like removerow(index) Vito Questions & Help Needed 3 02-04-2008 01:09 PM
AddCol to Table problem ? HARRY Questions & Help Needed 2 01-14-2008 06:44 PM


All times are GMT. The time now is 02:53 PM.


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