buenas...
mi nuevo y único proyecto de consola se llama "Ayudame"
el proyecto esta en la granja para descargar estoy en las primeras pruebas del proyecto.
http://novatocodegambas.blogspot.co...de-consola.html
Objetivos de esta aplicación de consola.
1- ver que comandos tenemos disponibles para tareas X
2-ejemplos sencillos de uso de esos comandos.
"Ayudame" ( Programa De Consola O Terminal)
Subject: "Ayudame" ( Programa De Consola O Terminal)
Last edited by v3ctor on Thursday, 12 May 2016, 17:43; edited 1 time in total
Last edited by v3ctor on Thursday, 12 May 2016, 17:43; edited 1 time in total
Subject: Re: "Ayudame" ( Programa De Consola O Terminal)
Last edited by jousseph on Thursday, 12 May 2016, 07:54; edited 2 times in total
Hola V3ctor aqui te muestro una terminal mejorada la que llevo en fase casi terminada llamada gestor-((jou)) que es un gestor de operaciones:
Video fase viejito
https://foro.gambas-es.org/viewtopi...ighlight=gestor
Link
Aqui casi perfecta:
https://foro.gambas-es.org/viewtopi...hlight=terminal
Te invito a que la pruebes.
Saludos
Video fase viejito
https://foro.gambas-es.org/viewtopi...ighlight=gestor
Link
Aqui casi perfecta:
https://foro.gambas-es.org/viewtopi...hlight=terminal
Te invito a que la pruebes.
Saludos
Last edited by jousseph on Thursday, 12 May 2016, 07:54; edited 2 times in total
Subject: Re: "Ayudame" ( Programa De Consola O Terminal)
alguien sabe como limpiar la pantalla en la terminal misma donde esta funcionando el programa?
ejemplo hay un menú en pantalla y quiera limpiar la pantalla para mostrar otro menú.
ejemplo hay un menú en pantalla y quiera limpiar la pantalla para mostrar otro menú.
Subject: Re: "Ayudame" ( Programa De Consola O Terminal)
Prueba con el comando "clear" del sistema operativo. Ejecutado con exec no con shell.
Subject: Re: "Ayudame" ( Programa De Consola O Terminal)
V3ctor deberias de experimentar con los ejemplos que trae gambas de consola, yo me esforze en hacerle todas las respectivas funciones y los codigos estan en todos lados.
Con respecto a lo tuyo yo utilizo es un textarea para mostrar la lectura del bash asi solo hago un clear o "" para borrar la misma, a mi me salio muchisimo mejor desarrollandolo de esta manera y me ayuda a gestionar las operaciones eficientemente del SO.
Last edited by jousseph on Thursday, 12 May 2016, 21:59; edited 1 time in total
v3ctor escribió: [Ver mensaje]
V3ctor deberias de experimentar con los ejemplos que trae gambas de consola, yo me esforze en hacerle todas las respectivas funciones y los codigos estan en todos lados.
Con respecto a lo tuyo yo utilizo es un textarea para mostrar la lectura del bash asi solo hago un clear o "" para borrar la misma, a mi me salio muchisimo mejor desarrollandolo de esta manera y me ayuda a gestionar las operaciones eficientemente del SO.
Last edited by jousseph on Thursday, 12 May 2016, 21:59; edited 1 time in total
Subject: Re: "Ayudame" ( Programa De Consola O Terminal)
V3ctor mi consola la desarrolle desde el gambas 3.1 y ahorita noto que el gambas moderno trae las cosas diferentes busca en la famosa granja si esta la consola de comandos si no te perdiste algo valioso.
v3ctor escribió: [Ver mensaje]
V3ctor mi consola la desarrolle desde el gambas 3.1 y ahorita noto que el gambas moderno trae las cosas diferentes busca en la famosa granja si esta la consola de comandos si no te perdiste algo valioso.
Subject: Re: "Ayudame" ( Programa De Consola O Terminal)
lo he recuperado primero descargar los ejemplos viejos ver imagen
segundo ir a ver imagen
Last edited by v3ctor on Thursday, 12 May 2016, 22:41; edited 1 time in total
jousseph escribió: [Ver mensaje]
lo he recuperado primero descargar los ejemplos viejos ver imagen
segundo ir a ver imagen
' gambas class file
Private $hProcess As Process
Private $sText As String
Static Public Sub Main()
Dim hForm As Form
hForm = New FConsole
hForm.Show
End
Public Sub _new()
$hProcess = Exec ["bash", "--noediting"] For Input Output As "Process"
End
Public Sub Form_Close()
$hProcess.Kill
End
Public Sub Process_Read()
Dim sStr As String
'Debug Eof(Last);; Lof(Last);;
'While Not sStr
Read #$hProcess, sStr, -256
'Wend
'Error sStr
$sText = $sText & sStr
'Debug Quote(sStr)
UpdateConsole
End
Public Sub Process_Error(sStr As String)
$sText = $sText & sStr
UpdateConsole
End
Private Sub UpdateConsole()
Dim iPos As Integer
Dim sStr As String
While Len($sText)
iPos = InStr($sText, "\n")
If iPos = 0 Then iPos = Len($sText)
sStr = Normalize(Left$($sText, iPos))
'Debug sStr
$sText = Mid$($sText, iPos + 1)
txtConsole.Pos = txtConsole.Length
txtConsole.Insert(sStr)
Wend
End
Public Sub Process_Kill()
'hProcess = NULL
Try Me.Close
End
Public Sub txtCommand_Activate()
Dim sLig As String
sLig = txtCommand.Text & gb.NewLine
'txtConsole.Pos = txtConsole.Length
'txtConsole.Insert("# " & sLig)
txtCommand.Clear
sLig = Conv$(sLig, Desktop.Charset, System.Charset)
Print #$hProcess, sLig;
End
Static Private Function Normalize(sStr As String) As String
Dim sNorm As String
Dim iInd As Integer
Dim iCar As Integer
Dim bEsc As Boolean
' For iInd = 1 To Len(sStr)
'
' iCar = Asc(sStr, iInd)
'
' If iCar = 27 Then
' bEsc = True
' Continue
' Endif
'
' If bEsc Then
' If iCar < 32 Then bEsc = False
' Continue
' Endif
'
' If iCar < 32 And iCar <> 10 Then iCar = 32
'
' sNorm = sNorm & Chr$(iCar)
'
' Next
sNorm = sStr
If System.Charset = Desktop.Charset Then
Return sNorm
Else
Return Conv$(sNorm, System.Charset, Desktop.Charset)
Endif
End
Public Sub Form_Open()
txtCommand.SetFocus
End
Public Sub btnCtrlC_Click()
Print #$hProcess, Chr$(3);
End
Public Sub btnCtrlD_Click()
Print #$hProcess, Chr$(4);
End
Public Sub btnCtrlZ_Click()
Print #$hProcess, Chr$(26);
End
Private $hProcess As Process
Private $sText As String
Static Public Sub Main()
Dim hForm As Form
hForm = New FConsole
hForm.Show
End
Public Sub _new()
$hProcess = Exec ["bash", "--noediting"] For Input Output As "Process"
End
Public Sub Form_Close()
$hProcess.Kill
End
Public Sub Process_Read()
Dim sStr As String
'Debug Eof(Last);; Lof(Last);;
'While Not sStr
Read #$hProcess, sStr, -256
'Wend
'Error sStr
$sText = $sText & sStr
'Debug Quote(sStr)
UpdateConsole
End
Public Sub Process_Error(sStr As String)
$sText = $sText & sStr
UpdateConsole
End
Private Sub UpdateConsole()
Dim iPos As Integer
Dim sStr As String
While Len($sText)
iPos = InStr($sText, "\n")
If iPos = 0 Then iPos = Len($sText)
sStr = Normalize(Left$($sText, iPos))
'Debug sStr
$sText = Mid$($sText, iPos + 1)
txtConsole.Pos = txtConsole.Length
txtConsole.Insert(sStr)
Wend
End
Public Sub Process_Kill()
'hProcess = NULL
Try Me.Close
End
Public Sub txtCommand_Activate()
Dim sLig As String
sLig = txtCommand.Text & gb.NewLine
'txtConsole.Pos = txtConsole.Length
'txtConsole.Insert("# " & sLig)
txtCommand.Clear
sLig = Conv$(sLig, Desktop.Charset, System.Charset)
Print #$hProcess, sLig;
End
Static Private Function Normalize(sStr As String) As String
Dim sNorm As String
Dim iInd As Integer
Dim iCar As Integer
Dim bEsc As Boolean
' For iInd = 1 To Len(sStr)
'
' iCar = Asc(sStr, iInd)
'
' If iCar = 27 Then
' bEsc = True
' Continue
' Endif
'
' If bEsc Then
' If iCar < 32 Then bEsc = False
' Continue
' Endif
'
' If iCar < 32 And iCar <> 10 Then iCar = 32
'
' sNorm = sNorm & Chr$(iCar)
'
' Next
sNorm = sStr
If System.Charset = Desktop.Charset Then
Return sNorm
Else
Return Conv$(sNorm, System.Charset, Desktop.Charset)
Endif
End
Public Sub Form_Open()
txtCommand.SetFocus
End
Public Sub btnCtrlC_Click()
Print #$hProcess, Chr$(3);
End
Public Sub btnCtrlD_Click()
Print #$hProcess, Chr$(4);
End
Public Sub btnCtrlZ_Click()
Print #$hProcess, Chr$(26);
End
Last edited by v3ctor on Thursday, 12 May 2016, 22:41; edited 1 time in total
Page 1 of 2
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Design by DiDiDaDo
Generation Time: 0.1493s (PHP: 8% SQL: 92%)
SQL queries: 27 - Debug Off - GZIP Enabled