Problem to run interactive Shell

I tried this from the help manual and got an error

[quote]The Open event for the window initializes the shell object (declared as a property of the window).
mShell = New Shell
mShell.Mode = 2

The user can type a unix command into the TextField, InputField. When they press Return, the following code in the TextField’s KeyDown event runs. The Write method sends the command to the Shell’s input buffer.
If Key = Chr(13) Then
If Not mShell.IsRunning Then
mShell.Execute “sh”
End If
mShell.Write(InputField.Text)
mShell.Write(Chr(13))
InputField.Text = “”
Return True
Else
Return False
End If

A Timer calls the ReadAll method in its Action event and displays the output in OutputField:
If mShell <> Nil Then
Dim output As String = mShell.ReadAll
If output <> “” Then
OutputField.SelText = output
End If
End If[/quote]

This method cannot accept an assigned value (it lacks an Assigns parameter)

mShell = NewShell

Changing to:

dim mShell as New Shell

avoids the Error message but doesn’t work

I am not familiar with objects and instances and hope for advice

Thanks Joachim

First I used the Inspector Library and dragged the Shell into my main window.

After declaring the shell as property of the window as described above it works fine.

mShell = New Shell

If you have a property on a window, app or module