I need to have the answers to math problems interspersed with text strings in a label. I thought i did the right format but i get the error: this operation cannot accept the argument "empty string."please help im a newbie ,thanks.
MIT App Inventor 2.html
--
Sorry, the attached html does not help us understand the problem. Can you attach a screen capture of your blocks and or Designer screen in png or jpg format? If you do that, you should get some specific advice.
MIT App Inventor 2.html
--
Sorry, the attached html does not help us understand the problem. Can you attach a screen capture of your blocks and or Designer screen in png or jpg format? If you do that, you should get some specific advice.
This message "argument "empty string" is there probably because when you do the 'calculation,' there is no numerical value in the TextBox possibly. We do not know without a screen capture. Do you know how to use DoIt? This is the AI2 debugger...it can help a lot in finding errors like this. There is a description of DoIt here: http://www.appinventor.org/bookChapters/chapter15.pdf
More help learning to program App Inventor blocks is here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page
--
here is a screenshot (didnt know i could do that, you learn something new everyday)
--
You can try a block construction like:
With another label for each of the three other variables. If you click Button1 before entering a value in each of number.Text, row.Text or quotient.Text without placing any numerical values in the text blocks, you will get a "this operation cannot accept the argument "empty string." message. You have no 'error' control. You can 'fix' that by testing for values in the blocks using an IF..then statement (use the Math is a number? block).
Your instructions.Text label should work but when you clicked the button, you possibly did not have a value in one of the text entry fields. Consider, you are doing all four calculations in one operation so all the input blocks must be filled.
A trick you can use in the instructions.Text label, to put the results on separate lines is to include the control character \n following the Text blocks.... for example, change your thing block to thing \n and when the label is displayed, thing will show but the \n will not and you will see that the following text is on a different line.
Try some blocks and see what happens. If you need more advice, post additional blocks and you will get advice.
How you have this stuff displayed is up to you. You can use a single label or possibly put on the app four labels as mentioned above to display the results of the individual calculations; however, your construction should be fine as it is if ALL the input text boxes have non-zero values.
--
this first variable works in the app but the other variables need to be added to that instruction label too somehow.
--
i had "quotient. text" instead of "quotient of "... oops.
you dont even need set rows text numbers only true.
yey it works now,
댓글 없음:
댓글 쓰기