Read data from table row by row

Tell me please.
How to read data from a table line by line from a specific field.
For example, the table has fields “A”, “B”, “C”
Count all rows from column “B”
Table created in “local storage”
I could use a “FOR” loop using the number of Rows as the boundary, but I don’t understand how. help me please :sweat:


A_B_C.pma (18.4 KB)

1 Like

I meant to get the data line by line in a loop. But thanks for your time :slightly_smiling_face:

For i = "amount of rows per column"
Variable = “the row value (i) of the selected column”
//some action on a variable
Next i

Do you need to count the number of rows or the sum of the values in a column? Such operations are best performed using a SQL query. Can you give more details of what you are trying to do? Then I will find a suitable example for you.

1 Like

Hello. I need to get row by row all the data from the cells of a certain table column by comparing them with a given constant value. If the result of the comparison is “TRUE”, then make the group of elements visible. :sweat:

Could you share part of your table data? Did I understand correctly that you need to display only those rows that match the condition (the value in a certain column must be equal to a constant).

1 Like

you don’t need to iterate through all the fields, you need a query that will return a specific value
in this example, the program is looking for the number of rows with a specific value in the specified column
the logic is simple, if the specified table has a field with the desired text, then we write “TRUE”

вам не нужно перебирать все поля, вам нужен запрос, который вернет определенное значение
в этом примере программа ищет количество строк с определенным значением в указанном столбце
логика простая, если в указанной таблице есть поле с нужным текстом, то пишем “ИСТИНА”


True_False.pma (18.8 KB)

1 Like

Looks like I didn’t get the point across.
I am making an app for myself. This app is called “School Bell Schedule”
Here is the prototype.
In it, you can add the start and end times of the lesson, as well as the duration of the break.

The task is that the program would make two sounds and messages in the blind. One sound should correspond to the beginning of the lesson and the notification “to the lesson”, and the second call “from the lesson” with the corresponding message.

  1. The program must check the time match with the one specified in the list, and if the match is in the “first part” of the line, then this is a call to the lesson, if the “second part” of the line matches, then this is a call to the lesson.

  2. When you click the “Add Row” button, I can create a new lesson not by manually specifying the time (the beginning of the lesson time), but with a time shift from the end of the previous lesson by the duration specified in the “break time”.
    N.B. Of course, there is still not enough button for specifying the duration of the lesson, so that the time interval between the beginning and end of the lesson with the duration specified by the user would be immediately formed. I just ran into the problem of organizing reading line by line in a loop and haven’t done it yet.

Похоже мне не удалось суть передать.
Я делаю приложение для себя. Это приложение называется “Расписание школьных звонков”
Вот прототип.
В нём можно добавить время начала урока и его конца, а так же длительность перемены.

Задача состоит в том, что бы программа издавала два звука и сообщения в шторку. Один звук должен соответствовать началу урока и уведомление “на урок”, а второй звонок “с урока” с соответствующим сообщением.

  1. Программа должна проверить совпадение по времени с указанным в списке и если совпадение по “первой части” в строке , то это звонок на урок, если “со второй частью” строки совпадает, то это звонок на урок.

  2. При нажатии кнопки “Добавить строку” Я могу создать новый урок не вручную указывая время (начало времени урока), а со сдвигом по времени от конца предыдущего урока на длительность указанную в “длительность перемены”.
    N.B. безусловно там ещё не хватает кнопки указания длительности урока, что бы сразу формировался промежуток времени между началом и концом урока длительностью указанную пользователем. Я просто столкнулся с проблемой организации чтения построчно в цикле и не стал пока это делать.

bell_schedule-proto.pma (254.3 KB)

I forgot to enable screen recording ))
you have hours-minutes-seconds in different columns, checking in one column is pointless
As I understand it, you need to be guided by the choice of an entry in the table, after which you constantly compare the value you have chosen with the local time. But before that, you need to collect everything in one time value.
add your own sounds

забыл включить запись с экрана ))
у вас часы-минуты-секунды в разных столбцах, проверять в одном столбце бессмысленно
Я так понимаю, вам нужно ориентироваться на выбор записи в таблице, после чего вы постоянно сравниваете выбранное вами значение с местным временем. Но перед этим нужно собрать все в одно временное значение.
добавить свои собственные звуки

create the beginning and end of the lesson and click on the field in the table
создайте начало и конец урока и нажмите на поле в таблице
test.pma (385.4 KB)

1 Like

Yes. But I proceeded from the fact that I will take local time and break it into hours, minutes and seconds. It’s pretty easy to organize in code. Compare hours, then minutes, then seconds. If all three match, then everything is fine and you can call.
However, thanks for the help. I’ll take a look tomorrow, because today, because of my work, I don’t have a brain, but melted cheese.
(I implemented the same program a long time ago, but in Visual Basic 6.0) Now it does not work for obvious reasons :rofl:

Да. Но я исходил из того, что я возьму местное время и разобью его на часы, минуты и секунды. В коде это довольно просто организовать. Сравниваем часы, затем минуты, затем секунды. Если по всем трём совпадение то всё отлично и можно звонить.
Однако спасибо за помощь. Я посмотрю завтра, потому, что сегодня у меня уже из-за работы не мозг а плавленный сыр.
(Я реализовывал давно такую же программу, но на Visual Basic 6.0) Теперь она не работает по понятным причинам :rofl:

Are you creating a desktop or mobile app? Because in a mobile application it will not work as you plan. A minimized or closed mobile app will not work, in other words, the mobile app does not run in the background.

For the mobile app, you can receive notifications at specific times. For android, you can also set a sound signal (alarm clock) for a specific time.

1 Like

Here and there. I don’t want it to be in the background. I also plan to add a countdown to the end of the lesson and a clock (current time) :smiling_face_with_three_hearts:

It is now clear. I will send you an example soon.


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.