Page 1 of 1

Help wanted with enum

PostPosted: Sun Apr 18, 2021 1:25 pm
by Jeisenga
Hi,

Anybody out there who can help me with ENUM?

I have the following script, and if I understand correctly, I should be able to use ENUM for that, but I can’t figure it out.
The code below works fine but I would like to understand ENUM.
Help is much appreciated.

Code: Select all
stTime t = getTime();
char dag[12];
switch (t.wday)
{
case 0: sprintf (dag, "Zondag"); break;
case 1: sprintf (dag, "Maandag"); break;
case 2: sprintf (dag, "Dinsdag"); break;
case 3: sprintf (dag, "Woensdag"); break;
case 4: sprintf (dag, "Donderdag"); break;
case 5: sprintf (dag, "Vrijdag"); break;
case 6: sprintf (dag, "Zaterdag"); break;
}
sprintf(Datum.text, "%s   %02d-%02d-%04d\n%02d:%02d:%02d", dag, t.mday,t.mon,t.year,t.hour,t.min,t.sec);