Error: The operation yail-divide cannot accept the arguments: , [[]], [0]

It keeps giving me this error, can someone help? Here's my code:

Your displayAverage procedure is taking the empty list in global sum and trying to divide it by 0, the length of the global entryActivityLimits.

Make up you mind about global sum.
Is it a list, or is it a number?

AI2 is not the Iverson language APL.
Its math blocks (/) do not work on lists.

1 Like

So what do I change exactly?

I changed the global sum to a number, it still gives an error but it's different.
It states:
The operation + cannot accept the arguments: , [0], []

You need to have text there in specific textbox not the textbox itself, you can rearrange smthing this way, using any component,


It's still not giving me the average of the numbers entered. Sorry if I'm just being dense.

1 Like

Here is the link to download the code if that helps to find out the problem.
Fitness_App.aia (89.7 KB)

1 Like

Use these :

Make sure that the textboxes have only "numbers" in them. You might want to enable the "Numbers Only" property.

Also, I used my MathTools extension here to get the average.

You can drag the blocks to Blocks Area.

First, this procedure makes a list of the values from the textbox.

Then it sends the list to the extension block to get the Average.

This is a method without an extension.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.