Help, userbar and goto

Discussions about CSEntry
Post Reply
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Help, userbar and goto

Post by PHINOJOSA »

Good morning

I need your help, I must make a record of sections by grade in a school, where for each grade the section number, name of the section and number of students will be recorded.

In some schools they do not have all grades from first to fifth grade. Some will have 3 degrees, others 4 degrees and some 5 degrees.

And it happens that sometimes they forget to register some sections or they must update the data on the number of students in some grade and section, or they must save partially by cutting the record.

Reason why I have generated a userbar, this is where I ask for your help because if the school only registered 3 grades in the userbar, the 5 grades appear, I would like only the grades that have been registered to appear in the userbar.

I hope you can help me find the solution, I attach the project and images for reference.

Thank you so much
USERBAR.zip
(9.86 KiB) Downloaded 238 times
Captura00.png
Captura00.png (59.52 KiB) Viewed 40369 times
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Help, userbar and goto

Post by justinlakier »

Hi,

Currently, you add one button which leads to a function, and that function leads to all 5 grades. You can include logic in the goto() function which checks if a grade is currently registered before attempting the move to that particular grade. You could also add each grade as a separate goto function with a separate button on the userbar, and add or remove the buttons as their grades are registered or removed.

Hope this helps,
Justin
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: Help, userbar and goto

Post by PHINOJOSA »

Hello justinlakier
You can include logic in the goto() function which checks if a grade is currently registered
Because I am learning about programming it is difficult for me to even implement things like this, could you give me a code example so I can understand it better? What should I do, if I understand what location I should do, how to do it is what I don't know.

If you wish, you can freely modify the project you send.

Thank you for your time and support.

Sincerely Paul H
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Help, userbar and goto

Post by justinlakier »

Hi,

I've attached a modified version of Userbar.zip. It uses global numeric variables to keep track of the current grade and the current number of registered grades. It will not allow the user to go to a grade with userbar if that grade is is greater than the highest registered grade, and requires you to visit that grade normally and enter the onfocus to register the grade.

Hope this helps,
Justin
Attachments
Userbar.zip
(11.47 KiB) Downloaded 228 times
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: Help, userbar and goto

Post by PHINOJOSA »

Hi Justinlakier

I am very grateful for your support and for the time you take to help those like me who ask for support in this CSPro community.

I have tried to open the file and I get an error and the program closes, I am sending an attached image, is it the version of your CSPro? I am using CSPro 7.7
Captura01.PNG
Captura01.PNG (6.97 KiB) Viewed 37617 times
Captura02.PNG
Captura02.PNG (8.17 KiB) Viewed 37617 times
I have an additional question, how can I add the number of students in each section into a new variable?

I have used the sum function, but it adds cumulatively, for example:

var1 - var2
7 - 7
10 - 17
20 - 37

But I would like the total sum, which is 37, to be on each line:

var1 - var2
7 - 37
10 - 37
20 - 37

I tried max, but I get 999. Can that be done?

Greetings
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Help, userbar and goto

Post by justinlakier »

Hi,

The version I initially attached was for 8.0. I've attached the 7.7 version. This 7.7 version also includes a new variable holding the student sum. Since you wanted the same sum in each row rather than calculating consecutively, I had it overwrite the entire column of sum values whenever it calculates the latest sum.

Hope this helps,
Justin
Attachments
Userbar.zip
(10.33 KiB) Downloaded 223 times
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: Help, userbar and goto

Post by PHINOJOSA »

Hello justinlakier

Thank you very much, with this last modification you made to the project it works perfectly, this is the total sum and especially the filters for the grades.

Thank you very much for your support and time.

Greetings
Post Reply