User`s guide

306 VEE User’s Guide
7 Using .NET with VEE
the week, current year, and to query whether it is a leap
year. The complete example is found in examples\dotnet\
DateTime.vee.
1 Select Device .NET Assembly References.
2 From the .NET tab, select the mscorlib checkbox. Choose
OK.
3 In the Import .NET Namespaces dialog box, select the System
checkbox. Choose OK.
4 Open the Function & Object Browser and select .NET/CLR
Objects.
5 Highlight the System namespace.
6 Highlight the DateTime type and the static property Now.
Choose the Create Get Formula button. Since this is a static
member, you do not need to create or get an instance of
the DateTime obect first.
7 Repeat steps 4 and 5, highlight the DateTime type. Note
that there are multiple versions of the ToString methods.
Highlight the simplest version, the one requiring no
parameters. Choose the Create Call button.
8 Wire the result pin of DateTime.Now formula box to the
dateTime input pin of the dateTime.ToString() formula box.
9 Add an Alphanumeric and wire it to the output pin of the
dateTime.ToString() formula box.
10 Repeat step 4 and 5, highlight the DateTime type and the
property DayOfWeek. Click the Create Get Formula button.
The DayOfWeek property returns another .NET object of
type System.DayOfWeek. Since every .NET object has a
ToString() method, you can use it to format and print out
the day of the week. So, edit the formula you just created
with VEE by appending “.ToString()” before the
semicolon.
11 Wire the result pin of the DateTime.Now formula to the
dateTime input pin of the dateTime.DayOf Week formula box.
12 Add an Alphanumeric and wire its input pin to the
output pin of the dateTimeDayOfWeek formula box.