Page 1 of 1

examples for creating dialog boxes

Unread postPosted: 09 Mar 2017, 16:00
by compsystems
A series of examples for creating dialog boxes, (For now with comments in Spanish, soon also in English)
/!\ require copytoh89 ASM prg http://www.ticalc.org/archives/files/fi ... 16366.html for return the output on home history

The source codes were created using the TI-EDIT (TI-68K editor) You can copy and paste them in unicode format,
http://pengels.bplaced.net/index.php/tiedit (TI-EDIT 2017)

The REQUEST CMD (TI-68K CALCS) is practically the same that the REQUEST of the TI-NSPIRE-CX-CAS

example#0
Code: Select all
reqDemo()
Prgm
  ClrIO
  Local statsvar,alphalck
  0→alphalck
  Request "Radious",r,alphalck
  expr(r)→r
  ok→statsvar
  If ok=1 Then
    Disp "Area = π*"&string(r)&"² = "&string(π*r^2.)&" u²"
  EndIf
  Pause:DispHome
EndPrgm


Now if you want to return to the HOME history, use the copytoh89.v2z/89z ASM PRG (renamed to return_h.v2z/89z)

Code: Select all
reqDemo1()
Prgm
  ClrIO
  Local statsvar,radious,area,r
  "radious"→radious
  Request radious,r
  expr(r)→r
  π*r^2.→area
  ok→statsvar
  If statsvar=1 Then
    return_h("radious","area")
  EndIf
EndPrgm



example #1
Code: Select all
reqstv01()
Prgm
  ClrIO
  Local statsvar,radious,area,r
  "radious"→radious
  Request radious,r
  expr(r)→r
  π*r^2.→area
  ok→statsvar
  If statsvar=1 Then
    return_h("radious","area")
  EndIf
EndPrgm



example #2
Code: Select all
reqstv1a()
Prgm
  ClrHome
  string(x)→x © valor inicial global (pero como cadena) de la variable de almacenamiento. Siempre que se llame a la orden de usuario reqstv1a() el valor será el ultimo almacenado en memoria

  Local label © etiqueta de la variable de almacenamiento
  "x"→label

  Local alphalck © activar o no teclado alfabético, [0=NO, 1/vacio= SI] (solo ti89) en el campo de entrada
  0→alphalck

  Request label,x,alphalck
  expr(x)→x
  return_h("label","x")
EndPrgm



example #3
Code: Select all
reqstv1c()
Prgm
  © Agregando TÍTULO PERSONALIZADO
  ClrHome
  string(x)→x © valor inicial global (pero como cadena) de la variable de almacenamiento. Siempre que se llame a la orden de usuario reqstv1c() el valor será el ultimo almacenado en memoria

  Local label © etiqueta de la variable de almacenamiento
  "x"→label

  Local alphalck © activar o no teclado alfabético, [0=NO, 1/vacio= SI] (solo ti89) en el campo de entrada
  0→alphalck

  Dialog
    Title "Titulo: INPUT"
    Request label,x,alphalck
  EndDlog
  expr(x)→x
  return_h("label","x")

EndPrgm



example #4
Code: Select all
reqsskey()
Prgm
  © Detectando teclas pulsadas [ESC] [OK]
  ClrHome
  string(x)→x © valor inicial global (pero como cadena) de la variable de almacenamiento. Siempre que se llame a la orden de usuario reqsskey() el valor será el ultimo almacenado en memoria

  Local label © etiqueta de la variable de almacenamiento
  "x"→label

  Local alphalck © activar o no teclado alfabético, [0=NO, 1/vacio= SI] (solo ti89) en el campo de entrada
  0→alphalck

  Local retdone
  done→retdone

  Local none
  "Esc"→none

  Dialog
    Title "Titulo: INPUT"
    Request label,x,alphalck
  EndDlog
  expr(x)→x

  ok→ok_levl1
  If ok_levl1=1 Then
    return_h("label","x")
  Else
    return_h("none","retdone")
  EndIf
EndPrgm



Code: Select all
reqstv1d()
Prgm
  © Agregando una ayuda
  ClrHome: © delvar x
  string(x)→x

  © Maximo x caracteres
  Local help
  "Ayuda: Ingrese valor para x          :"→help

  Local retdone
  done→retdone
  Local none
  "Esc"→none

  Dialog
    Title "Titulo: INPUT"
    Text help
    Request "x",x,0
  EndDlog
  expr(x)→x

  ok→ok_levl1
  If ok_levl1=1 Then
    return_h("label_in","x")
  Else
    return_h("none","retdone")
  EndIf
EndPrgm

Writing ..