Computer Science Canada

Problem with Window.Close

Author:  livingheaven [ Sat Mar 20, 2010 7:22 pm ]
Post subject:  Problem with Window.Close

What is the problem you are having?
<After i run my program, the program window doesnt close when i type Window.Close and it says "close of closed stream number 1. any help would be great thx>


Please specify what version of Turing you are using
<Newest>

Author:  TerranceN [ Sat Mar 20, 2010 7:43 pm ]
Post subject:  Re: Problem with Window.Close

Make sure that you are using the same number that Window.Open gives you. This error is given when no Window with the number you gave to Window.Close exists. Here is a small example of how Window.Close is supposed to be used:
Turing:
var windowID : int := Window.Open("graphics:500;500,offscreenonly,nobuttonbar")

var keys : array char of boolean

loop
   
    Input.KeyDown(keys)
   
    if (keys(KEY_ESC)) then
        exit
    end if
   
    cls

    Draw.Text("Press esc to close window", 150, 250, defFontID, black)
   
    Window.Update(windowID)

    Time.DelaySinceLast(33)
   
end loop

Window.Close(windowID)


Hope that helps, also you should be more clear with your question. Say what it is you're trying to achieve, not just the command you have tried to fix the problem.

Author:  livingheaven [ Sat Mar 20, 2010 8:40 pm ]
Post subject:  Re: Problem with Window.Close

k, Very Happy
i'll remember that
thx for the help

Author:  livingheaven [ Sat Mar 20, 2010 8:56 pm ]
Post subject:  Re: Problem with Window.Close

Very Happy finally finished the assignment !!!
thx for ur help

Author:  copthesaint [ Sat Mar 20, 2010 9:35 pm ]
Post subject:  RE:Problem with Window.Close

If you use help, make sure you post code, and if you need help with just a predefined method, refer to the Onile documentation.

http://compsci.ca/v3/viewtopic.php?t=20357
Its your Dictionary for the turing language


: