B4A Library Libreria gestione liste avanzare risposte casuali

Ciao vi allego la mia libreria con un esempio del codice di utilizzo:
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim lista_Domande As List
    lista_Domande.Initialize
    Dim lista_Risposte As List
    lista_Risposte.Initialize
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
  
    Dim Gestione_Liste As Liste_Avanzate
    Gestione_Liste.Initialize
End Sub




Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
  
    'LISTA DOMANDE
    lista_Domande.Add ("01)Come ti chiami?")
    lista_Domande.Add ("01)Chi sei?")
    lista_Domande.Add ("02)Come stai?")
    lista_Domande.Add ("02)Come va?")
    lista_Domande.Add ("03)Che fai?")
  
    'LISTA RISPOSTE
    lista_Risposte.Add ("01)Sono androidappl")
    lista_Risposte.Add ("01)Piacere androidappl")
    lista_Risposte.Add ("01)Mi presento androidappl")
    lista_Risposte.Add ("01)io sono ciccio")
    lista_Risposte.Add ("01)io sono alfonso")
    lista_Risposte.Add ("01)io sono gianmarco")
    lista_Risposte.Add ("02)io sto bene")
    lista_Risposte.Add ("02)non sto tanto bene")
    lista_Risposte.Add ("02)mi sento influenzato oggi")
    lista_Risposte.Add ("03)Guardo un film")
    lista_Risposte.Add ("03)Faccio palestra")
  
Gestione_Liste .Elabora_Liste (lista_Domande,lista_Risposte,"Chi sei?")
Log("Domanda effettuata: " &Gestione_Liste.Domanda )
' dentro la variabile qua sotto troverete la risposta random
Log("Risposta casuale: " & Gestione_Liste.Risposta_Casuale)

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Metodi:
Initialize ' inizializzazione standard
Elabora_Liste (lista_Domande as list,lista_Risposte as list ,Domanda_ricevuta as string)
'Data una lista di domande con un codice davanti vedi sopra e una lista di risposte con un codice davanti vedi sempre sopra, e una domanda ricevuta otterrete una risposta casuale tra quelle da voi scelte...
Variabili:
Domanda ' Conterrà la domanda ricevuta
Risposta ' Genererà una risposta casuale tra le possibili


ENGLISH:

Methods:
Initialize 'standard initialization
Elabora_Liste (lista_Domande as list, lista_Risposte as list, Domanda_ricevuta as string)
'Given a list of questions with a code before you see above and a list of answers with a code in front of you always see above, a question and received an answer you will get random among those chosen by you ...
variables:
Question 'will contain the application received
Answer 'will generate a random response among the possible
 

Attachments

  • Lista_Avanzate_Risposte_Casuali.zip
    2.7 KB · Views: 193
Last edited:

androidappl

Active Member
Licensed User
Longtime User
This is the english partr of forum. Please put an english description of it too

ENGLISH:

Methods:
Initialize 'standard initialization
Elabora_Liste (lista_Domande as list, lista_Risposte as list, Domanda_ricevuta as string)
'Given a list of questions with a code before you see above and a list of answers with a code in front of you always see above, a question and received an answer you will get random among those chosen by you ...
variables:
Question 'will contain the application received
Answer 'will generate a random response among the possible

sorry for the bad English
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…