Calculate numbers and put result in label

669 views
Skip to first unread message
Assigned to steve....@gmail.com by me

BJ Van Gundy

unread,
Feb 22, 2014, 5:55:49 PM2/22/14
to mitappinv...@googlegroups.com
Using App Inventory 2, Windows 7 and current version of Firefox.

In my app, order takers enter the number of a particular dish the customer wants to order (e.g., Fried Fish).  The app then multiplies the number of meals ordered (e.g., 2)  times the cost of the meal (e.g., $5) and adds that amount to a running total.

I set up the user input fields as textboxes and indicated that the values entered would be numbers only.

I'd like the calculated amounts (e.g., 2 x $5 = $10) to be in labels so the order taker cannot change the calculated amount.

It's not working.  The calculated amounts do not appear.  I get a runtime error stating that "The operation *cannot accept the arguments: *empty string* 5."

Attached are the Design and Block workspaces from this app (Insert image was not working).  Would you please tell me what I did wrong and how it can be fixed?

Thank you in advance!





Calculate Order Blocks.png
Calculate Order Design.png

Enis

unread,
Feb 22, 2014, 6:31:08 PM2/22/14
to mitappinv...@googlegroups.com
The error says it all... you're trying to calculate a value when the STRING is empty...

One of those strings is empty and you're tyring to do a calculation on it, and a calculation cannot accept an empty string.

SteveJG

unread,
Feb 22, 2014, 6:35:22 PM2/22/14
to mitappinv...@googlegroups.com
What is happening when you use the  Screen1.Initalize block is the app is loading the values of text boxes that have no information in them.  They have not been initialized and their current value is null.

Do this,  put a temporary button on your design screen.  Take the blocks you have in your current Screen1.Initialize and move them to the new button.click block.    Move them do not copy them, leaving the blocks you have where they are will produce the same error.

Now, that the blocks are controlled by a button, put a number in each of them.  Each of them, because you are doing all the calculations in one fell swoop  and having an empty value in any of them will generate an error.

Try this.  What happens?   Please come back and tell us.   If you need more help, it is available.

Best Regards,
Steve

Abraham Getzler

unread,
Feb 22, 2014, 6:44:57 PM2/22/14
to mitappinv...@googlegroups.com

You can use the is a number block around your text input fields to filter out garbage, like this ...

SteveJG

unread,
Feb 22, 2014, 6:54:40 PM2/22/14
to
Nice bit of code Abraham.  I like the error control.  Error control is something almost always missing from beginning programmer's apps and some 'experts' too.  Thanks for your great way to correctly truncate decimal values, without rounding in AI2 that you posted the other day too.

-- Steve

BJ Van Gundy

unread,
Feb 24, 2014, 11:18:20 AM2/24/14
to mitappinv...@googlegroups.com
ut Thank you Enis, Steve and Abraham!  So here's where I am.  I added a Reset button on the screen to re-initialize the values...helps with testing and the users will need this function.

I initialize the user input textboxes to spaces so that the user sees a blank input field.  I initialize the system-calculated fields to zero.

When the user clicks on the "Calculate Totals" button,  I check each user input field to see if it is NOT a space.  If not a space, then I add the numerical value (because the property of these user input fields is set to number only...if they entered something, it should only be a number) of the input field to a total count for that line item.  I then check each total count for each line item to verify that it is not zero before adding it to the grand total at the bottom of the screen.

All this works fine EXCEPT:
  1. If the user enters a couple line items and clicks on the "Calculate Totals" button, the totals are calculated correctly.
  2. If the user makes a change above and clicks on the "Calculate Totals" button again, the values already added to the totals are added a SECOND time.  In other words, if I added a line item worth $5, click "Calculate Totals" then the total amount due is $5.  If I click "Calculate Totals" again, the total amount due now is $5...even though I didn't order anything else!

I was thinking about adding a prompt when the user clicks "Calculate Totals."  The prompt would ask "Is the order complete?"  If yes, then the system would calculate the totals.  If no, then the user returns to the existing form, as is, no changes.  But, I don't know how to create such a prompt.

