question

PalmaColapietro-2674 avatar image
0 Votes"
PalmaColapietro-2674 asked JanWieldraaijer-1495 answered

Because it does not work ?

GraphicsWindow.Show()

GraphicsWindow.LastKey = onClick

Sub onClick

T = GraphicsWindow.LastKey

If T = 1 Then
Goto Parte1
EndIf

If T = 2 Then
Goto Parte2
EndIf

EndSub

Parte1:
GraphicsWindow.ShowMessage("Premuto 1","Avviso")

Program.End()

Parte2:
GraphicsWindow.ShowMessage("Parte2","Avviso")

Program.End()

small-basic
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JanWieldraaijer-1495 avatar image
0 Votes"
JanWieldraaijer-1495 answered JanWieldraaijer-1495 edited

The following program works! :


 GraphicsWindow.Show()
 GraphicsWindow.KEYUP = onClick
    
 While 0=0
   Program.Delay(100)
 EndWhile
    
 Sub onClick
      
   T = GraphicsWindow.LastKey
   GraphicsWindow.DrawText(10,10,T)  ''to show the key text returned
      
   If T = "D1" Then
     GraphicsWindow.ShowMessage("Premuto 1","Avviso")
     Program.End()
   EndIf
      
   If T = "D2" Then
     GraphicsWindow.ShowMessage("Parte2","Avviso")
     Program.End()
   EndIf
      
 EndSub
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JanWieldraaijer-1495 avatar image
0 Votes"
JanWieldraaijer-1495 answered

General hints for clean programming :
- do NOT use GoTo xxx , especially out of subroutines,
- put all subroutines at the end of ther program, after the main program.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.