Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[COLOR=#0000ff]/*** main ***/[/color]
usdate [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'06/15/2009'[/color]
[COLOR=#804040][b]say[/b][/color] [COLOR=#ff00ff]"Month of US date '"[/color]usdate[COLOR=#ff00ff]"' is:"[/color][highlight #ffff00][COLOR=#000000],[/color][/highlight]
[COLOR=#008080]month_of_usdate([/color]usdate[COLOR=#008080])[/color]
[COLOR=#804040][b]exit[/b][/color]
[COLOR=#0000ff]/*** procedures/functons ***/[/color]
[COLOR=#008080]month_of_usdate[/color]: [COLOR=#804040][b]procedure[/b][/color]
[COLOR=#804040][b]parse arg[/b][/color] usdate
month [COLOR=#804040][b]=[/b][/color] [COLOR=#008080]substr(strip([/color]usdate[COLOR=#008080])[/color][COLOR=#804040][b],[/b][/color]1[COLOR=#804040][b],[/b][/color]2[COLOR=#008080])[/color]
[COLOR=#804040][b]return[/b][/color] month
Month of US date '06/15/2009' is: 06
3 +++ datem = Date('M', ccyy||mm||dd, 'S');
Error in line 3: Incorrect call to routine.
[COLOR=#0000ff]/*** main ***/[/color]
usdate [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'06/15/2009'[/color]
[COLOR=#804040][b]say[/b][/color] [COLOR=#ff00ff]"Month of US date '"[/color]usdate[COLOR=#ff00ff]"' is:"[/color][highlight #ffff00][COLOR=#000000],[/color][/highlight]
[COLOR=#008080]month_of_usdate([/color]usdate[COLOR=#008080])[/color]
usdate [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'06/15/2009'[/color]
[COLOR=#804040][b]say[/b][/color] [COLOR=#ff00ff]"Month of US date '"[/color]usdate[COLOR=#ff00ff]"' is:"[/color][highlight #ffff00][COLOR=#000000],[/color][/highlight]
[COLOR=#008080]month_of_usdate([/color]usdate[COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]'NUM'[/color][COLOR=#008080])[/color]
usdate [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'13/15/2009'[/color]
[COLOR=#804040][b]say[/b][/color] [COLOR=#ff00ff]"Month of US date '"[/color]usdate[COLOR=#ff00ff]"' is:"[/color][highlight #ffff00][COLOR=#000000],[/color][/highlight]
[COLOR=#008080]month_of_usdate([/color]usdate[COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]'NUM'[/color][COLOR=#008080])[/color]
usdate [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'13/15/2009'[/color]
[COLOR=#804040][b]say[/b][/color] [COLOR=#ff00ff]"Month of US date '"[/color]usdate[COLOR=#ff00ff]"' is:"[/color][highlight #ffff00][COLOR=#000000],[/color][/highlight]
[COLOR=#008080]month_of_usdate([/color]usdate[COLOR=#008080])[/color]
[COLOR=#804040][b]exit[/b][/color]
[COLOR=#0000ff]/*** procedures/functons ***/[/color]
[COLOR=#008080]month_of_usdate[/color]: [COLOR=#804040][b]procedure[/b][/color]
[COLOR=#804040][b]parse arg[/b][/color] usdate[COLOR=#804040][b],[/b][/color] format
month [COLOR=#804040][b]=[/b][/color] [COLOR=#008080]substr(strip([/color]usdate[COLOR=#008080])[/color][COLOR=#804040][b],[/b][/color]1[COLOR=#804040][b],[/b][/color]2[COLOR=#008080])[/color]
[COLOR=#804040][b]if[/b][/color] format [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'NUM'[/color][COLOR=#804040][b] then[/b][/color]
[COLOR=#804040][b]if[/b][/color] month [COLOR=#804040][b]>=[/b][/color] 1 [COLOR=#804040][b]&[/b][/color] month [COLOR=#804040][b]<=[/b][/color] 12[COLOR=#804040][b] then[/b][/color]
retval [COLOR=#804040][b]=[/b][/color] month
[COLOR=#804040][b] else[/b][/color]
retval [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'ERROR'[/color]
[COLOR=#804040][b] else [/b][/color]
[COLOR=#804040][b]do[/b][/color]
months. [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'ERROR'[/color]
months.01 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'JAN'[/color]
months.02 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'FEB'[/color]
months.03 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'MAR'[/color]
months.04 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'APR'[/color]
months.05 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'MAY'[/color]
months.06 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'JUN'[/color]
months.07 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'JUL'[/color]
months.08 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'AUG'[/color]
months.09 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'SEP'[/color]
months.10 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'OKT'[/color]
months.11 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'NOV'[/color]
months.12 [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'DEC'[/color]
retval [COLOR=#804040][b]=[/b][/color] months.month
[COLOR=#804040][b]end[/b][/color]
[COLOR=#0000ff]/* return value */[/color]
[COLOR=#804040][b]return[/b][/color] retval
Month of US date '06/15/2009' is: JUN
Month of US date '06/15/2009' is: 06
Month of US date '13/15/2009' is: ERROR
Month of US date '13/15/2009' is: ERROR