Would you please steer me in the direction to learn how to develop that prompt?  Also, any other insight you have regarding how to make this a more user-friendly app is GREATLY appreciated!

Attached are images of the current screen format, the initialization block, the Rest function block, and the Calculate Totals block.

Thank you all!
Calculate Order Screen.png
Calculate Order Blocks 1.png
Calculate Order Blocks 2.png

SteveJG

unread,
Feb 24, 2014, 12:05:05 PM2/24/14
to
Appears you got the logic in hand.

What you need to do to do this: "I was thinking about adding a prompt when the user clicks "Calculate Totals."  The prompt would ask "Is the order complete?"  If yes, then the system would calculate the totals.  If no, then the user returns to the existing form, as is, no changes.  But, I don't know how to create such a prompt. "

is to add a Notify control.   Notify is described here:    Control Description .     This works a little like a     if..then   block.. but different.

Look at the description.  If you have difficulty figuring it out, come back again.

As for adding to an existing value, you might want to establish a global that is a boolean.     Call it   OrderFinished and initially set it to  false.        You can check if the order is finished with an if..then block .Do the appropriate testing and zero your counter or add to it.

Not difficult, but not as easy as I described.   You probably will figure it out but if not, the answer is come on back!

does this help?   

Regards,
Steve


Taifun

unread,
Feb 24, 2014, 12:04:19 PM2/24/14
to mitappinv...@googlegroups.com
this is not the answer you are looking for, but something to think about...

there is some redundancy in your project, for example just compare your Screen.Initialize and your Reset blocks...
probably it helps to read chapter 19 - 21 in David's book http://www.appinventor.org/projects to get an idea how to do DRY programming with App Inventor https://en.wikipedia.org/wiki/Don%27t_repeat_yourself

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.  

SteveJG

unread,
Feb 24, 2014, 12:13:39 PM2/24/14
to
Reviewing you calculation blocks; you can do it that way if it works for you.  It is a little awkward.

A better way is to establish a global variable to keep track of totals; then use the math blocks to calculate cost.
You may also want to make a procedure to go into your calculatetotal.click  block.     I is good coding practice to put 
the code you use over and over again into a procedure.    Your procedure would have the global counter mentioned before and math blocks.  At the moment you are doing things the hard way.

Are you following me?         I'll look at the blocks a bit more and see if I can give you a simple example of what I mean.

-- Steve

BJ Van Gundy

unread,
Feb 24, 2014, 12:28:36 PM2/24/14
to mitappinv...@googlegroups.com
Thanks, Steve.  Seeing an example would help.  As a novice, I'm building small individual apps to develop and test a component of a larger app.  Once I get this ordering component working, I'll duplicate it into the larger app.  So, not duplicating code within this component would be good.

All the examples online and in existing books use classic App Inventor.  I have trouble duplicating the examples using App Inventor 2 (e.g., setting up and using a global variable, creating and using procedures).

If it would be easier for you, attached is a copy (aia file) of this project.
PrjCalculateMeals.aia

SteveJG

unread,
Feb 24, 2014, 4:33:45 PM2/24/14
to mitappinv...@googlegroups.com
I and another guy looked at your code.  We are going to propose you do things a little different.  I may not get back to you immediately, however, we are looking and have several possible solutions in mind.  There is no example out there that shows what you are trying to do as far as we can tell, so we hope to provide some code.

-- Steve

BJ Van Gundy

unread,
Feb 24, 2014, 4:52:40 PM2/24/14
to mitappinv...@googlegroups.com
As an answer to another question, Taifun referred me to a Google Fusion Table.  Formatting the user-entered data in a comma-delimited format and storing it in a Google Fusion Table may be the best solution.

Ultimately, I want an Excel file of all the meal order tickets so I can massage that data in Excel at the end of the evening.  Today, as a volunteer, I spend HOURS reading paper meal ticket orders and manually, entering each ticket's data in Excel.  On a typical night, we will have 600-700 meal ticket order forms (we typically serve ~1200 meals each night).  So, you see, doing this mechanically will save SO much time!

The purpose of the final app is for the Order Takers to take the orders via the Android app (instead of via the paper order forms).  I then need a way to get the data from the Android to an Excel file where I can manipulate it.

