1 (edited by leprince2007 2021-10-17 12:57:15)

Topic: How can I Make label captions blink?

Hello everybody,
Could you help me in my question ,please?
My app description: My app is about my work tasks(To do List)
Question:
I need to make label captions of specific tasks blink continuously with red color on specific days and one condition:
Task  :                 Days
-Acp attendance: 1st day of month+every Thursday
-AF Supplier’s deductions:Every 10 days (1-2-3-10-20-30)
-Casuarina:days( 10-20-last 5 days of the month)
-Take 5 together : last 3 days of the month
-Tests(Feeding-Shredding): days( 10-20-last 3 days of the month)
Condition: if the specified date is friday or Saturday,the flash should be on Sunday
See my project on the attachment
Feel free to asks any question
Please help me

Post's attachments

Attachment icon MyTasks.rar 309.21 kb, 234 downloads since 2021-10-09 

Re: How can I Make label captions blink?

Please help me

Re: How can I Make label captions blink?

Use a timer to make your labels flash according to whatever condition you specify.
See the attachment (I've done it for form1.label5 (AF Supplier Deductions).
Derek.

Post's attachments

Attachment icon mytasks2.zip 361.16 kb, 281 downloads since 2021-10-17 

Re: How can I Make label captions blink?

derek wrote:

Use a timer to make your labels flash according to whatever condition you specify.
See the attachment (I've done it for form1.label5 (AF Supplier Deductions).
Derek.

Thanks derek for your answer but forgive me I`am a noob I don`t know how to:
-Get day of today`s date
-Get last day of current month
-Get day of every Thursday
the result should be numbers like 1,2,3,...etc
please help me

5 (edited by sparrow 2021-10-19 13:49:13)

Re: How can I Make label captions blink?

StrToInt(FormatDateTime('d',Date)) - today`s day number
StrToInt(DaysInMonth(2021,10)) - last day of current month

for i := 1 to DaysInMonth(2021,10) do
  If DayOfWeek(EncodeDate(2021,10,i)) = 5 then r := r + ' ' + IntToStr(i);
Showmessage(r);
7  14  21  28

every Thursday of current month

6 (edited by leprince2007 2021-10-19 19:28:43)

Re: How can I Make label captions blink?

sparrow wrote:

StrToInt(FormatDateTime('d',Date)) - today`s day number
StrToInt(DaysInMonth(2021,10)) - last day of current month

for i := 1 to DaysInMonth(2021,10) do
  If DayOfWeek(EncodeDate(2021,10,i)) = 5 then r := r + ' ' + IntToStr(i);
Showmessage(r);
7  14  21  28

every Thursday of current month

Thanks sparrow for your reply but I`am a noob.I tried to write the code but there is an error and I don`t know how to solve it.
See my project in the attachment.
Please help

Post's attachments

Attachment icon mytasks2.rar 310.17 kb, 240 downloads since 2021-10-19 

Re: How can I Make label captions blink?

if StrToInt(FormatDateTime('d',Date))=1 or DayOfWeek(Date)=5 and form1.checkbox7.visible = true - invalid string (no brackets ()  )


if (a=b) or (a=c) then ... ; if ((a=b) or (a=c)) and (x<y) ...  if (a=b) or ((a=c) and (x<y)) ... the result depends on the correct placement of parentheses in the condition


if ((StrToInt(FormatDateTime('d',Date))=1) or (DayOfWeek(Date)=5)) and (form1.checkbox7.visible = true) - correct string

_____________________________________________________

StrToInt(DaysInMonth(Date)) - invalid string (Not Date), DaysInMonth(Year,Month)


DaysInMonth(StrToInt(FormatDateTime('yyyy',Date)),StrToInt(FormatDateTime('m',Date))) - correct string

_____________________________________________________

or (DaysInMonth(StrToInt(FormatDateTime('yyyy',Date)),StrToInt(FormatDateTime('m',Date)))-1   ) - no condition (<xxx) or (= xxx) or (> xxx)
     or (DaysInMonth(StrToInt(FormatDateTime('yyyy',Date)),StrToInt(FormatDateTime('m',Date)))   )) - no condition (<xxx) or (= xxx) or (> xxx)


or (DaysInMonth(StrToInt(FormatDateTime('yyyy',Date)),StrToInt(FormatDateTime('m',Date)))-1 < xx  )  - example

8 (edited by leprince2007 2021-10-20 09:22:01)

Re: How can I Make label captions blink?

sparrow wrote:

if StrToInt(FormatDateTime('d',Date))=1 or DayOfWeek(Date)=5 and form1.checkbox7.visible = true - invalid string (no brackets ()  )


if (a=b) or (a=c) then ... ; if ((a=b) or (a=c)) and (x<y) ...  if (a=b) or ((a=c) and (x<y)) ... the result depends on the correct placement of parentheses in the condition


if ((StrToInt(FormatDateTime('d',Date))=1) or (DayOfWeek(Date)=5)) and (form1.checkbox7.visible = true) - correct string
_____________________________________________________

Could you put it in the project file and then attach it ,please?
I`am a noob forgive me