Daveyboy

Stumped - on a formula to display School Years.

5 posts in this topic

First - Thank you to those connected with Autoit - it has saved me countless hours administering our school network.

Second - Thank you to all that post here - you have also saved me countless hours 'Head Scratching', and saved me throwing the damn thing out the window on many an occasion, when my syntax isn't quite correct.......  :-(

 

Anyways - one that has me. The attached  image is a small table which I would like to reproduce dynamically when my script starts.

Here are the issues.

In the UK the school year runs from Sept - Aug.

Our users are in year groups - This year those students that joined us (Sept 2015) are now current 'Year 7's - and will be until August 2016.

From Sept 2016 that group will be 'Year 8's and the new intake will become 'Year 7's. etc, (I will need to go up to Year 14 - which they started School Sept 2008 !)

Its just a display (as a reference) to remind me which year group to pick somewhere else - it is not attached or the values would not be used for anything else.

Can anyone point me in the right direction ?

 

Thank you in advance.

Dave

year.jpg

Script.jpg

Share this post


Link to post
Share on other sites



build a new one on the fly everytime when generating the GUI?

#include<array.au3>

$sClass = "7"

If @MON >= 9 Then
    $Year = @YEAR
Else
    $Year = @YEAR - 1
EndIf

local $aClass = [[$sClass , $sClass - 1 , $sClass - 2 , $sClass - 3] , [$Year , $Year - 1, $Year - 2 , $Year - 3]]

_ArrayDisplay($aClass)

 


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Thank you very much - to the both of you for your replies.

 

9 lines of code........... and I've kicked this one around for weeks    :mad2:

 

Share this post


Link to post
Share on other sites

but i imagine you kicked around building an array and then manipulating it a year later when the trigger fired, do not dismiss those lessons they will come in useful.  But if you have no need for the data in that array (in that those values are known, can be retrieved elsewhere, or are derived mathematically), it is often easier to just build a new one that is correct and discard the old one.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now