Sign in to follow this  
Guest GerrishGray

Day of the week detection in scasm?

Recommended Posts

Hi,I'm trying to create macro which should be visible only at the weekend. So far without success. I'm able to detect number of the day in the year, but not in the week. Is there a way how to achieve this? Thanks.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

As far as I know there is no variable for day of the week, so the only one you could use is day of the year I think (although that would mean making a lot of different checks).

Share this post


Link to post
Share on other sites

That's exactly what I was trying to avoid :) I was thinking about this, but the code would be so complex and probably not feasible in scasm. But I'll probably give it a try before giving up...

Share this post


Link to post
Share on other sites

Jiri,maybe You could try diving day of year with 7, like:Uvar( $WeekOfYear int( $dayofyear / 7 )Anyway, I am interested though how You get day of Year, it could be useful for me :) Last time I tried to check for it it was unsuccessful :(Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

HiUntil the world moves over to 8-day weeks, with 3-day weekends of course :-), there is no practical way of doing this. Using SCASM variables is a non-starter - this only works at compile time, not run time.All you could do would be set up a 'lookup table' using Interpolate(). The only other trick I can think of would be to ask the pilot to indicate that it's the weekend by tuning NAV2, say, to a particular frequency.Good luckGerrish

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
Sign in to follow this