π
<-
Chat plein-écran
[^]

examples for creating dialog boxes

Programmation et implémentation d'algorithmes.

examples for creating dialog boxes

Message non lude compsystems » 09 Mar 2017, 16:00

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: Tout sélectionner
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: Tout sélectionner
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: Tout sélectionner
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: Tout sélectionner
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: Tout sélectionner
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: Tout sélectionner
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: Tout sélectionner
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 ..
Avatar de l’utilisateur
compsystems
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 40.2%
 
Messages: 256
Inscription: 30 Mai 2011, 13:44
Genre: Homme
Calculatrice(s):
MyCalcs profile

Retourner vers Programmation

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 18 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
963 utilisateurs:
>949 invités
>9 membres
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)