AmiBroker AFL
DayOfWeek
Syntax: DayOfWeek()
Returns: ARRAY
Function: Returns the array with day of week (0-6):
0 - Sunday
1 - Monday
2 - Tuesday
3 - Wednesday
4 - Thursday
5 - Friday
6 - Saturday
I want to test DayOfWeek() and depending on the number returned, assign the corresponding day of the week to a variable.
I am thinking the Switch statement should do this but I am having trouble with the syntax.
switch(DayOfWeek)
{
case 1:
variable == Monday;
case 2:
variable == Tuesday;
case 3:
variable == Wednesday;
case 4:
variable == Thursday;
case 5:
variable == Friday;
}
What would be the correct way to code this?
DayOfWeek
Syntax: DayOfWeek()
Returns: ARRAY
Function: Returns the array with day of week (0-6):
0 - Sunday
1 - Monday
2 - Tuesday
3 - Wednesday
4 - Thursday
5 - Friday
6 - Saturday
I want to test DayOfWeek() and depending on the number returned, assign the corresponding day of the week to a variable.
I am thinking the Switch statement should do this but I am having trouble with the syntax.
switch(DayOfWeek)
{
case 1:
variable == Monday;
case 2:
variable == Tuesday;
case 3:
variable == Wednesday;
case 4:
variable == Thursday;
case 5:
variable == Friday;
}
What would be the correct way to code this?