My initial thought was to store the input data in a TinyDB, copy the ordered data to a TinyWebDB, download the data from TinyWebDB and email it to me.  This is VERY complex with too many points where an error can occur.

If a Google Fusion Table provides the above function, only in a more direct (less complex) manner, then I will put the data in a Fusion Table instead.  Does that make sense?

Does that help with the analysis you are doing (and help you are providing)?

Again, thank you SO much for your help!  (This year's first Fish Fry night is this coming Friday, Feb. 28,...so, I'm trying desperately to get this working by mid-week for end-to-end testing.)

Abraham Getzler

unread,
Feb 24, 2014, 9:02:05 PM2/24/14
to BJ Van Gundy, mitappinv...@googlegroups.com
Mr. Van Gundy,

Your time table is very aggressive.  I fear disaster.

May I suggest taking an hour to investigate Google Forms for input, with one row per order, and one column per menu item, with an item count at the intersection?

It can be used to feed Google Spreadsheets and Excel.

Maybe feeding a Google Form from a web viewer might save you a bunch of coding.

ABG
 


--
You received this message because you are subscribed to a topic in the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mitappinventortest/UI3CPiLLp6o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mitappinventort...@googlegroups.com.
To post to this group, send email to mitappinv...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mitappinventortest/cd03cc24-7682-48da-9445-7e9e076469d2%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

SteveJG

unread,
Feb 25, 2014, 8:43:24 AM2/25/14
to mitappinv...@googlegroups.com, BJ Van Gundy
BJ,   I agree with ABG, what you now describe is very ambitious.   It is doable but you are going to have to hone your programming skills.  This is not a weekend project you are describing.

Now, progress report... perhaps later to day I will show you one way of doing the menu.   It is vary basic and uses global variables to store most of your informamtion.   This could be done with lists, listpicker etc. but is more difficult.  So I will provide a basic solution.

Have you discovered the biggest flaw in your design?    Look at how you or a server enters numerical data.  There are easier ways.

Keep on dreaming. You have some great ideas.  Building a piece at a time is a good strategy and people here will continue to provide suggestions.



== Steve



BJ Van Gundy

unread,
Feb 25, 2014, 9:53:32 AM2/25/14
to mitappinv...@googlegroups.com, BJ Van Gundy
Thank you Steve!  Actually, BJ is one of the organizers who purchased and set-up the Android tablets to use Square to accept credit card payments.  I'm using the account he set up for the Android.  I am Anita Mitchell.  30 years ago, I programmed in assembler language where I knew exactly what instructions to use to get the machine to do what I wanted.  I struggle with finding the right blocks to use and not knowing exactly what the machine code is doing behind each block.  A month ago, I started out reading Eclispe and Java programming books and then discovered App Inventor.  Seemed like a much better choice considering the timeline.  I read App Inventor books and watched  the tutorials, but they use the classic version.  So, I understand the technical explanations you provide...and I am so grateful for them.  The reason the form looks like it does is because it emulates the paper form the other volunteers have used for years.  Some of the volunteers are in their 70's and have a hard enough time with change.  The idea was to make this app look and operate as close as possible as to how they used the paper...help make the adoption easier for them.  I'll look at Google forms.  I read about Fusion Tables, and that might work as well.   But, I look forward to seeing what suggestions you provide...with your help, maybe I can get this app working in a very simple way.

Thank you so much!

Anita

Abraham Getzler

unread,
Feb 25, 2014, 12:47:42 PM2/25/14
to BJ Van Gundy, mitappinv...@googlegroups.com
Anita,

