Page 1 of 1

Reading integer from keyboard

Posted: 2 Jan 2015 2:41
by PYB
I there,

How do I read an integer from the keyboard ?

I want to replace N = 4, by something like N = toInteger(stdio::readLine()),

but I get TaskWindow\TaskWindow.pro(40,14) error c229: Undeclared identifier 'toInteger/1->'

with N = math::toInteger(stdio::readLine()),

I get

Code: Select all

Exception: noStream (com/visual-prolog/stream/stream_exception)    The predicate has no stream assigned    Predicate name = stdio::readLine
I want in the onShow( ) clause of a window to read an integer from the keyboard if possible and show it with stdio::write(N). I can dsiplay data with stdio::write(N) in the windows drawing area no problem. It must not be in the onShow( ) clause I can add a menu item and call some code instead.

Thank you, bye.

Posted: 2 Jan 2015 12:18
by Thomas Linder Puls
A GUI program does not have an input stream. A GUI program uses menu, dialogs, forms, editors and the like to interact with the user. See the tutorial Fundamental Visual Prolog - GUI.