How can I add "ft" to a number?

• Question

• Hi -

I have written a program to get the size of an area.  One line is:

TextWindow.Write("Enter hor: ")       This asked me to enter one dimension of the area.  I want to add "ft" after the number to designate I'm measuring in feet.  Another line is:

TextWindow.WriteLine("The area is: " + Area + ".")        After the number is printed I want to add "sqft" to the number.     Can someone help?  I can submit the entire program if that would help.    Thanks     Bob

Wednesday, February 12, 2014 3:12 PM

• You have a " to much in the WriteLines:

"hor = "+hor+"  "ft"

------------^

You should have  text        "hor = "    +

variable      hor         +

text         "ft"

Jan [ WhTurner ] The Netherlands

• Marked as answer by Friday, February 14, 2014 1:12 PM
Friday, February 14, 2014 10:47 AM
• Jan -

Thanks for all your time.  I will now mark this as done.    Bob

• Marked as answer by Friday, February 14, 2014 1:12 PM
Friday, February 14, 2014 1:12 PM

All replies

• You can always add the sqft in the WriteLine("The area is: "+Area+". sqft"). Or do you want to adapt the output to the measuringunit of the input?

Jan [ WhTurner ] The Netherlands

Wednesday, February 12, 2014 3:57 PM
• Thanks for the reply.  What you suggested worked just fine when I used it with "Area".  However when I tried to put "ft" after     Window.Write("Enter hor.")

it put the "FT" first then put the value of hor. I hope I have made my meaning clear.

Thanks    Bob

Wednesday, February 12, 2014 10:18 PM
• Are you trying to put "ft" to the right of where the user will type? That could be done, but not very cleanly. A much easier solution would be:

`TextWindow.Write("Enter hor (ft): ")`

Wednesday, February 12, 2014 11:44 PM
• The method you can use to place ft behind the place to enter the amount:

```For i=1 To 9
back=back+Text.GetCharacter(8)    'backspace character
EndFor

TextWindow.Write("enter hor:         ft"+back)
TextWindow.WriteLine(x)```

Jan [ WhTurner ] The Netherlands

• Edited by Thursday, February 13, 2014 10:32 AM explanation char 8
Thursday, February 13, 2014 10:26 AM
• You can put the next lines before the label mid:

Textwindow.Clear()

Textwindow.WriteLine("Hor = "+hor+" ft")

Textwindow.WriteLine("Ver = "+ver+" ft")

I think you should also give an explanation why there are 5 answers.

Jan [ WhTurner ] The Netherlands

Thursday, February 13, 2014 6:13 PM
• Hi -

I put the lines in as I understood but I got errors.

TextWindow.Write("Enter hor:  ")
TextWindow.Write("Enter ver:  ")
TextWindow.Clear()
TextWindow.WriteLine("hor = "+hor+"  "ft")
TextWindow.WriteLine("ver = "+ver+"  "ft")
Mid:
Area = hor * ver
TextWindow.WriteLine("The area is:  "   +   Area  +  " sqft.")
If (hor < 10) Then
hor = hor + 2
Goto Mid
Endif

6.41 Encountered unexpected end of line parsing method call

7.41  repeated above

6.12 Operation 'TextWindow.WriteLine' is supplied 3 arguments, but takes only 1 argument.

7.21   repeated above

What did I do wrong?

Thursday, February 13, 2014 8:43 PM
• Hi -

The reason I got 5 answers:  The program finds the area of a rectangle when you change the size of one side.  In this case I am changing the hor side by 2 ft each time the program loops.   Thanks for your time.      Bob

Thursday, February 13, 2014 8:51 PM
• You have a " to much in the WriteLines:

"hor = "+hor+"  "ft"

------------^

You should have  text        "hor = "    +

variable      hor         +

text         "ft"

Jan [ WhTurner ] The Netherlands

• Marked as answer by Friday, February 14, 2014 1:12 PM
Friday, February 14, 2014 10:47 AM
• Jan -

Thanks for all your time.  I will now mark this as done.    Bob

• Marked as answer by Friday, February 14, 2014 1:12 PM
Friday, February 14, 2014 1:12 PM