HELP, how do you make a system of notes to be averaged with notes chosen by the user

HELP, how to make a system of notes to be averaged, but that the user enters the number of notes to be averaged and can enter them until reaching the amount and add them and then divide them by the amount to get the average.

I have not been able to do it.

image

What the program would look like already made in block. here is an image of what I want to do

Nice to see some blocks, now show us some data, what are these "notes" ?

By "notes" I mean numerical data. but I have not been able to make the code in block.

OK, so provide some data for each of your textboxes.

My guess is you want something like this:

User types: 4,5,6,7,8

the app generates an average of those numbers: 6

Not sure why you need this:

image

The idea of ​​the program is that the user enters the number of numbers to be averaged and then the user can enter the numerical data until reaching the amount entered.

Why not just enter the numbers, separated by commas. The app can count the length of the list.

Good idea, this would be a good option. What would the block code look like?

relies on the user placing a comma after each "note" (except the last one, of course)

I want to validate so that the numbers entered do not exceed the number of numbers the user can enter

The idea of ​​the program is that the user enters the number of numbers to be averaged and then enters the numbers after displaying the averaging result on the screen.

EXAMPLE
quantity: 3
Numbers I want to enter: 7,1,5 and I cannot enter any other number


Captura de pantalla 2024-10-25 195927

Here is an extension that gives you that.

How will that help me validate so that the numbers entered do not exceed the number of numbers the user can enter?

Just like this:

20241025_222416


The first block is not necessary, the second is the good one.

Try this:

averageNumbers (1).aia (3.2 KB)

User must type a comma after entering each number, even the last one...

Add the numbers to the end of a list with a [+] button click one by one.

Disable the button after reaching the list length limit.

because when I try to replicate your code in my project it generates this error: Cannot parse text argument to "list from csv row" as CSV-formatted row

In the contains text block, you do not have comma - , in piece.

Your block:

image

My block:

image

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