Hallo,
because I need a terminal window for running a command, I would like to ask,
how can I integrate this into a form-tool f.e. like text.aera? Appreciate to hear
from you!
Gamba_Dance
Terminal Windows in Main-Form
- Gamba_Dance
- Posts: 11
- Joined: Wednesday 30th September 2020 8:43am
Terminal Windows in Main-Form
If even one line of "Hello World" program code requires an intelligent riginator, how can anyone claim that the human genome with 3,300,000,000 lines f intelligent code could have been created by chance
- BruceSteers
- Posts: 1521
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Terminal Windows in Main-Form
TerminalView is the best component to have an interactive terminal.
Shell output from the Shell or Exec command can be directed to a text area like...
Shell 'ls/home' To TextArea1.Text
Also you can
Shell 'command" For Input Output
And set up a Process_Read() event handler.
Info on how to do this is on the gambas wiki shell help.
Shell output from the Shell or Exec command can be directed to a text area like...
Shell 'ls/home' To TextArea1.Text
Also you can
Shell 'command" For Input Output
And set up a Process_Read() event handler.
Info on how to do this is on the gambas wiki shell help.
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- BruceSteers
- Posts: 1521
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Terminal Windows in Main-Form
Sorry my last reply was brief as i was at work.
So...
If all you want is to see the output of a shell command and not type anything then it's very simple.
There are 2 ways.
Simply use the Shell or Exec command using the "To" keyword to direct the output straight to the TextArea object like this...
using the As keyword to assign events to a name. (in this case the name "Process")
Like this...
So...
If all you want is to see the output of a shell command and not type anything then it's very simple.
There are 2 ways.
Simply use the Shell or Exec command using the "To" keyword to direct the output straight to the TextArea object like this...
Shell "ls /home" To TextArea1.text
Or...
Exec ["ls", "/home"] To TextArea1.text
Another way is to set up a Read event handler that monitors for read events.using the As keyword to assign events to a name. (in this case the name "Process")
Like this...
Public Sub Process_Read()
Dim sLine As String
Read #Last, sLine, -256
TextArea1.Text &= sLine
TextArea1.Pos = Len(TextArea1.Text)
TextArea1.EnsureVisible
End
Public Sub RunCommand()
Shell "ls /home" For Input Output As "Process"
End
Or do you need something more advanced?If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1118
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Terminal Windows in Main-Form
Hi Gamba_Dance and welcome to the forum.
BruceSteers is right in what he says but if you do need an example I wrote a program with a Terminal in 7 lines of code that is on the Gambas Farm or available here. There are other examples on the Farm as well.
If you give us a bit more detail of what you are trying to do we could offer better advice.
BruceSteers is right in what he says but if you do need an example I wrote a program with a Terminal in 7 lines of code that is on the Gambas Farm or available here. There are other examples on the Farm as well.
If you give us a bit more detail of what you are trying to do we could offer better advice.
- Gamba_Dance
- Posts: 11
- Joined: Wednesday 30th September 2020 8:43am
Re: Terminal Windows in Main-Form
Hallo together and thank you very much, for your quick an friendly help.
I think your solutions will fetch my problem. Because I didn't find any
chat-code for Gambas, I wanna integrate a terminal-window with a chat-function,
for using in LAN intranet.
Gamba_Dance
I think your solutions will fetch my problem. Because I didn't find any
chat-code for Gambas, I wanna integrate a terminal-window with a chat-function,
for using in LAN intranet.
Gamba_Dance
If even one line of "Hello World" program code requires an intelligent riginator, how can anyone claim that the human genome with 3,300,000,000 lines f intelligent code could have been created by chance