simple example

asu asu at ritm.msk.ru
Wed Jan 26 10:56:56 CET 2005


  I have written the text:

functor
import
   Application(exit)
   Open(file)
define
StdIn = {New Open.file init(name:stdin)}
StdOut = {New Open.file init(name:stdout)}

{StdOut write(vs:"Enter your name\n")}
Name = {StdIn read(list:$)}

{StdOut write(vs:"hello "#Name)}

{StdOut close}
{StdIn close}
{Application.exit 0}
end

Correctly?


Run program:
Windows MessageBox - "Enter your name" (and button OK)   :-?
Click the button.
Windows MessageBox - "hello"
End programm... :-/
(OS: Windows 2000 Pro)


Bruno Carton wrote:

> There is no such primitive in Oz. You can do the job by using 
> Open.file primitives for writing and reading to/from Standard 
> Output/Input.
> Here is a simple example :
>
> declare
> StdIn = {New Open.file init(name:stdin)}
> StdOut = {New Open.file init(name:stdout)}
>
> {StdOut write(vs:"Enter your name\n")}
> Name = {StdIn read(list:$)}
>
> {StdOut write(vs:"hello "#Name)}
>
> {StdOut close}
> {StdIn close}
>
>
> Bruno
>




More information about the mozart-users mailing list