Copying Text Entry Field (textbox) Value Into a Variable
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 29
- Joined: Fri Jul 22, 2011 4:36 pm
Copying Text Entry Field (textbox) Value Into a Variable
Please help. I will be happy to try and clarify anything. The object it to use an aircraft's momentum to generate a required runway length for any kind of aircraft. Thank you.
I am getting this error...
button "btnProcess": compilation error at line 3 (Expression: bad factor), char 28
Line 3 is in red...
on mouseUp
// Read the value entered into textboxes into variables
put "MomentumFactorBox" value into MomentumFactor
put "BrakeFactorBox" value into BrakeFactor
put "GroundSpeedBox" value into GroundSpeed
put "WeightBox" value into Weight
put 0 into RollDistance
put GroundSpeed into GroundSpeedLoop
WeightBrakingFactor = (Weight * GroundSpeed) / MomentumFactor
repeat EnteredGroundSpeed for GroundSpeedLoop times
FeetPer100thSecond = (GroundSpeed * 6076.12) / 360000
RollDistance = RollDistance + FeetPer100thSecond
GroundSpeed = GroundSpeed - WeightBrakingFactor
if GroundSpeed > 0
continue
else
end repeat
endif
end repeat
put RollDistance into RunwayRequired
end mouseUp
I am getting this error...
button "btnProcess": compilation error at line 3 (Expression: bad factor), char 28
Line 3 is in red...
on mouseUp
// Read the value entered into textboxes into variables
put "MomentumFactorBox" value into MomentumFactor
put "BrakeFactorBox" value into BrakeFactor
put "GroundSpeedBox" value into GroundSpeed
put "WeightBox" value into Weight
put 0 into RollDistance
put GroundSpeed into GroundSpeedLoop
WeightBrakingFactor = (Weight * GroundSpeed) / MomentumFactor
repeat EnteredGroundSpeed for GroundSpeedLoop times
FeetPer100thSecond = (GroundSpeed * 6076.12) / 360000
RollDistance = RollDistance + FeetPer100thSecond
GroundSpeed = GroundSpeed - WeightBrakingFactor
if GroundSpeed > 0
continue
else
end repeat
endif
end repeat
put RollDistance into RunwayRequired
end mouseUp
Last edited by CodeTRUCKER on Mon Oct 14, 2013 10:46 pm, edited 2 times in total.
~ Calvin
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.

Re: Copying Text Entry Field (textbox) Value Into a Variable
Hi CodeTRUCKER,
Using your sig line as a hint
I guess it didn't fly.
Do you want a more concrete answer?
Simon
Using your sig line as a hint
I tried not to tell you the answer to your first question but to show you where to find it...<> Please do not give me the answer, but show me how to find it. FYI - I have searched diligently before asking.
I guess it didn't fly.
Do you want a more concrete answer?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 29
- Joined: Fri Jul 22, 2011 4:36 pm
Re: Copying Text Entry Field (textbox) Value Into a Variable
Sure. The tag line is mainly to communicate I *am* willing to do the work, but I guess everyone needs a quick-start every now and then. Go ahead and give me the answer this time and in my other thread. I need a boost. 

~ Calvin
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.

Re: Copying Text Entry Field (textbox) Value Into a Variable
Here you go.
You need to tell liveCode that MomentumFactorBox is a field. (at least I think it is)
How does that sound?
Simon
You need to tell liveCode that MomentumFactorBox is a field. (at least I think it is)
Code: Select all
put field "MomentumFactorBox" into MomentumFactor
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 29
- Joined: Fri Jul 22, 2011 4:36 pm
Re: Copying Text Entry Field (textbox) Value Into a Variable
The fog is beginning to clear... I think?
I'll try it and get back to you right away. Thanks!
I'll try it and get back to you right away. Thanks!
~ Calvin
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.

-
- Posts: 29
- Joined: Fri Jul 22, 2011 4:36 pm
Re: Copying Text Entry Field (textbox) Value Into a Variable
OK, got that and other like errors fixed and sorted out.
Now, how do I go about understanding what this error is telling me?
button "btnProcess": compilation error at line 9 (Expression: double binary operator) near "=", char 4
Line 9 in red...
on mouseUp
// Read the value entered into textboxes into variables
put field "MomentumFactorBox" into MomentumFactor
put field "BrakeFactorBox" into BrakeFactor
put field "GroundSpeedBox" into GroundSpeed
put field "WeightBox" into Weight
put 0 into RollDistance
put GroundSpeed into GroundSpeedLoop
WeightBrakingFactor = (Weight * GroundSpeed) / MomentumFactor
repeat EnteredGroundSpeed for GroundSpeedLoop times
FeetPer100thSecond = (GroundSpeed * 6076.12) / 360000
RollDistance = RollDistance + FeetPer100thSecond
GroundSpeed = GroundSpeed - WeightBrakingFactor
if GroundSpeed > 0
continue
else
end repeat
endif
end repeat
put RollDistance into RunwayRequired
end mouseUp
Now, how do I go about understanding what this error is telling me?
button "btnProcess": compilation error at line 9 (Expression: double binary operator) near "=", char 4
Line 9 in red...
on mouseUp
// Read the value entered into textboxes into variables
put field "MomentumFactorBox" into MomentumFactor
put field "BrakeFactorBox" into BrakeFactor
put field "GroundSpeedBox" into GroundSpeed
put field "WeightBox" into Weight
put 0 into RollDistance
put GroundSpeed into GroundSpeedLoop
WeightBrakingFactor = (Weight * GroundSpeed) / MomentumFactor
repeat EnteredGroundSpeed for GroundSpeedLoop times
FeetPer100thSecond = (GroundSpeed * 6076.12) / 360000
RollDistance = RollDistance + FeetPer100thSecond
GroundSpeed = GroundSpeed - WeightBrakingFactor
if GroundSpeed > 0
continue
else
end repeat
endif
end repeat
put RollDistance into RunwayRequired
end mouseUp
~ Calvin
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.

