Re: Inputing numbers

2017-08-21 Thread jzakiya
Whoops, sorry, forgot to run the executable (probably should go to bed now) [jzakiya@jabari-pc nim]$ ./inputtest Enter integer number: 34422 You inputed 34422 with type BiggestUInt [jzakiya@jabari-pc nim]$ Made the same mistake on target program, but it works now too

Re: Inputing numbers

2017-08-21 Thread jzakiya
I'm am running Manjaro KDE (gcc 7.1.1, clang 4.0.1) in a VirtualBox VM using another Linux distros as VB host. When I run this file: inputtest.nim import strutils, typetraits stdout.write "Enter integer number: " let val = stdin.readline.parseBiggestUInt echo "You

Re: Inputing numbers

2017-08-21 Thread mashingan
How do you write your code? AFAIK, `readLine` is blocking. In my machine, below code is working fine. Using Windows 10 with GCC v 7.1.0 import strutils, typetraits stdout.write "Input integer number: " let number = stdin.readline.parseBiggestUInt echo "You inputed "

Re: Inputing numbers

2017-08-21 Thread jzakiya
These don't work. When the program displays Enter number value: it should stay there until I type a number and hit and then proceed. For both cases shown the program just falls through. [jzakiya@jabari-pc nim]$ ./myprogram Enter number value: Error: unha

Re: Inputing numbers

2017-08-21 Thread mashingan
Use `parseBiggestUInt` proc in [strutils](https://nim-lang.org/docs/strutils.html#parseBiggestUInt,string)? You can do like this: import strutils let theint = stdin.readline.parseBiggestUInt or import strutils var theint = -1'u64 try:

Inputing numbers

2017-08-21 Thread jzakiya
I want to input numbers into a program from the command line. $ ./myprogram Please iput number: The input number are unsigned 64-bit (uint64) I tried the following: let var = uint64(readling(stdin, input) But I apparently have to convert a string to