Reading integer from keyboard

Discussions related to Visual Prolog
PYB
Posts: 12
Joined: 16 Nov 2012 1:50

Reading integer from keyboard

Unread post by PYB » 2 Jan 2015 2:41

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.

User avatar
Thomas Linder Puls
VIP Member
Posts: 1164
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 2 Jan 2015 12:18

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.
Regards Thomas Linder Puls
PDC

Post Reply