Re: Copying Text Entry Field (textbox) Value Into a Variable
OK I'm going to make you work for this one because I think you know it from the previous stuff.
put something into something
Simon
put something into something
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Copying Text Entry Field (textbox) Value Into a Variable
Hi.
You are in good hands with Simon, but since he has not replied in over ten seconds...
You must have programmed in other languages, since the construct:
WeightBrakingFactor = (Weight * GroundSpeed) / MomentumFactor
is common to some of those. But in LC you must rewrite as:
put (Weight * GroundSpeed) / MomentumFactor into WeightBrakingFactor
Simon should be showing up any second.
Craig Newman
You are in good hands with Simon, but since he has not replied in over ten seconds...
You must have programmed in other languages, since the construct:
WeightBrakingFactor = (Weight * GroundSpeed) / MomentumFactor
is common to some of those. But in LC you must rewrite as:
put (Weight * GroundSpeed) / MomentumFactor into WeightBrakingFactor
Simon should be showing up any second.
Craig Newman
Re: Copying Text Entry Field (textbox) Value Into a Variable
HA
Simon



Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 29
- Joined: Fri Jul 22, 2011 4:36 pm
Re: Copying Text Entry Field (textbox) Value Into a Variable
Another error bites the dust! ... however, there are more, but I am learning.
You are correct, Craig, about previous experience. I have a degree in Computer Science and several years professional experience. BUT! That was a long time ago. The good news is I love coding and hope to make a jingle in my pocket with some unique apps. Time will tell?
Meanwhile, back at the ranch...
You are correct, Craig, about previous experience. I have a degree in Computer Science and several years professional experience. BUT! That was a long time ago. The good news is I love coding and hope to make a jingle in my pocket with some unique apps. Time will tell?
Meanwhile, back at the ranch...
~ Calvin
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.

Re: Copying Text Entry Field (textbox) Value Into a Variable
Hey, Simon.
I feel bad about giving up too much to this guy. I see you are taking him to task, and I am being too helpful. Sorry, really.
Craig
I feel bad about giving up too much to this guy. I see you are taking him to task, and I am being too helpful. Sorry, really.
Craig
Re: Copying Text Entry Field (textbox) Value Into a Variable
Hi Craig,
No problem, I was actually trying to copy your technique
Simon
No problem, I was actually trying to copy your technique

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 29
- Joined: Fri Jul 22, 2011 4:36 pm
Re: Copying Text Entry Field (textbox) Value Into a Variable
Hi Craig,dunbarx wrote:Hey, Simon.
I feel bad about giving up too much to this guy. I see you are taking him to task, and I am being too helpful. Sorry, really.
Craig
No worries. I like to try and tackle coding bugs myself, but I appreciate help when I am lost, like I am here. Thanks for the help!
~ Calvin
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.

-
- Posts: 29
- Joined: Fri Jul 22, 2011 4:36 pm
Re: Copying Text Entry Field (textbox) Value Into a Variable
I can see I am going to have to unwrap all the BASIC, COBOL, CICS, Visual Basic and some C++ from around my brain, especially when it comes to formulas. LiveCode is definitely new territory!
The good news is what I have learned I like. It's just gonna take a while to get it all down. It will come.
So, what about the learningtounderstandwhatcrypticerrormessagesmean question?
The good news is what I have learned I like. It's just gonna take a while to get it all down. It will come.

So, what about the learningtounderstandwhatcrypticerrormessagesmean question?
~ Calvin
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.

-
- Posts: 29
- Joined: Fri Jul 22, 2011 4:36 pm
Re: Copying Text Entry Field (textbox) Value Into a Variable
Hey Guys!
This just popped up on my screen...
compiling at 5:50:17 PM
Type Expression: double binary operator
Object btnProcess
Line FeetPer100thSecond = (GroundSpeed * 6076.12) / 360000
Hint =
Did you do that?
This just popped up on my screen...
compiling at 5:50:17 PM
Type Expression: double binary operator
Object btnProcess
Line FeetPer100thSecond = (GroundSpeed * 6076.12) / 360000
Hint =
Did you do that?

~ Calvin
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
<> Please help me find the answer myself, if I can. I have searched diligently before asking.
<> Please allow my wording the benefit of the doubt and I'm not ignoring you, I forgot what we were doing.
