Skip to first unread message

Jesse Saunders

unread,
Apr 28, 2019, 7:55:45 PM4/28/19
to MIT App Inventor Forum
Hello.  I have a student who is putting together an app that has them choose a date.  If they click the male button, the first of a list of males appear.  If they choose female, the first of a list of females appear.  The user can click next to move through the appropriate list.   

The student is trying to use a separate select button to keep track of whether a male or female has been chosen, display the picture of who was chosen along with a note about a special gift that can be used to give to the date.  They also want to add 1 to the appropriate global variable (globalFemaleCount or globalMaleCount).  Can an if...elseif statement and a select item list for both the global male and global female list be used to allow the program to figure out what list is currently being used?  Also, an index is required.  How would the index be handled in this program?  Thanks. 
Screen Shot 2019-04-28 at 7.53.24 PM.png

SteveJG

unread,
Apr 28, 2019, 8:20:06 PM4/28/19
to MIT App Inventor Forum
Yes, you can use use if..then statements; in fact you must use them.  You do not show how you are selecting from each list, but you can determine which list was being selected.  Yes you can use an index .

The blocks you show in the ButtonSelect.Click do not select anything at the moment.  Perhaps you should put all the selections in a ListPicker and select that way? Chapdter 18 shows how to select an item from a List.

Have you and your students done these tutorials:


Why not try using some of the ideas, see what you and your student(s) can come up with.   If you get stuck, return here, show what you done and ask again and someone will provide specific advice.

Regards,
Steve



Jesse Saunders

unread,
Apr 29, 2019, 9:15:57 AM4/29/19
to MIT App Inventor Forum
    Here's what we came up with.  The list pickers for both male and female choices takes the place of the select button.  The app is too large, however, because the pictures need compressed.  So, it's crashing.  But, once that's fixed, we can fully test it.  But, how does the list picker code look?  Thanks again.
Screen Shot 2019-04-29 at 9.10.28 AM.png

Ghica

unread,
Apr 29, 2019, 9:24:46 AM4/29/19
to MIT App Inventor Forum
Next time you post blocks: click with your right mouse button on an empty spot in the blocks editor. Choose download blocks as image from the pop-up and post the resulting image.
Cheers, Ghica.

ABG

unread,
Apr 29, 2019, 10:29:13 AM4/29/19
to mitappinv...@googlegroups.com
Is there a common online (edit-ABG) data base available for this app,
or is it all based on the one device being passed around?

Also, consider keeping a table of pairs,
who picked who.

Each time some one picks some one else, add a row to the table
identifying who picked who (whom?)

If you use a SQL data base like MySQL or Fusion Tables (soon defunct)
you can ask the data base through queries to do the GROUP BY and SUM.

ABG

Reply all
Reply to author
Forward
0 new messages