Hi Richard,
i think it is working. I need to test it one or two days....
I'll keep you updated because i need also to understand the "true" statement.
Sorry forgot to upload the code.
The following is the one i have changed in order the date to change when the time is > 23
regarding thisCode:day_added = 0 hh = hh + 3 if hh > 23 then day_added = 1 endif hh = hh//24 if day_added = 1 then day = day + 1 if day > num_date then ; i havent done anything to this up to now. I need to figure out how to tell the programm about the num_date (No of the day today in this month) day = 1 if month > 12 then month = 1 year = year +1 endif endif endif
i think that i need to create a table with 12 months and specify which has 30, 31, or which year then has Feb 28 or 29Code:if day > num_date then ; i havent done anything to this up to now. I need to figure out how to tell the programm about the num_date (No of the day today in this month)
the only thing I might add is that the conversion from utc to local time only needs to be done if and when the hour changes , its not needed in every loop.
a flag can be set when the utc hour now is != current utc hour , then the flag can be cleared when the conversion is done
Warning I'm not a teacher
Hi Richard, once again thanks a lot for your kind help and time.
I work on this very slow, because i need to understand the code, and then i need to test the code every time i change something.
Now i need to fix the months. Please give me some time. I will upload the code and then we can discuss what might need to be done.
As i have it in mind, i need to create a label. Under the label i need to speciafy which month has 30 days and which has 31 at the begging. For the month February i need to specify which YEAR is 28 days and which is 29.
Then i will connect the code:
to the Label which has all the info for each month.Code:ay_added = 0 hh = hh + 3 if hh > 23 then day_added = 1 endif hh = hh//24 if day_added = 1 then day = day + 1 if day > num_date then ; i havent done anything to this up to now. I need to figure out how to tell the programm about the num_date (No of the day today in this month) day = 1 if month > 12 then month = 1 year = year +1 endif endif endif
Is that right?
getting the number of day in month can be achieved in a few ways
simple is lookup
but resource hungryLOOKUP Index,[Constant{,Constant...}],Var
lookup month,[0,31,28,31,30,,,,,,,,,,,,,],numberofdays
an array
more efficient but uses more sram
arraywrite ndays,[0,31,28,31,30,,,,,,,,,,,,,]
numberofdays=ndays[month]
leap years
are
if ((year//4 = 0) and (year//400 !=0))
if month=2 then numberofdays=numberofdays+1
endif
Warning I'm not a teacher
Hi Richard,
thanks! i need some time, as at work we need to be prepared for a surgery at a 1 day old baby. I have to design the heart model for pre-surgical planning. But this weekend i will try to fix the code with either lookup or arrays.
Bookmarks