Normal Topic If-Then programing -Need Help (Read 1770 times)
dcostanzo
Junior Member
Members
**
Offline


No personal text

Posts: 58
Joined: Mar 13th, 2003
If-Then programing -Need Help
Dec 30th, 2003 at 5:51pm
Print Post Print Post  
Ok I read the section on pp 27 If-Then programing.
Trucker is a text and Trans_Price_Ton is a Money number

In Program Editor

IF Trucker = "{Own}" THEN TRANS_PRICE_TON = @ToNumber("0")

Errors:
Error while parsing module "Trans_Price_Ton (0)":
Statement or End-Of-File expected.
Line 1, position 1: [Identifier: IfLENID000035]
IFlenid000035 = "{OWN}"  THEN Trans_Price_Ton  =@ToNumber ("0")
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: If-Then programing -Need Help
Reply #1 - Dec 30th, 2003 at 6:36pm
Print Post Print Post  
Quote:
Ok I read the section on pp 27 If-Then programing.
Trucker is a text and Trans_Price_Ton is a Money number

In Program Editor

IF Trucker = "{Own}" THEN TRANS_PRICE_TON = @ToNumber("0")

Errors:
Error while parsing module "Trans_Price_Ton (0)":
Statement or End-Of-File expected.
Line 1, position 1: [Identifier: IfLENID000035]
IFlenid000035 = "{OWN}"  THEN Trans_Price_Ton  =@ToNumber ("0")


1. If you are assigning a number to a numeric element, you don't have to use @ToNumber. Trans_Price_Ton = 0 will do just fine.

2. Something doesn't look right here. For starters, make sure that you have a space between If and Trucker.

3. It also looks like Trucker is getting renamed as if it contains a space. Confirm that your element is actually named Trucker.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
dcostanzo
Junior Member
Members
**
Offline


No personal text

Posts: 58
Joined: Mar 13th, 2003
Re: If-Then programing -Need Help
Reply #2 - Dec 30th, 2003 at 6:59pm
Print Post Print Post  
Hi again,

Element: Trucker
If Trucker = "{Own}" Then Trans_Price_Ton = "0"

1.)removed @ToNumber
2.) checked spacing -ok
3.) Trucker is a Combo Box that I created.                    Does this make a difference? there are no spaces.

Also, Should I be programing the element Trucker or Trans_Price_ Ton.  I have been trying to program element Trucker.

Thanks for taking the time to help me understand this

Dave


  
Back to top
 
IP Logged
 
dcostanzo
Junior Member
Members
**
Offline


No personal text

Posts: 58
Joined: Mar 13th, 2003
Re: If-Then programing -Need Help
Reply #3 - Dec 30th, 2003 at 7:24pm
Print Post Print Post  
  I revisited the Identifer element Trucker. I removed the combo box. and just saved it as a "text box"

tried the programing again. Works great. No Errors
tested fine in application.

Q-  How do I get the combo box back without loosing the programing. Will be trying to get the combo box back that I created.

Getting there

Dave
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: If-Then programing -Need Help
Reply #4 - Dec 31st, 2003 at 4:28pm
Print Post Print Post  
I think I know what happened here. When you named your element "Trucker",
you actually named it " Trucker" (notice the leading space). We'll start stripping those off in the next release. BTW, if you had added that space in your programming, it would have worked just fine!

If  Trucker = "{Own}" ...
Note the two spaces between If and Trucker.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged