# User's input

**URL:** <https://discourse.julialang.org/t/users-input/31825>\
**Category:** General Usage\
**Tags:** repl, io\
**Created:** [December 3, 2019, 10:12pm UTC](https://discourse.julialang.org/t/users-input/31825 "2019-12-03T22:12:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebasile](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ebasile/32/9023_2.png) [@ebasile](https://discourse.julialang.org/u/ebasile)\
**Post date:** [December 3, 2019, 10:12pm UTC](https://discourse.julialang.org/t/users-input/31825/1 "2019-12-03T22:12:09Z")

</div>

Hi, I’m trying to generate a user’s input, so i wrote the nexts code lines:

function input(prompt)  
print(prompt)  
readline()  
end  
user\_value = parse(Float64, input(“Age:”))

#Here end the user’s input and continue the program  
set\_value(pubinv, user\_value)

But arise a problem, when I run the code lines “readline” keep going with next code lines. The error that throw is:

julia\> function input(prompt)  
print(prompt)  
readline()  
end  
input (generic function with 2 methods)

julia\> user\_value = parse(Float64, input(“Age:”))  
Age:4  
ERROR: ArgumentError: cannot parse “set\_value(pubinv, user\_value)4” as Float64  
Stacktrace:  
[1] \_parse\_failure(::Type, ::String, ::Int64, ::Int64) at .\parse.jl:372 (repeats 2 times)  
[2] #tryparse\_internal#351 at .\parse.jl:368 [inlined]  
[3] tryparse\_internal at .\parse.jl:366 [inlined]  
[4] #parse#352 at .\parse.jl:378 [inlined]  
[5] parse(::Type{Float64}, ::String) at .\parse.jl:378  
[6] top-level scope at REPL[83]:1

Someone can help me?

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [December 3, 2019, 10:29pm UTC](https://discourse.julialang.org/t/users-input/31825/2 "2019-12-03T22:29:12Z")

</div>

Hello, If you haven’t already, please read this post: [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) and follow it’s advice to make it easier for us to help you.

---

<div class="post-metadata">

**Author:** ![venuur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/venuur/32/6493_2.png) [@venuur](https://discourse.julialang.org/u/venuur)\
**Post date:** [December 3, 2019, 10:33pm UTC](https://discourse.julialang.org/t/users-input/31825/3 "2019-12-03T22:33:52Z")

</div>

> [@ebasile](#):
>
> ```julia
> ERROR: ArgumentError: cannot parse “set_value(pubinv, user_value)4” as Float64
> 
> ```

It looks like somehow you typed in more than just 4 into the prompt. Can you show exactly what you types in response to `readline` In Julia?

---

<div class="post-metadata">

**Author:** ![ebasile](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ebasile/32/9023_2.png) [@ebasile](https://discourse.julialang.org/u/ebasile)\
**Post date:** [December 3, 2019, 11:21pm UTC](https://discourse.julialang.org/t/users-input/31825/4 "2019-12-03T23:21:21Z")

</div>

This is that Julia makes when I response 4 (as input) and continues the next code line.  
When I run for blocks no have a problem.

 ![20191203_200953](https://global.discourse-cdn.com/julialang/original/3X/c/f/cf1cfce78f0c11d4d9be57076266a672a7a12ec9.gif)

---

<div class="post-metadata">

**Author:** ![venuur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/venuur/32/6493_2.png) [@venuur](https://discourse.julialang.org/u/venuur)\
**Post date:** [December 4, 2019, 12:24am UTC](https://discourse.julialang.org/t/users-input/31825/5 "2019-12-04T00:24:07Z")

</div>

Thanks for the detailed illustration!

In the first one there is some strange indentation that makes me think your terminal is outputting some unusual whitespace. How are you running Julia? Are you on Windows, Mac, Linux?

I ask because I’ve had in the past some trouble (not with Julia) of direct input being different from copy and paste.

---

<div class="post-metadata">

**Author:** ![ebasile](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ebasile/32/9023_2.png) [@ebasile](https://discourse.julialang.org/u/ebasile)\
**Post date:** [December 4, 2019, 1:22am UTC](https://discourse.julialang.org/t/users-input/31825/6 "2019-12-04T01:22:11Z")

</div>

Is true it makes a strange indetation, but I believe it’s not a the problem because I run same codes lines on Visual Studio Code and arise same problem.  
I’m on Windows and running Julia from copy and paste.