Before jumping into app design, there are some due diligence questions that should be addressed first.
(Putting on analyst hat.)

  1. Does the venue have WiFi and Internet access?
  2. What will happen to the order sheets formerly filled out by the waiters? They probably served several functions:
    • Capture table orders
    • Compute dollar amounts of the orders
    • Capture payment information?
    • Pass the orders to the kitchen for fulfillment
    • Identify the filled orders for pickup from the kitchen
    • Validate the filled orders against the table orders for completeness
    • Inform the guy at the microphone who to call for pickup when the order is ready
    • Feed data collection for profit analysis
  3. Where does this app fit in the above workflow? (I'm guessing it is to speed the last step?
  4. Who is going to use this app, and when?

I'm sorry to be a wet blanket, but there is a big risk here without due diligence.  This isn't some little disposable game app.

ABG







--
You received this message because you are subscribed to a topic in the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mitappinventortest/UI3CPiLLp6o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mitappinventort...@googlegroups.com.
To post to this group, send email to mitappinv...@googlegroups.com.

SteveJG

unread,
Feb 25, 2014, 2:11:50 PM2/25/14
to
@ Anita ... hmm, I did assembler ages ago too.. yuk.   also Eclipse /  Android Studio a few months ago and I discovered the "toy" AI , then came AI2 it looked serious.  Still a limited tool box but actually a credible development tool.

This iapp s being programmed for a non-profit?     

I am almost done with a 'go by'.  Perhaps later this afternoon. I will have many suggestions.  Although I provide a framework; I believe this might work better differently (using lists and changing data entry dramatically using a list picker) .Many  of ABG's suggestions very apropos.    I play a bit with Fusion Tables .. remember the word is experimental.  I find them flaky and not always available..possibly because they are in the Cloud.  However,  fusion Tables may be the only tool you will have to program something 'rapidly.'   There is a 'boot-leg' version of AI that does other neat things but you have to load on your own server..are you aware?  Can not tell you more as i will not use it.

@ABG  ...Your points excellent, but mainly for Anita to deal with.  For you, come back later and you too may pick up the aia.   I think this might be the basis for a tutorial.    I provide no error control at the moment.  However, Anita, was never gonna' be able to use the app as she now relates how it should work.   Entering order values by the keyboard won't work.  This needs to work like a fast food cash register.   I came up with an idea, Anita will now press a button once to add 1 to the order, twice to add 2 etc.  I taught the app to count backwards too.

The app needs some ideas from you.  The way I wrote this, it needs lots of blocks...so many it might explode.  However,  If Anita likes my data entry, she will have to reproduce the block for ten more buttons.   How about the app talking to a PC in the kitchen and sending data as emails?       I do not own a smart phone so I have not investigated innovate things.   Oops, wasting too much time here.   Let me finish the code.   perhaps a first pass in an hour but possibly much later.  Thanks very much for your help.

Regards,
Steve


To unsubscribe from this group and all its topics, send an email to mitappinventortest+unsub...@googlegroups.com.

To post to this group, send email to mitappinv...@googlegroups.com.

SteveJG

unread,
Feb 25, 2014, 4:23:21 PM2/25/14
to
Here is an aia.   Load and try.
  
This might be the basis for a tutorial.

Only the Fried Fish has the advanced button .  Check the left check object to allow addition, uncheck to subtract with the same button.  Be aware the food 'prices' are hard coded.  Having 3 labels to define a menu item does not make sense to me, however I maintained that structure.  All values are in variables, to facilitate possible later conversion to use of Fusion tables or some other mechanisms.   

I would compact the menu in a future version and add error control.

Please let me know how this works Anita, if there are complaints, send them to Abraham who probably has not seen this yet.

Oh, be aware, this app takes a seemingly long time to load on the emulator.

Also there are still a few bugs...notably Refresh does not refresh all fields.

Regards,
Steve
Fish_Fry_09.aia

Abraham Getzler

unread,
Feb 25, 2014, 4:51:22 PM2/25/14
to SteveJG, mitappinv...@googlegroups.com
I think this design could be made to be list-driven, to use fewer blocks
and to allow easier menu changes.

However, I don't understand the top 2 controls (add and option 1), and the fine print middle column of the menu.
Is it used to vary side-dishes of the entree, or is it just further description of the entree?

Are any options dependent on any other options?

Also, are sodas part of the menu?  Looks dry.

ABG



On Tue, Feb 25, 2014 at 4:09 PM, SteveJG <steve....@gmail.com> wrote:
Here is an aia.   Load and try.
  
This might be the basis for a tutorial.

Only the Fried Fish has the advanced button .  Check the left check object to allow addition, uncheck to subtract with the same button.  Be aware the food 'prices' are hard coded.  Having 3 labels to define a menu item does not make sense to me, however I maintained that structure.  All values are in variables, to facilitate possible later conversion to use of Fusion tables or some other mechanisms.   

I would compact the menu in a future version and add error control.

Please let me know how this works Anita, if there are complaints, send them to Abraham who probably has not seen this yet.

Oh, be aware, this app takes a seemingly long time to load on the emulator.

Regards,
Steve

--
You received this message because you are subscribed to a topic in the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mitappinventortest/UI3CPiLLp6o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mitappinventort...@googlegroups.com.
To post to this group, send email to mitappinv...@googlegroups.com.

Abraham Getzler

unread,
Feb 25, 2014, 5:03:08 PM2/25/14
to SteveJG, mitappinv...@googlegroups.com
Oh, and I forgot -
Shouldn't there be a field (list picker?) at the top to identify which table this is for?
Also, a unique order number is needed to identify it at pickup -
maybe  a numbered chit system?

ABG

BJ Van Gundy

unread,
Feb 25, 2014, 5:36:39 PM2/25/14
to mitappinv...@googlegroups.com, BJ Van Gundy
Responses below...


On Tuesday, February 25, 2014 12:47:42 PM UTC-5, Abraham Getzler wrote:
Anita,

Before jumping into app design, there are some due diligence questions that should be addressed first.
(Putting on analyst hat.)

  1. Does the venue have WiFi and Internet access?  YES.
  1. What will happen to the order sheets formerly filled out by the waiters? They probably served several functions:
    • Capture table orders
    • Compute dollar amounts of the orders
    • Capture payment information?  The plan is: the app will compute the cost of the meals ordered (displayed in the label fields to the right of the user input fields) and calculate the total cost for the ticket (adult meals + child meals + chowder + other sides) and display those totals at the bottom of the screen.  The order taker will then press a button that will perform 2 functions: 1. send a copy of the order to a printer and 2. send a copy of the ticket (# of meals ordered) to the database which, at this point is a Fusion Table.
    • Pass the orders to the kitchen for fulfillment  We have volunteer students who run the printed tickets to the kitchen.
    • Identify the filled orders for pickup from the kitchen  A volunteer calls out the name of the customer (from reading the paper ticket) over a loud-speaker.  The customer raises his/her hand and another volunteer delivers the order to the customer.
    • Validate the filled orders against the table orders for completeness
    • Inform the guy at the microphone who to call for pickup when the order is ready
    • Feed data collection for profit analysis  The reason I'm using the Fusion Table is so I can download the data to Excel.  We already have an extensive Excel file that slices and dices the data.  Up to this point, we were counting ticket data manually and entering that raw data into the Excel file.
  1. Where does this app fit in the above workflow? (I'm guessing it is to speed the last step?  The app will replace the front-end printed tickets (tickets, instead will be printed once the order is placed).  The app will perform the total cost calculation which should improve human mathematical errors.
  2. Who is going to use this app, and when?  The order takers will use this app to take customer orders.  After the order is printed, the customer will pay either by cash, check or credit card (Square).

I'm sorry to be a wet blanket, but there is a big risk here without due diligence.  This isn't some little disposable game app.  Boy, you can say that again!!!  :-)  This Friday (Feb. 28th) is our trial run with friends and family.  The # of meals served typically is around 300.  If at all possible, I'd like to get to a beta version to use this Friday.  Then, I'll have the weekend and beginning of the next week to fix errors, work out kinks, etc. before the official start (Ash Wednesday, March 5) when we'll serve 750-800 meals.  The remaining Fridays, we average 1200+ meals per night.  Between now and April 11, we'll serve 8000 meals.  That's a lot of manual data entry (without the app to collect the data and create an electronic input file.


BTW, the reason I'm scrambling at a rather late date is due to 2 reasons:  1. the organizers didn't listen to me when I said we needed to start this process MONTHS ago, :-)  and 2. when they finally reached out to the person who developed a similar app for another group, they discovered that app only worked on IOS Apple tablets and we have Android tablets.

I cannot tell you how grateful I am for all you help and insight!

ABG







On Tue, Feb 25, 2014 at 9:53 AM, BJ Van Gundy <kofc11...@gmail.com> wrote:
Thank you Steve!  Actually, BJ is one of the organizers who purchased and set-up the Android tablets to use Square to accept credit card payments.  I'm using the account he set up for the Android.  I am Anita Mitchell.  30 years ago, I programmed in assembler language where I knew exactly what instructions to use to get the machine to do what I wanted.  I struggle with finding the right blocks to use and not knowing exactly what the machine code is doing behind each block.  A month ago, I started out reading Eclispe and Java programming books and then discovered App Inventor.  Seemed like a much better choice considering the timeline.  I read App Inventor books and watched  the tutorials, but they use the classic version.  So, I understand the technical explanations you provide...and I am so grateful for them.  The reason the form looks like it does is because it emulates the paper form the other volunteers have used for years.  Some of the volunteers are in their 70's and have a hard enough time with change.  The idea was to make this app look and operate as close as possible as to how they used the paper...help make the adoption easier for them.  I'll look at Google forms.  I read about Fusion Tables, and that might work as well.   But, I look forward to seeing what suggestions you provide...with your help, maybe I can get this app working in a very simple way.

Thank you so much!

Anita


On Tuesday, February 25, 2014 8:43:24 AM UTC-5, SteveJG wrote:
BJ,   I agree with ABG, what you now describe is very ambitious.   It is doable but you are going to have to hone your programming skills.  This is not a weekend project you are describing.

Now, progress report... perhaps later to day I will show you one way of doing the menu.   It is vary basic and uses global variables to store most of your informamtion.   This could be done with lists, listpicker etc. but is more difficult.  So I will provide a basic solution.

Have you discovered the biggest flaw in your design?    Look at how you or a server enters numerical data.  There are easier ways.

Keep on dreaming. You have some great ideas.  Building a piece at a time is a good strategy and people here will continue to provide suggestions.



== Steve



--
You received this message because you are subscribed to a topic in the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mitappinventortest/UI3CPiLLp6o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mitappinventortest+unsub...@googlegroups.com.

To post to this group, send email to mitappinv...@googlegroups.com.

BJ Van Gundy

unread,
Feb 25, 2014, 5:58:29 PM2/25/14
to mitappinv...@googlegroups.com
Embedded responses below...  Also, attached is an image of the paper input form.  Currently, we spend serious $s to create this ticket on white paper for dine-in orders, yellow paper for take-out orders, and blue paper for volunteer orders.  The idea is to print the tickets on a printer using just white paper and printing a bold heading or even a white/yellow/blue label to indicate to the kitchen which type of order.  Regardless, this solution should save the organization a few $100s which could be better spent on charitable donations/work.

My husband and I start at noon with a crew to clean the gym, set up tables and chairs and condiments.  Around 5:15 pm I start manually loading the ticket data into an Excel spreadsheet.  Around midnight, I complete the data loading and the spreadsheet calculates all the data and formats it for a report for my husband.  He analyses that data and typically sends out a report to the management team around 2am.  As you can see, it's a very long day for us.  Again, that's why I'm trying to mechanize as much as possible.  :-)   Thanks!


On Tuesday, February 25, 2014 2:06:23 PM UTC-5, SteveJG wrote:
@ Anita ... hmm, I did assembler ages ago too.. yuk.   also Eclipse /  Android Studio a few months ago and I discovered the "toy" AI , then came AI2 it looked serious.  Still a limited tool box but actually a credible development tool.

This iapp s being programmed for a non-profit?   YES.  Our church has annual lenten fish fries to raise funds for charitable donations and work done throughout the year. 

I am almost done with a 'go by'.  Perhaps later this afternoon. I will have many suggestions.  Although I provide a framework; I believe this might work better differently (using lists and changing data entry dramatically using a list picker) .Many  of ABG's suggestions very apropos.    I play a bit with Fusion Tables .. remember the word is experimental.  I find them flaky and not always available..possibly because they are in the Cloud.  However,  fusion Tables may be the only tool you will have to program something 'rapidly.'   There is a 'boot-leg' version of AI that does other neat things but you have to load on your own server..are you aware?  Can not tell you more as i will not use it.

@ABG  ...Your points excellent, but mainly for Anita to deal with.  For you, come back later and you too may pick up the aia.   I think this might be the basis for a tutorial.    I provide no error control at the moment.  However, Anita, was never gonna' be able to use the app as she now relates how it should work.   Entering order values by the keyboard won't work.  This needs to work like a fast food cash register.   I came up with an idea, Anita will now press a button once to add 1 to the order, twice to add 2 etc.  I taught the app to count backwards too.

The app needs some ideas from you.  The way I wrote this, it needs lots of blocks...so many it might explode.  However,  If Anita likes my data entry, she will have to reproduce the block for ten more buttons.   How about the app talking to a PC in the kitchen and sending data as emails?       I do not own a smart phone so I have not investigated innovate things.   Oops, wasting too much time here.   Let me finish the code.   perhaps a first pass in an hour but possibly much later.  Thanks very much for your help.

Regards,
Steve



On Tuesday, February 25, 2014 5:47:42 PM UTC, Abraham Getzler wrote:
To unsubscribe from this group and all its topics, send an email to mitappinventortest+unsub...@googlegroups.com.

To post to this group, send email to mitappinv...@googlegroups.com.
Fish Fry Order Form_0001.pdf

SteveJG

unread,
Feb 25, 2014, 8:00:31 PM2/25/14
to mitappinv...@googlegroups.com

A ticket number and the time are not a big issue, except of several Tablets are used.    Each number preceded by a number of the tablet?   3 234 or a table number.  The senior discount might be a bit more difficult.  One way would be to the empty check box in connection with an ordinary entry to change the price on a case by case, or you could just add more menu items. What I mean is use the check box and a global boolean to flag true/false and to change the ordinary price by 1$ or whatever when calculation.  Seems simplest.

Sending to a printer is a good idea and yes, with all the data you can go to a fusion table.   My experience is it might be easier to access the fusion table to retrieve data from a PC application..but you probably have the expert ice to do that.

Good luck with your deadlines and the charitable events.

Regards,
Steve

 

 

Abraham Getzler

unread,
Feb 25, 2014, 11:33:57 PM2/25/14
to SteveJG, mitappinv...@googlegroups.com
Regarding the sending of the order to the printer ...

The only way I could think of was to format an email to some one sitting at a pc with the printer.

The order print image would have to be built up with a bunch of maketext blocks, with \n line separators,
in several passes, maybe counting spaces for alignment.

ABG



--
You received this message because you are subscribed to a topic in the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mitappinventortest/UI3CPiLLp6o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mitappinventort...@googlegroups.com.
To post to this group, send email to mitappinv...@googlegroups.com.

BJ Van Gundy

unread,
Feb 26, 2014, 10:26:02 AM2/26/14
to mitappinv...@googlegroups.com
Yes, 3 tablets will be used.  So, I have a separate column "Tablet" in the Fusion Table.  That way, order 1 001 will be distinct from order 2 001 and order 3 001.

SteveJG

unread,
Feb 26, 2014, 12:00:10 PM2/26/14
to mitappinv...@googlegroups.com
A thought about the 'printer'  in the kitchen,

A real PC in the kitchen can monitor the fusion table .. yeah you have to write a small program to continually view the fusion table and print out pertinent data every minute or so as new Rows are added (read that as orders)

Steve

Abraham Getzler

unread,
Feb 26, 2014, 12:33:57 PM2/26/14
to SteveJG, mitappinv...@googlegroups.com
If there's no room for a PC,but  just a web-enabled WiFi printer with ePrint would fit, you might send the orders directly from the tablets with one of the several email snippets available ...
http://puravidaapps.com/snippets.php#2email

ABG


--
You received this message because you are subscribed to a topic in the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mitappinventortest/UI3CPiLLp6o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mitappinventort...@googlegroups.com.
To post to this group, send email to mitappinv...@googlegroups.com.

BJ Van Gundy

unread,
Mar 3, 2014, 10:35:42 AM3/3/14
to mitappinv...@googlegroups.com
, Hi Steve,

I followed the logic in your example for initializing the calculation fields...that helped a great deal!  Thank you!

While duplicating the logic for each input field, I ran into the problem you describe below regarding the slow emulator performance.  It seems to be more than just the emulator, because the act of selecting and connecting blocks was extremely slow.  It appears as though the response time slowed proportionately as more blocks were used and the source code size increased.  By the time I added all the blocks to perform the necessary functions (that did work!), it took over a minute to add/change/delete a single block to/in/from the workspace.  In other words, if I wanted to add a text block and clicked on the blank text block from the list on the left, it would take over a minute before that blank textbox would appear in the workspace.  Finishing the development took about 10 hours!

Once the app was installed on the tablet, the response time was a couple seconds as opposed to minutes.  Response time wasn't horrible, just not as fast as the users would like.

Friday was a "design review."  The users liked the app.  I need to add some more functionality (e.g., sending an order form to a printer) and take the users through another walk-through, before it's ready for Go Live.

With the length of time it takes to build the app (over a minute to add a single block), I need to come up with a solution that requires less logic.  Since the cost calculates are repeasted, I could use a loop to perform the function X number of times, but I don't know how to change the address of the data fields (e.g., 1A_Qty, 1B_Qty, 2A_Qty, 2B_Qty, 3A_Qty, 3B_Qty) so the calculation logic progresses through the list of item types.

Could I use something like a "while test - do" function?
  • Set a counter value before entering the while test function.
  • Within the while test function, perform the calculation, increment a pointer to the next data set, and decrement the counter.
What I don't understand (and could use your help/advice on how to do this) is how to increment a pointer to get the next data set.

What do you recommend?

Thank you so much for all your help!

On Tuesday, February 25, 2014 4:09:49 PM UTC-5, SteveJG wrote:
Here is an aia.   Load and try.
  
This might be the basis for a tutorial.

Only the Fried Fish has the advanced button .  Check the left check object to allow addition, uncheck to subtract with the same button.  Be aware the food 'prices' are hard coded.  Having 3 labels to define a menu item does not make sense to me, however I maintained that structure.  All values are in variables, to facilitate possible later conversion to use of Fusion tables or some other mechanisms.   

I would compact the menu in a future version and add error control.

Please let me know how this works Anita, if there are complaints, send them to Abraham who probably has not seen this yet.

Oh, be aware, this app takes a seemingly long time to load on the emulator.

SteveJG

unread,
Mar 3, 2014, 11:13:14 AM3/3/14
to mitappinv...@googlegroups.com
The slow browser performance with large numbers of blocks and controls is a known issue.  The MIT team is working on it. 

A tip:  Using the emulator like that is frustrating.  Solution, while CODING, do NOT connect to the emulator.  You can write code/ duplicate code without being connected.  You only need the emulator/device to test.  

Your other issues; I need to reread your note.  Stay tuned.

Happy you are happy with some of the basic logic.

Regards,
Steve


SteveJG

unread,
Mar 3, 2014, 11:36:34 AM3/3/14
to
The last version of your aia I saw did this: " I followed the logic in your example for initializing the calculation fields...that helped a great deal! "   What that version did not do is follow my calculation logic.   You do not have to total each category, one at a time, you can calculate ALL of them at once.

Perhaps I do not understand what you are attempting.  I believe you are making this too complicated.  Is this related to Fusion tables?

You could keep this simple by doing all the calculations before sending individual pieces of data to the fusion tables (which is what I think you are attempting).   I also believe it is possible to do the calculations in the Fusion tables, but I do not know how.

Regarding:  "What I don't understand (and could use your help/advice on how to do this) is how to increment a pointer to get the next data set."  ... how about some blocks?      Increment is usually not difficult, but I can not figure out what you want to change because your categories  are written in 'greek' because "What I don't understand (and could use your help/advice on how to do this) is how to increment a pointer to get the next data set."   I do not understand what data set you are talking about.   See my email to you.


--Steve
Reply all
Reply to author
Forward
0 new messages