Spring 2006 - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Spring 2006

Description:

Spades = 4. End Enum. Can be used in case statements. The enumeration puts an precedence ... Spades Hearts. Namespaces. Collections of methods. Example ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 8
Provided by: BenM1
Category:
Tags: spades | spring

less

Transcript and Presenter's Notes

Title: Spring 2006


1
Tutorial 14 16
  • Spring 2006
  • INFS 308

2
Overview
  • Date variables
  • Datetimepicker
  • Timers
  • Random Numbers
  • Enumerated types
  • Namespaces

3
Date Variables
  • DateTimePicker
  • Dim dtmMytime as Date New Date(2003,1,1,0,0,0)
  • Date structure (properties)
  • Date(year, month, day, hour, minute, second)
  • Implies
  • dtmMytime.year dtmMytime.second
  • Date methods (addHours, AddDays, etc.)
  • dtmMytime.AddHours (integer)
  • Custom date format
  • hhmmss tt
  • Up-Down Arrows what happens here?

4
Timers
  • Timer
  • Enabled interval
  • Uses Component Tray
  • Setting is in what fraction of seconds?
  • Tick event

5
Random Numbers
  • Object class random
  • Dim objRandom as Random New Random
  • Use new to create Can use .Next method
  • Dim myRanNum As Integer objRandom.Next()
  • Set the range
  • Intmyint objRandom.next(6)
  • Intmyint objRandom.next(1,7)
  • Dblmydbl objRandom.nextdouble() 6
  • What is the range of each variable?

6
Enumerated Types
  • Declare set of variables and their order
  • Example
  • Enum Suites
  • Diamonds 1
  • Clubs 2
  • Hearts 3
  • Spades 4
  • End Enum
  • Can be used in case statements

The enumeration puts an precedence order to the
names. Spades gt Hearts
7
Namespaces
  • Collections of methods
  • Example
  • Imports System.IO
  • Goes above Public Class declaration in code
  • Directory.GetCurrentDirectoy provides current
    directory where program is running
Write a Comment
User Comments (0)
About PowerShow.com