cx
cx copied to clipboard
`read()` is not working.
Describe the bug
If you use read()
to ask for user input and try to print the result, an empty string is printed.
To Reproduce Steps to reproduce the behavior:
- Write this code to
test.cx
:
package main
func main() {
str.print(read())
}
- Run the program with
cx test.cx
- Write an arbitrary string to be
read
by CX. - An empty string is printed.
Expected behavior Print the string that was captured by the user to standard output.
Desktop (please complete the following information):
- OS: [e.g. Linux, Windows]
- Browser (if related to cx.skycoin.net) [e.g. Chrome, Safari]
- CX Version 0.7.1
read-string.cx from examples doesn't run correctly.
read() allows user input, but unable to initialize variable with it like in following case:
var name str
str.print("What's your name?")
name = read()
printf("Hello, %s!\n", name)
This fails to print name, because name has no value after read().
Operating system: Windows Version of CX: 0.8.0