Gambas-it

Gambas3 => Programmazione => Topic aperto da: vuott - 31 Marzo 2017, 13:39:49

Titolo: Spostarsi verticalmente ed orizzontalmente nella console
Inserito da: vuott - 31 Marzo 2017, 13:39:49
Inviando gli opportuni valori corrispondenti a specifici tasti della tastiera, รจ possibile muovere il cursore all'interno della console.

Mostro un esempio pratico:
Codice: [Seleziona]
Public Sub Main()

Dim i As Integer

Do
Wait 0.5
If i > 10 Then
  Write Chr(27) & Chr(91) & Chr(66)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(67)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(66)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(67)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(68)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(67)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(68)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(67)
Else
  Write Chr(27) & Chr(91) & Chr(66)
Write "v"
Endif
Wait 0.5
If i > 10 Then
  Write Chr(27) & Chr(91) & Chr(65)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(65)
  Wait 0.5
  Write Chr(27) & Chr(91) & Chr(65)
Else
  Write Chr(27) & Chr(91) & Chr(65)
  Write "^"
Endif
Inc i
If i = 15 Then i = 0
Loop


End