Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

ERROR:Message

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-16-2008, 10:15 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default ERROR:Message

I get:
(Input string was not in the correct format)
In optimized compilation


When I use:
Code:
Sub InitializeConfigLine
 
If TextBoxGusset.Text <0 Then
 TextBoxLayflat2.Text=TextBoxWidth.Text
LabelYeild2.BringToFront
TextBoxYeild.BringToFront 
ImageButtonConfig.Text=TextBoxWidth.Text &
"x"& TextBoxMillage.Text
Panel20.BringToFront
Else If TextBoxLayflat2.Text=TextBoxWidth.Text+TextBoxGusset.Text
 TextBoxNip.Text=Table2.Cell(
"nip",0)/2
 TextBoxCenter.Text=TextBoxWidth.Text-TextBoxGusset.Text
 TextBoxNipToCenter.Text=TextBoxNip.Text-TextBoxCenter.Text/
2
 TextBoxLeftGusset.Text=TextBoxGusset.Text/
2
 TextBoxRightGusset.Text=TextBoxGusset.Text/
2
 ImageButtonGussetConfig.Text=TextBoxLeftGusset.Text &
"  /  "& TextBoxCenter.Text &"  /  "& TextBoxRightGusset.Text
 ImageButtonCenterToNip.Text=
"->  "& TextBoxNipToCenter.Text &"  <-"
 Panel2Back.BringToFront
 Panel19.BringToFront
  LabelLayflat2.BringToFront
TextBoxLayflat2.BringToFront
ImageButtonConfig.Text=TextBoxWidth.Text &
"x"& TextBoxGusset.Text &"x"& TextBoxMillage.Text
PanelLowerFormCoverGusset.BringToFront
 
End If
 
 TextBoxYeild.Text=TextBoxLayflat2.Text*TextBoxMillage.Text*TextBoxDensity.Text
 TextBoxSS2.Text=TextBoxPPH.Text*Table2.Cell(
"sp",0)/Table2.Cell("pph",0)
 TextBox1.Text=TextBoxLayflat2.Text*
.637/Table2.Cell("dia",0)
 TextBox2.Text=TextBoxLayflat2.Text/Table2.Cell(
"top",0)
 TextBox3.Text=TextBoxLayflat2.Text/Table2.Cell(
"bot",0)
 TextBoxLS2.Text=TextBoxPPH.Text/TextBoxYeild.Text/
.06
 ImageButtonLine.Text=
"Line " & Table2.Cell("lin",0)
 Form2.Show
In line (TextBoxLayflat2.Text=TextBoxWidth.Text+TextBoxGus set.Text)

Last edited by cdeane : 07-16-2008 at 11:30 PM. Reason: Wrong Code
Reply With Quote
  #2 (permalink)  
Old 07-17-2008, 05:41 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Are you sure that the value of both textboxes is numeric?
Reply With Quote
  #3 (permalink)  
Old 07-20-2008, 09:09 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

Sorry for the long delay,I had to work all this weekend.
I will attempt to add an attachment here so you can see the full affect of my application.

It runs OK in normal compilation but not in optimized compilation.In fact I could say the same for it the other way around in other aspects of the program.

When running the program you will need to know this:
1.Enter Film Spec.
Ex.(Flat)
Layflat(50)
Millage(.002)
PPH(500)

2.Select a Density.
Any will do.

3.Select a line.
1 Thru 5 will do.



5newnew.zip

Last edited by cdeane : 07-20-2008 at 09:26 PM.
Reply With Quote
  #4 (permalink)  
Old 07-21-2008, 04:50 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should include all the image files as well.
Reply With Quote
  #5 (permalink)  
Old 07-21-2008, 04:12 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

Of coarse.I Get to wrapped up in what I'm doing I forget the details.

Attachment 1923
Reply With Quote
  #6 (permalink)  
Old 07-21-2008, 04:33 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

You need to ensure that all textboxes whose contents are treated as numbers need to be initialised to a valid number (probably 0) if you are optimised compiling. Whilst an empty string is treated as zero in the IDE/legacy compiler it does not convert to zero when optiised compiled and causes an error.
Reply With Quote
  #7 (permalink)  
Old 07-21-2008, 05:01 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

I've found two problems:
1. You should not write statements directly after an Else keyword(in multiline If clause).
Instead of:
Code:
       
 
If TextBoxPPH.Text=<0 Then
   
Msgbox("Must Enter PPH","ERROR:PPH",cMsgBoxOK,cMsgBoxHand)
TextBoxPPH.Color=
0,255,255
TextBoxPPH.Focus
 
Else  TextBoxPPH.Color=cWhite
You should write:
Code:
       
 
If TextBoxPPH.Text=<0 Then
   
Msgbox("Must Enter PPH","ERROR:PPH",cMsgBoxOK,cMsgBoxHand)
TextBoxPPH.Color=
0,255,255
TextBoxPPH.Focus
 
Else  
 TextBoxPPH.Color=cWhite
2. As agraham wrote you should initialize the textbox to 0 or change the condition from:
Code:
Sub InitializeConfigLine
If  TextBoxGusset.Text >0 Then
to
Code:
Sub InitializeConfigLine
If TextBoxGusset.Text <> "" AND  TextBoxGusset.Text >0 Then
Reply With Quote
  #8 (permalink)  
Old 07-21-2008, 05:09 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

I see.
Tanks to all
Reply With Quote
  #9 (permalink)  
Old 07-21-2008, 06:33 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

Sorry for the BUMP but how is it I can enter a 0 in a textbox at design time but it not show in that textbox in run time?


Code:
Sub InitializeConfigLine
If TextBoxGusset.Text <> "" AND  TextBoxGusset.Text >0 Then
Im not to familiar with the AND keyword.

Last edited by cdeane : 07-21-2008 at 06:41 PM.
Reply With Quote
  #10 (permalink)  
Old 07-21-2008, 06:48 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by cdeane View Post
Sorry for the BUMP but how is it I can enter a 0 in a textbox at design time but it not show in that textbox in run time?
You can't! But why would you want to? For a numeric only testbox an entry of "0" is a perfectly good default value. You will always get an error if you treat as a number a texstbox entry that cannot be parsed as a number. For safety you should probably check textbox contents before use e.g.
Code:
If isNumber(TextBox1.Text) = true Then
  
Msgbox (TextBox1.Text * 20)
Else
  ...
End If
Hlep -> Main Help -> Keywords -> String -> IsNumber


If TextBoxGusset.Text <> "" AND TextBoxGusset.Text >0 Then
' True if textbox does not contain "" and also contains a number greater than 0. i.e not null and greater than 0.
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with error message skmobile Questions (Windows Mobile) 2 09-07-2008 07:07 PM
HTTP POST error message miataman Questions (Windows Mobile) 10 07-11-2008 10:28 AM
Key in dictionary error message rossj Questions (Windows Mobile) 2 03-07-2008 11:22 AM
Error Message PepSoft Questions (Windows Mobile) 2 11-19-2007 01:59 PM
Tutorial - Error Message? ArchiMark Questions (Windows Mobile) 5 09-18-2007 06:25 PM


All times are GMT. The time now is 10:05 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0