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.


ERROR:Message


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-16-2008, 11:15 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 60
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-17-2008 at 12:30 AM. Reason: Wrong Code
Reply With Quote
  #2 (permalink)  
Old 07-17-2008, 06:41 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

Are you sure that the value of both textboxes is numeric?
Reply With Quote
  #3 (permalink)  
Old 07-20-2008, 10:09 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 60
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
Attached Files
File Type: sbp 5newnew.sbp (37.3 KB, 5 views)

Last edited by cdeane : 07-20-2008 at 10:26 PM.
Reply With Quote
  #4 (permalink)  
Old 07-21-2008, 05:50 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

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

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

newconfigzip.zip
Reply With Quote
  #6 (permalink)  
Old 07-21-2008, 05:33 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,755
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
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, 06:01 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
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, 06:09 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 60
Default

I see.
Tanks to all
Reply With Quote
  #9 (permalink)  
Old 07-21-2008, 07:33 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 60
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 07:41 PM.
Reply With Quote
  #10 (permalink)  
Old 07-21-2008, 07:48 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,755
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with error message skmobile Questions & Help Needed 2 09-07-2008 08:07 PM
HTTP POST error message miataman Questions & Help Needed 10 07-11-2008 11:28 AM
Key in dictionary error message rossj Questions & Help Needed 2 03-07-2008 12:22 PM
Error Message PepSoft Questions & Help Needed 2 11-19-2007 02:59 PM
Tutorial - Error Message? ArchiMark Questions & Help Needed 5 09-18-2007 07:25 PM


All times are GMT. The time now is 01:28 PM.


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